Fix bug 720253 - Zimbra uses different conflict code 409 instead of 412. r=release,a=philipp
authorPhilipp Kewisch <mozilla@kewis.ch>
Mon, 23 Jan 2012 00:13:45 +0100
changeset 10118 ee492eaff0e3301971b2e6fdcdf44efbf9cda57d
parent 10117 d68585c44d7352d83aafdfb3bdcf93f48aa2fbbd
child 10119 d27f4570cdce5d99b01eeff525c6f5f3d9c1f6b6
push idunknown
push userunknown
push dateunknown
reviewersrelease, philipp
bugs720253
Fix bug 720253 - Zimbra uses different conflict code 409 instead of 412. r=release,a=philipp
calendar/providers/caldav/calDavCalendar.js
--- a/calendar/providers/caldav/calDavCalendar.js
+++ b/calendar/providers/caldav/calDavCalendar.js
@@ -737,17 +737,17 @@ calDavCalendar.prototype = {
                 // the current state of the item
                 // Observers will be notified in getUpdatedItem()
                 thisCalendar.getUpdatedItem(aNewItem, aListener);
                 // SOGo has calendarUri == inboxUri so we need to be careful
                 // about deletions
                 if (wasInboxItem && thisCalendar.mShouldPollInbox) {
                     thisCalendar.doDeleteItemOrUseCache(aNewItem, true, null, true, true, null);
                 }
-            } else if (status == 412) {
+            } else if (status == 412 || status == 409) {
                 thisCalendar.promptOverwrite(CALDAV_MODIFY_ITEM, aNewItem,
                                              aListener, aOldItem);
             } else if ((status >= 500 && status <= 510) && (useCache && thisCalendar.mOfflineStorage)) {
                 cal.LOG("[calDavCalendar] doModifyItemOrUseCache received status code of server unavailibity. Putting entry in cache for later try.");
                 thisCalendar.modifyOfflineItem(aNewItem, aOldItem, aListener);
             } else {
                 if (status > 999) {
                     status = "0x " + status.toString(16);
@@ -904,17 +904,17 @@ calDavCalendar.prototype = {
                         thisCalendar.mOfflineStorage.deleteItem(aItem, aListener);
                     }
                     let decodedPath = thisCalendar.ensureDecodedPath(eventUri.path);
                     delete thisCalendar.mHrefIndex[decodedPath];
                     delete thisCalendar.mItemInfoCache[aItem.id];
                     cal.LOG("CalDAV: Item deleted successfully from calendar" +
                             thisCalendar.name);
                 }
-            } else if (status == 412) {
+            } else if (status == 412 || status == 409) {
                 // item has either been modified or deleted by someone else
                 // check to see which
 
                 let httpchannel2 = cal.prepHttpChannel(eventUri,
                                                        null,
                                                        null,
                                                        thisCalendar);
                 httpchannel2.requestMethod = "HEAD";