Fix bug 938455 - Items in Calendars not implementing calISchedulingSupport cannot be modified. r/a=philipp
authorKent James <kent@caspia.com>
Fri, 21 Mar 2014 12:44:48 +0100
changeset 16095 e49d1ca3ab589f3e3f4432e20751fc3c0036e314
parent 16094 6c5fab44d21d03d155f41ced15ef9cecfadaf64d
child 16096 0fc420befbfe6e1baa0a0990a418fe69a15537fd
push id50
push usermozilla@kewis.ch
push dateFri, 21 Mar 2014 11:45:12 +0000
bugs938455
Fix bug 938455 - Items in Calendars not implementing calISchedulingSupport cannot be modified. r/a=philipp
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";