Bug 938455 - Items from calendars not implementing calISchedulingSupport cannot be edited, r=Fallen
authorKent James <kent@caspia.com>
Thu, 14 Nov 2013 10:41:24 -0800
changeset 16900 178eccc0971cebc3e04a1b41099cabb67ce90638
parent 16899 549a83dc09a2decf770042d0aa6bc62fe40a9994
child 16901 f583af6bca1ae57773f810d45434fecc8a2cae33
push id1074
push userbugzilla@standard8.plus.com
push dateMon, 03 Feb 2014 22:47:23 +0000
treeherdercomm-beta@6b791b5369ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFallen
bugs938455
Bug 938455 - Items from calendars not implementing calISchedulingSupport cannot be edited, r=Fallen
calendar/base/content/calendar-item-editing.js
--- a/calendar/base/content/calendar-item-editing.js
+++ b/calendar/base/content/calendar-item-editing.js
@@ -310,21 +310,19 @@ function openEventDialog(calendarItem, c
     };
 
     // the dialog will reset this to auto when it is done loading.
     window.setCursor("wait");
 
     // ask the provide if this item is an invitation. if this is the case
     // we'll open the summary dialog since the user is not allowed to change
     // the details of the item.
-    var isInvitation = false;
-    calendar = cal.wrapInstance(calendar, Components.interfaces.calISchedulingSupport);
-    if (calendar) {
-        isInvitation = calendar.isInvitation(calendarItem);
-    }
+    let wrappedCalendar = cal.wrapInstance(calendar, Components.interfaces.calISchedulingSupport);
+    let isInvitation = wrappedCalendar && wrappedCalendar.isInvitation(calendarItem);
+
     // open the dialog modeless
     let url;
     if (isCalendarWritable(calendar)
         && (mode == "new"
             || (mode == "modify" && !isInvitation && userCanModifyItem((calendarItem))))) {
         url = "chrome://calendar/content/calendar-event-dialog.xul";
     } else {
         url = "chrome://calendar/content/calendar-summary-dialog.xul";