Fix bug 487008 - Wrong rendering of event invitation. r=philipp
authorDaniel Boelzle [:dbo] <mozilla@boelzle.org>
Thu, 23 Apr 2009 09:58:53 +0200
changeset 2459 7c952e8cd7bbac2aaee8e4cf1c8b656da5704282
parent 2458 aef2a3c5c542a116b243fd3c75ec9fa7fcfe7303
child 2460 69b81aa3618cde32a61fa8f4979c847f341e2855
push idunknown
push userunknown
push dateunknown
reviewersphilipp
bugs487008
Fix bug 487008 - Wrong rendering of event invitation. r=philipp
calendar/lightning/components/lightningTextCalendarConverter.js
--- a/calendar/lightning/components/lightningTextCalendarConverter.js
+++ b/calendar/lightning/components/lightningTextCalendarConverter.js
@@ -207,16 +207,24 @@ ltnMimeConverter.prototype = {
 
     convertToHTML: function lmcCTH(contentType, data) {
         let parser = Components.classes["@mozilla.org/calendar/ics-parser;1"]
                                .createInstance(Components.interfaces.calIIcsParser);
         parser.parseString(data, null);
         let event = null;
         for each (var item in parser.getItems({})) {
             if (isEvent(item)) {
+                if (item.hasProperty("X-MOZ-FAKED-MASTER")) {
+                    // if it's a faked master, take any overridden item to get a real occurrence:
+                    let exc = item.recurrenceInfo.getExceptionFor(item.startDate);
+                    cal.ASSERT(exc, "unexpected!");
+                    if (exc) {
+                        item = exc;
+                    }
+                }
                 event = item;
                 break;
             }
         }
         if (!event) {
             return;
         }
         let html = createHtml(event);