Bug 918493 - Only show accept/decline for unprocessed REQUEST invitations. r=mmecca, a=Fallen
authorPhilipp Kewisch <mozilla@kewis.ch>
Sun, 06 Oct 2013 23:20:33 +0200
changeset 13128 e9910efb86e75793c5e4a105540f5308f18d36f3
parent 13127 d3e6499acad32f92612315a7c3e84bc96c2c8d51
child 13129 61db450ae0a5db6d606d2228838ac1fad809f7de
push id9549
push userryanvm@gmail.com
push dateTue, 08 Oct 2013 12:52:43 +0000
treeherdercomm-central@e9910efb86e7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmmecca, Fallen
bugs918493
Bug 918493 - Only show accept/decline for unprocessed REQUEST invitations. r=mmecca, a=Fallen
calendar/base/modules/calItipUtils.jsm
--- a/calendar/base/modules/calItipUtils.jsm
+++ b/calendar/base/modules/calItipUtils.jsm
@@ -1201,17 +1201,25 @@ ItipItemFinder.prototype = {
                                             if (att) {
                                                 att.isOrganizer = false;
                                             }
                                         }
                                         if (att) {
                                             let firstFoundItem = this.mFoundItems.length && this.mFoundItems[0];
                                             let foundAttendee = firstFoundItem.getAttendeeById(att.id);
 
-                                            if (foundAttendee.participationStatus == "NEEDS-ACTION") {
+                                            // If the the user hasn't responded to the invitation yet and we
+                                            // are viewing the current representation of the item, show the
+                                            // accept/decline buttons. This means newer events will show the
+                                            // "Update" button and older events will show the "already
+                                            // processed" text.
+                                            if (foundAttendee.participationStatus == "NEEDS-ACTION" &&
+                                                (item.calendar.getProperty("itip.disableRevisionChecks") ||
+                                                 cal.itip.compare(itipItemItem, item) == 0)) {
+
                                                 actionMethod = "REQUEST:NEEDS-ACTION";
                                                 operations.push(function(opListener, partStat) {
                                                     let changedItem = firstFoundItem.clone();
                                                     changedItem.removeAttendee(foundAttendee);
                                                     foundAttendee = foundAttendee.clone();
                                                     if (partStat) {
                                                         foundAttendee.participationStatus = partStat;
                                                     }