Bug 994200 - Changing calendar in event dialog may cause an inappropriate organizer/attendee set. r+a=philipp
authorMakeMyDay <makemyday@gmx-topmail.de>
Wed, 09 Apr 2014 19:52:52 +0200
changeset 19689 23abaf03b0b6ecf913faa3e6d3a30ae95cab5f1c
parent 19688 871a5ad7e33b7c91bdada323b6bfdd462db26d49
child 19690 b6127809aa04e25ee8b00d6428a26012ad4babfe
push id1133
push usermbanner@mozilla.com
push dateMon, 28 Apr 2014 19:42:02 +0000
treeherdercomm-beta@ca498fc736fc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs994200
Bug 994200 - Changing calendar in event dialog may cause an inappropriate organizer/attendee set. r+a=philipp CLOSED TREE
calendar/base/content/dialogs/calendar-event-dialog.js
--- a/calendar/base/content/dialogs/calendar-event-dialog.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog.js
@@ -30,16 +30,17 @@ var gPrivacy = null;
 var gAttachMap = {};
 var gPriority = 0;
 var gStatus = "NONE";
 var gConfirmCancel = true;
 var gLastRepeatSelection = 0;
 var gIgnoreUpdate = false;
 var gShowTimeAs = null;
 var gWarning = false;
+var gPreviousCalendarId = null;
 
 var eventDialogQuitObserver = {
   observe: function(aSubject, aTopic, aData) {
     // Check whether or not we want to veto the quit request (unless another
     // observer already did.
     if (aTopic == "quit-application-requested" &&
         (aSubject instanceof Components.interfaces.nsISupportsPRBool) &&
         !aSubject.data)
@@ -2281,22 +2282,27 @@ function removeNotification(aValue) {
  * Update the dialog controls related related to the item's calendar.
  */
 function updateCalendar() {
     let item = window.calendarItem;
     let calendar = getCurrentCalendar();
 
     gIsReadOnly = calendar.readOnly;
 
+    if (!gPreviousCalendarId) {
+        gPreviousCalendarId = item.calendar.id;
+    }
+
     // We might have to change the organizer, let's see
     let calendarOrgId = calendar.getProperty("organizerId");
-    if (window.organizer && calendar.aclEntry && calendarOrgId &&
-        calendar.id != item.calendar.id) {
+    if (window.organizer && calendarOrgId &&
+        calendar.id != gPreviousCalendarId) {
         window.organizer.id = calendarOrgId;
         window.organizer.commonName = calendar.getProperty("organizerCN");
+        gPreviousCalendarId = calendar.id;
     }
 
     if (!canNotifyAttendees(calendar, item) && calendar.getProperty("imip.identity")) {
         enableElement("notify-attendees-checkbox");
         enableElement("undisclose-attendees-checkbox");
     } else {
         disableElement("notify-attendees-checkbox");
         disableElement("undisclose-attendees-checkbox");