Fix bug 695247 - Allow opening event if invitation has already been processed - additional fix.,a=philipp
authorPhilipp Kewisch <mozilla@kewis.ch>
Fri, 04 Nov 2011 11:18:53 +0100
changeset 8987 af21343d6e4aa82263642eff411970a36002f55d
parent 8983 e8606afddbea58d62f3ac794b460da204617140a
child 8988 a5f8a5093daed28a3d7237e1167e638834e01b47
push idunknown
push userunknown
push dateunknown
reviewersphilipp
bugs695247
Fix bug 695247 - Allow opening event if invitation has already been processed - additional fix.,a=philipp
calendar/base/modules/calItipUtils.jsm
calendar/lightning/content/imip-bar.js
--- a/calendar/base/modules/calItipUtils.jsm
+++ b/calendar/base/modules/calItipUtils.jsm
@@ -1216,17 +1216,17 @@ ItipFindItemListener.prototype = {
                     } catch (exc) {
                         cal.ERROR(exc);
                     }
                 }
             };
             actionFunc.method = actionMethod;
         }
 
-        this.mOptionsFunc(this.mItipItem, rc, actionFunc);
+        this.mOptionsFunc(this.mItipItem, rc, actionFunc, this.mFoundItems);
     },
 
     onGetResult: function ItipFindItemListener_onGetResult(aCalendar,
                                                            aStatus,
                                                            aItemType,
                                                            aDetail,
                                                            aCount,
                                                            aItems) {
--- a/calendar/lightning/content/imip-bar.js
+++ b/calendar/lightning/content/imip-bar.js
@@ -45,16 +45,17 @@ Components.utils.import("resource://cale
 /**
  * This bar lives inside the message window.
  * Its lifetime is the lifetime of the main thunderbird message window.
  */
 var ltnImipBar = {
 
     actionFunc: null,
     itipItem: null,
+    foundItems: null,
 
     /**
      * Thunderbird Message listener interface, hide the bar before we begin
      */
     onStartHeaders: function onImipStartHeaders() {
       ltnImipBar.hideBar();
     },
 
@@ -133,23 +134,24 @@ var ltnImipBar = {
         document.getElementById("imip-bar").collapsed = true;
         hideElement("imip-button1");
         hideElement("imip-button2");
         hideElement("imip-button3");
         // Clear our iMIP/iTIP stuff so it doesn't contain stale information.
         ltnImipBar.itipItem = null;
     },
 
-    setupOptions: function setupOptions(itipItem, rc, actionFunc) {
+    setupOptions: function setupOptions(itipItem, rc, actionFunc, foundItems) {
         let imipBar =  document.getElementById("imip-bar");
         let data = cal.itip.getOptionsText(itipItem, rc, actionFunc);
 
         if (Components.isSuccessCode(rc)) {
             ltnImipBar.itipItem = itipItem;
             ltnImipBar.actionFunc = actionFunc;
+            ltnImipBar.foundItems = foundItems;
         }
 
         imipBar.setAttribute("label", data.label);
         for each (let button in ["button1", "button2", "button3"]) {
             let buttonElement = document.getElementById("imip-" + button);
             if (data[button].label) {
                 buttonElement.setAttribute("label", data[button].label);
                 buttonElement.setAttribute("oncommand",
@@ -157,20 +159,19 @@ var ltnImipBar = {
 
                 showElement(buttonElement);
             }
         }
     },
 
     executeAction: function ltnExecAction(partStat) {
         if (partStat == "X-SHOWDETAILS") {
-            let items = ltnImipBar.itipItem.getItemList({});
-            if (items.length) {
+            let items = ltnImipBar.foundItems;
+            if (items && items.length) {
                 let item = items[0].isMutable ? items[0] : items[0].clone();
-                item.calendar = ltnImipBar.itipItem.targetCalendar;
                 modifyEventWithDialog(item);
             }
         } else if (cal.itip.promptCalendar(ltnImipBar.actionFunc.method, ltnImipBar.itipItem, window)) {
             // hide the buttons now, to disable pressing them twice...
             hideElement("imip-button1");
             hideElement("imip-button2");
             hideElement("imip-button3");