Closed Bug 273440 Opened 20 years ago Closed 20 years ago

caICSService produces invalid ics

Categories

(Calendar :: Internal Components, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mvl, Assigned: shaver)

Details

Attachments

(1 file)

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());
Attached patch possible patch — — Splinter Review
I'm not too happy about the naming etc in the patch, but it should produce
valid ics.
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+
patch checked in.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
QA Contact: vladimir → base
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: