Skip to content

Commit

Permalink
Final (?) fix for figuring out the ORGANIZER for todo.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Feb 20, 2015
1 parent f96f075 commit b4d3230
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions framework/Compress/lib/Horde/Compress/Tnef/VTodo.php
Expand Up @@ -341,9 +341,6 @@ public function setMapiAttribute($type, $name, $value, $ns = null)
case self::MAPI_TASK_STATE:
$this->_state = $value;
break;
case Horde_Compress_Tnef::MAPI_LAST_MODIFIER_NAME:
$this->_lastUser = $value;
break;
// case self::MAPI_TASK_ASSIGNER:
// // *sigh* This isn't set by Outlook/Exchange until AFTER the
// // assignee receives the request. I.e., this is blank on the initial
Expand All @@ -356,14 +353,17 @@ public function setMapiAttribute($type, $name, $value, $ns = null)
// // Before client sends an ACCEPT, it is set to the assignee.
// // Before client sneds REJECT, it is set to the assigner, not assignee.
// // Unfortunately, it is only the display name, not the email!
// //$this->_lastUser = $value;
break;
// $this->_lastUser = $value;
// break;
}
} else {
// pidTag?
switch ($name) {
case Horde_Compress_Tnef::MAPI_SENT_REP_EMAIL_ADDR:
$this->_organizer = $value;
break;
case Horde_Compress_Tnef::MAPI_LAST_MODIFIER_NAME:
$this->_lastUser = $value;
}
}
}
Expand Down Expand Up @@ -392,7 +392,10 @@ protected function _tovTodo()

// For REQUESTS, we MUST have the ORGANIZER and an ATTENDEE.
if ($this->_state == self::STATE_ASSIGNERS_COPY || $this->_ownership == self::OWNERSHIP_ASSIGNERS_COPY) {
$vtodo->setAttribute('ORGANIZER', 'mailto: ' . $this->_organizer);
// When sending a REQUEST the lastUser to edit it should be the
// ORGANIZER. I can't find any of the other properties that work
// consistently.
$vtodo->setAttribute('ORGANIZER', 'mailto: ' . $this->_lastUser);
$list = new Horde_Mail_Rfc822_List($this->_owner);
foreach ($list as $email) {
$vtodo->setAttribute('ATTENDEE', $email, array('ROLE' => 'REQ-PARTICIPANT'));
Expand Down

0 comments on commit b4d3230

Please sign in to comment.