Bug 1268856 - Print email with event, the event is missing in the print-out;r+a=philipp
authormakemyday@gmx-topmail.de
Mon, 23 May 2016 23:48:00 +0200
changeset 24729 7a7aaa5c83c36fa02ba5f01eb78aa41cbf859a58
parent 24728 db466b11b439028cfd00f604d18750afa56620eb
child 24730 dfab8f086c880252c8c0cee5ed59b9a25e3b286a
push id57
push usermakemyday@gmx-topmail.de
push dateWed, 01 Jun 2016 20:55:37 +0000
treeherdercomm-esr45@629001d1a1a0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1268856
Bug 1268856 - Print email with event, the event is missing in the print-out;r+a=philipp
calendar/lightning/components/lightningTextCalendarConverter.js
--- a/calendar/lightning/components/lightningTextCalendarConverter.js
+++ b/calendar/lightning/components/lightningTextCalendarConverter.js
@@ -50,34 +50,34 @@ ltnMimeConverter.prototype = {
         if (!event) {
             return '';
         }
 
         let itipItem = null;
         let msgOverlay = '';
 
         try {
+            itipItem = Components.classes["@mozilla.org/calendar/itip-item;1"]
+                                 .createInstance(Components.interfaces.calIItipItem);
+            itipItem.init(data);
+            let dom = ltn.invitation.createInvitationOverlay(event, itipItem);
+            msgOverlay = cal.xml.serializeDOM(dom);
+
             // this.uri is the message URL that we are processing.
             // We use it to get the nsMsgHeaderSink to store the calItipItem.
             if (this.uri) {
                 let msgWindow = null;
                 try {
                     let msgUrl = this.uri.QueryInterface(Components.interfaces.nsIMsgMailNewsUrl);
                     // msgWindow is optional in some scenarios
                     // (e.g. gloda in action, throws NS_ERROR_INVALID_POINTER then)
                     msgWindow = msgUrl.msgWindow;
                 } catch (exc) {
                 }
                 if (msgWindow) {
-                    itipItem = Components.classes["@mozilla.org/calendar/itip-item;1"]
-                                         .createInstance(Components.interfaces.calIItipItem);
-                    itipItem.init(data);
-                    let dom = ltn.invitation.createInvitationOverlay(event, itipItem);
-                    msgOverlay = cal.xml.serializeDOM(dom);
-
                     let sinkProps = msgWindow.msgHeaderSink.properties;
                     sinkProps.setPropertyAsInterface("itipItem", itipItem);
                     sinkProps.setPropertyAsAUTF8String("msgOverlay", msgOverlay);
 
                     // Notify the observer that the itipItem is available
                     Services.obs.notifyObservers(null, "onItipItemCreation", 0);
                 }
             }