caICSService produces invalid ics

RESOLVED FIXED

Status

Calendar
Internal Components
RESOLVED FIXED
14 years ago
13 years ago

People

(Reporter: Michiel van Leeuwen (email: mvl+moz@), Assigned: shaver)

Tracking

Details

Attachments

(1 attachment)

calICSService produces this:
BEGIN:VCALENDAR
VERSION
 ;VALUE=STRING
 :2.0
METHOD
 ;VALUE=INTEGER
 :10012
END:VCALENDAR

expected:
BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
END:VCALENDAR

I'm not sure about the version part, but the method part isn't very interop
compatible like this. the number 10012 is something internal to libical.

testcase:

const calIICSService = Components.interfaces.calIICSService;
const calIIcalComponent = Components.interfaces.calIIcalComponent;
var icsServ = Components.classes["@mozilla.org/calendar/ics-service;1"]
                        .createInstance(Components.interfaces.calIICSService);
var calComp = icsServ.createIcalComponent(calIIcalComponent.VCALENDAR_COMPONENT);
calComp.version = "2.0";
calComp.method = calIIcalComponent.METHOD_PUBLISH;
dump(calComp.serializeToICS());
(Reporter)

Comment 1

14 years ago
Created attachment 168060 [details] [diff] [review]
possible patch

I'm not too happy about the naming etc in the patch, but it should produce
valid ics.
(Reporter)

Comment 2

14 years ago
With the current libical it should produce:
BEGIN:VCALENDAR
VERSION
 :2.0
METHOD
 :PUBLISH
END:VCALENDAR
Just a slight difference in whitespace.
Comment on attachment 168060 [details] [diff] [review]
possible patch

Looks fine to me.  Please land at your earliest convenience!
Attachment #168060 - Flags: first-review+
(Reporter)

Comment 4

14 years ago
patch checked in.
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED

Updated

13 years ago
QA Contact: vladimir → base
You need to log in before you can comment on or make changes to this bug.