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 24629 7a68c141216bd6d3ca7c1b0a5b54b3eec7b89dd5
parent 24628 7d242c2c8475e3e4ec727fcc9620718dd3b1e964
child 24630 b00046532da51845a963f918c8cec1e410b2e21f
push id1647
push usermakemyday@gmx-topmail.de
push dateThu, 26 May 2016 18:46:20 +0000
treeherdercomm-beta@b00046532da5 [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);
                 }
             }