From 6c725e6f5f323cdcf47105255e1feb0bd5467c5f Mon Sep 17 00:00:00 2001 From: "ctalbert%mozilla.com" Date: Sun, 2 Mar 2008 00:23:56 +0000 Subject: [PATCH] bug 361635 Make update invitations work by working around outlook issues r=Fallen git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@246854 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/calendar/base/src/calItipProcessor.js | 4 ++++ mozilla/calendar/lightning/content/imip-bar.js | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/mozilla/calendar/base/src/calItipProcessor.js b/mozilla/calendar/base/src/calItipProcessor.js index cc9e7a98de2..d92ac22c7c8 100644 --- a/mozilla/calendar/base/src/calItipProcessor.js +++ b/mozilla/calendar/base/src/calItipProcessor.js @@ -365,6 +365,10 @@ calItipProcessor.prototype = { // TODO: Handle generation properly - Bug 418345 aCalItem.generation = aExistingItem.generation; + // We also have to ensure that the calendar is set properly on + // the new item, or items with alarms will throw during the + // notification process + aCalItem.calendar = aExistingItem.calendar; aTargetCalendar.modifyItem(aCalItem, aExistingItem, aListener); return true; diff --git a/mozilla/calendar/lightning/content/imip-bar.js b/mozilla/calendar/lightning/content/imip-bar.js index bd956ae1150..fff5e656810 100644 --- a/mozilla/calendar/lightning/content/imip-bar.js +++ b/mozilla/calendar/lightning/content/imip-bar.js @@ -411,6 +411,13 @@ function isUpdateMsg() var itemList = gItipItem.getItemList({ }); var newSequence = itemList[0].getProperty("SEQUENCE"); + // Make sure we don't have a pre Outlook 2007 appointment, but if we do + // use Microsoft's Sequence number. I <3 MS + if ((newSequence == "0") && + itemList[0].hasProperty("X-MICROSOFT-CDO-APPT-SEQUENCE")) { + newSequence = itemList[0].getProperty("X-MICROSOFT-CDO-APPT-SEQUENCE"); + } + var onFindItemListener = { processedId: null, onOperationComplete: @@ -426,7 +433,14 @@ function isUpdateMsg() function ogr(aCalendar, aStatus, aItemType, aDetail, aCount, aItems) { if (aCount && aItems[0] && !this.processedId) { this.processedId = true; - determineUpdateType(newSequence, aItems[0].getProperty("SEQUENCE")); + var existingSequence = aItems[0].getProperty("SEQUENCE"); + + // Handle the microsoftism foolishness + if ((existingSequence == "0") && + itemList[0].hasProperty("X-MICROSOFT-CDO-APPT-SEQUENCE")) { + existingSequence = aItems[0].getProperty("X-MICROSOFT-CDO-APPT-SEQUENCE"); + } + determineUpdateType(newSequence, existingSequence); } } };