Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/mime_drivers.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@
'handles' => [
'text/calendar',
'text/x-vcalendar',
'application/ics',
],
'icons' => [
'default' => 'itip.png',
Expand Down
4 changes: 1 addition & 3 deletions lib/Ajax/Imple/ItipRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
* @copyright 2012-2017 Horde LLC
* @license http://www.horde.org/licenses/gpl GPL
* @package IMP
*/

use Horde\Util\Variables;
*/

/**
* Attach javascript used to process Itip actions into a page.
Expand All @@ -22,8 +22,6 @@
* @copyright 2012-2017 Horde LLC
* @license http://www.horde.org/licenses/gpl GPL
* @package IMP

use Horde\Util\Variables;
*/
class IMP_Ajax_Imple_ItipRequest extends Horde_Core_Ajax_Imple
{
Expand Down
4 changes: 1 addition & 3 deletions lib/Ajax/Imple/PassphraseDialog.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
* @copyright 2010-2017 Horde LLC
* @license http://www.horde.org/licenses/gpl GPL
* @package IMP
*/

use Horde\Util\Variables;
*/

/**
* Attach the passphrase dialog to the page.
Expand All @@ -22,8 +22,6 @@
* @copyright 2010-2017 Horde LLC
* @license http://www.horde.org/licenses/gpl GPL
* @package IMP

use Horde\Util\Variables;
*/
class IMP_Ajax_Imple_PassphraseDialog extends Horde_Core_Ajax_Imple
{
Expand Down
4 changes: 1 addition & 3 deletions lib/Ajax/Imple/VcardImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
* @copyright 2012-2017 Horde LLC
* @license http://www.horde.org/licenses/gpl GPL
* @package IMP
*/

use Horde\Util\Variables;
*/

/**
* Attach javascript used to process a Vcard import request from IMP.
Expand All @@ -22,8 +22,6 @@
* @copyright 2014-2017 Horde LLC
* @license http://www.horde.org/licenses/gpl GPL
* @package IMP

use Horde\Util\Variables;
*/
class IMP_Ajax_Imple_VcardImport extends Horde_Core_Ajax_Imple
{
Expand Down
22 changes: 14 additions & 8 deletions lib/Mime/Viewer/Itip.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,7 @@ protected function _vEvent($vevent, $id, $method = 'PUBLISH', $components = [])

case 'REPLY':
$desc = _('%s has replied to the invitation to "%s".');
$from = $this->getConfigParam('imp_contents')->getHeader()->getHeader('from');
$sender = $from
? $from->getAddressList(true)->first()->bare_address
: null;
$sender = $this->_senderFromHeader();
if ($registry->hasMethod('calendar/updateAttendee')
&& $this->_autoUpdateReply(self::AUTO_UPDATE_EVENT_REPLY, $sender)) {
try {
Expand Down Expand Up @@ -752,10 +749,7 @@ protected function _vTodo($vtodo, $id, $method)

case 'REPLY':
$desc = _('%s has replied to the assignment of task "%s".');
$from = $this->getConfigParam('imp_contents')->getHeader()->getHeader('from');
$sender = $from
? $from->getAddressList(true)->first()->bare_address
: null;
$sender = $this->_senderFromHeader();

if ($registry->hasMethod('tasks/updateAttendee')
&& $this->_autoUpdateReply(self::AUTO_UPDATE_TASK_REPLY, $sender)) {
Expand Down Expand Up @@ -929,6 +923,18 @@ protected function _parseAttendees($data, $attendees)
*
* @return boolean
*/
protected function _senderFromHeader()
{
$from = $this->getConfigParam('imp_contents')->getHeader()->getHeader('from');
if (!$from) {
return null;
}

$addr = $from->getAddressList(true)->first();

return $addr ? $addr->bare_address : null;
}

protected function _autoUpdateReply($type, $sender)
{
if (!empty($this->_conf[$type])) {
Expand Down
Loading