Skip to content

Commit

Permalink
Initial support for sending responses to vTodo iTips.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Feb 6, 2015
1 parent 7df99c8 commit e182f15
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions imp/lib/Ajax/Imple/ItipRequest.php
Expand Up @@ -214,7 +214,8 @@ protected function _handle(Horde_Variables $vars)
case 'tentative':
// vEvent request.
if (isset($components[$key]) &&
($components[$key]->getType() == 'vEvent')) {
($components[$key]->getType() == 'vEvent' ||
$components[$key]->getType() == 'vTodo')) {
$vEvent = $components[$key];

$resource = new Horde_Itip_Resource_Identity(
Expand All @@ -238,17 +239,25 @@ protected function _handle(Horde_Variables $vars)
break;
}

try {
// Send the reply.
Horde_Itip::factory($vEvent, $resource)->sendMultiPartResponse(
if ($vEvent->getType() == 'vEvent') {
try {
// Send the reply.
Horde_Itip::factory($vEvent, $resource)->sendMultiPartResponse(
$type,
new Horde_Core_Itip_Response_Options_Horde('UTF-8', array()),
$injector->getInstance('IMP_Mail')
);
$notification->push(_("Reply Sent."), 'horde.success');
$result = true;
} catch (Horde_Itip_Exception $e) {
$notification->push(sprintf(_("Error sending reply: %s."), $e->getMessage()), 'horde.error');
}
} elseif ($vEvent->getType() == 'vTodo') {
Horde_Itip::vTodoFactory($vEvent, $resource)->sendMultiPartResponse(
$type,
new Horde_Core_Itip_Response_Options_Horde('UTF-8', array()),
$injector->getInstance('IMP_Mail')
);
$notification->push(_("Reply Sent."), 'horde.success');
$result = true;
} catch (Horde_Itip_Exception $e) {
$notification->push(sprintf(_("Error sending reply: %s."), $e->getMessage()), 'horde.error');
}
} else {
$notification->push(_("This action is not supported."), 'horde.warning');
Expand Down

0 comments on commit e182f15

Please sign in to comment.