Bug 1238381 - Declining of invitation does not work;r+a=philipp RELEASE_BASE_20160125
authorMakeMyDay <makemyday@gmx-topmail.de>
Fri, 22 Jan 2016 20:14:46 +0100
changeset 23591 edcecc72bbb22f4fdadce49dfa038174198c8fa6
parent 23590 a679f3cf6097123e11ce228926105c0268318eaf
child 23592 c5ef105726f2a0fbec55c5269d8bc58d22dcc4ca
push idunknown
push userunknown
push dateunknown
bugs1238381
Bug 1238381 - Declining of invitation does not work;r+a=philipp
calendar/base/modules/calItipUtils.jsm
--- a/calendar/base/modules/calItipUtils.jsm
+++ b/calendar/base/modules/calItipUtils.jsm
@@ -577,34 +577,35 @@ cal.itip = {
                 }
             }
         }
 
         let autoResponse = { value: false }; // controls confirm to send email only once
 
         let invitedAttendee = cal.isInvitation(aItem) && cal.getInvitedAttendee(aItem);
         if (invitedAttendee) { // actually is an invitation copy, fix attendee list to send REPLY
-            invitedAttendee = invitedAttendee.clone();
             /* We check if the attendee id matches one of of the
              * userAddresses. If they aren't equal, it means that
              * someone is accepting invitations on behalf of an other user. */
             if (aItem.calendar.aclEntry) {
                 let userAddresses = aItem.calendar.aclEntry.getUserAddresses({});
                 if (userAddresses.length > 0
                     && !cal.attendeeMatchesAddresses(invitedAttendee, userAddresses)) {
+                    invitedAttendee = invitedAttendee.clone();
                     invitedAttendee.setProperty("SENT-BY", "mailto:" + userAddresses[0]);
                 }
             }
 
             if (aItem.organizer) {
                 let origInvitedAttendee = (aOriginalItem && aOriginalItem.getAttendeeById(invitedAttendee.id));
 
                 if (aOpType == Components.interfaces.calIOperationListener.DELETE) {
                     // in case the attendee has just deleted the item, we want to send out a DECLINED REPLY:
                     origInvitedAttendee = invitedAttendee;
+                    invitedAttendee = invitedAttendee.clone();
                     invitedAttendee.participationStatus = "DECLINED";
                 }
 
                 // We want to send a REPLY send if:
                 // - there has been a PARTSTAT change
                 // - in case of an organizer SEQUENCE bump we'd go and reconfirm our PARTSTAT
                 if (!origInvitedAttendee ||
                     (origInvitedAttendee.participationStatus != invitedAttendee.participationStatus) ||