Fix bug 719016 - responding to invitations as an attendee fails to set the "SENT-BY" attribute. r=philipp,a=philipp
authorWolfgang Sourdeau <wsourdeau@inverse.ca>
Thu, 19 Jan 2012 23:53:38 +0100
changeset 10112 8e05a7b2b59316bff698ec7f1bd048b6c18e3d9a
parent 10111 e8183d8c8b02a941545d329c93ee3e20778c2cfa
child 10113 e745a2e5db840c45d41a401ef08e8539a3ab5224
push idunknown
push userunknown
push dateunknown
reviewersphilipp, philipp
bugs719016
Fix bug 719016 - responding to invitations as an attendee fails to set the "SENT-BY" attribute. r=philipp,a=philipp
calendar/base/content/dialogs/calendar-summary-dialog.js
--- a/calendar/base/content/dialogs/calendar-summary-dialog.js
+++ b/calendar/base/content/dialogs/calendar-summary-dialog.js
@@ -242,16 +242,26 @@ function updateInvitationStatus() {
  * When the summary dialog is showing an invitation, this function updates the
  * user's invitation status from the value chosen in the dialog.
  *
  * XXX rename me!
  */
 function updateInvitation() {
   var statusElement = document.getElementById("item-participation");
   if (window.attendee) {
+      let item = window.arguments[0];
+      let aclEntry = item.calendar.aclEntry;
+      if (aclEntry) {
+          let userAddresses = aclEntry.getUserAddresses({});
+          if (userAddresses.length > 0
+              && !cal.attendeeMatchesAddresses(window.attendee, userAddresses)) {
+              window.attendee.setProperty("SENT-BY", userAddresses[0]);
+          }
+      }
+
       window.attendee.participationStatus = statusElement.value;
   }
 }
 
 /**
  * Updates the dialog w.r.t recurrence, i.e shows a text describing the item's
  * recurrence)
  */