Fix bug 723533 - Lightning 1.2 does not send invites from CalDAV cals; only cancellations. r=wsourdeau (tentative),a=philipp
authorPhilipp Kewisch <mozilla@kewis.ch>
Mon, 05 Mar 2012 20:17:43 +0100
changeset 10229 e6458d7f3aebff724a3d5b35c61ae77b1293483a
parent 10228 9f2a7e1b2d1af2bffbb79cdae5e591f8fc1c2126
child 10234 6637682315e3ab5acd3381b17a534e6fbc12204f
push idunknown
push userunknown
push dateunknown
reviewerswsourdeau, philipp
bugs723533
Fix bug 723533 - Lightning 1.2 does not send invites from CalDAV cals; only cancellations. r=wsourdeau (tentative),a=philipp
calendar/base/modules/calItipUtils.jsm
calendar/providers/caldav/calDavCalendar.js
--- a/calendar/base/modules/calItipUtils.jsm
+++ b/calendar/base/modules/calItipUtils.jsm
@@ -668,23 +668,17 @@ cal.itip = {
             // check whether it's a simple UPDATE (no SEQUENCE change) or real (RE)REQUEST,
             // in case of time or location/description change.
             let isMinorUpdate = (aOriginalItem && (cal.itip.getSequence(aItem) == cal.itip.getSequence(aOriginalItem)));
 
             if (!isMinorUpdate || !cal.compareItemContent(stripUserData(aItem), stripUserData(aOriginalItem))) {
 
                 let requestItem = aItem.clone();
                 if (!requestItem.organizer) {
-                    let organizer = cal.createAttendee();
-                    organizer.id = requestItem.calendar.getProperty("organizerId");
-                    organizer.commonName = requestItem.calendar.getProperty("organizerCN");
-                    organizer.role = "REQ-PARTICIPANT";
-                    organizer.participationStatus = "ACCEPTED";
-                    organizer.isOrganizer = true;
-                    requestItem.organizer = organizer;
+                    requestItem.organizer = createOrganizer(requestItem.calendar);
                 }
 
                 // Fix up our attendees for invitations using some good defaults
                 let recipients = [];
                 let itemAtt = requestItem.getAttendees({});
                 if (!isMinorUpdate) {
                     requestItem.removeAllAttendees();
                 }
--- a/calendar/providers/caldav/calDavCalendar.js
+++ b/calendar/providers/caldav/calDavCalendar.js
@@ -449,17 +449,17 @@ calDavCalendar.prototype = {
             return this.mItemInfoCache[aItem.id].locationPath;
         } else {
             // New items just use id.ics
             return aItem.id + ".ics";
         }
     },
 
     getProperty: function caldav_getProperty(aName) {
-        if (aName in this.mACLProperties) {
+        if (aName in this.mACLProperties && this.mACLProperties[aName]) {
             return this.mACLProperties[aName];
         }
 
         switch (aName) {
             case "organizerId":
                 if (this.calendarUserAddress) {
                     return this.calendarUserAddress;
                 } // else use configured email identity
@@ -1250,17 +1250,21 @@ calDavCalendar.prototype = {
                 this.mQueuedQueries.push(arguments);
             } else {
                 this.mOfflineStorage.getItems.apply(this.mOfflineStorage, arguments);
             }
         }
     },
 
     fillACLProperties: function caldav_fillACLProperties() {
-        this.mACLProperties["organizerId"] = this.calendarUserAddress;
+        let orgId = this.calendarUserAddress;
+        if (orgId) {
+            this.mACLProperties["organizerId"] = orgId;
+        }
+
         if (this.mACLEntry && this.mACLEntry.hasAccessControl) {
             let ownerIdentities = this.mACLEntry.getOwnerIdentities({});
             if (ownerIdentities.length > 0) {
                 let identity = ownerIdentities[0];
                 this.mACLProperties["organizerId"] = identity.email;
                 this.mACLProperties["organizerCN"] = identity.fullName;
                 this.mACLProperties["imip.identity"] = identity;
             }