From 3dd61a3ec5c3ff3e8209199afd28abdfd575ba6e Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Fri, 9 Jul 2010 12:34:19 -0400 Subject: [PATCH] Looks like this is probably what was intended. Calling calendar/export first while catching the exception will avoid unwanted notifications when this isn't actually an update operation. --- imp/lib/Mime/Viewer/Itip.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/imp/lib/Mime/Viewer/Itip.php b/imp/lib/Mime/Viewer/Itip.php index e734df4a8..376e49eb5 100644 --- a/imp/lib/Mime/Viewer/Itip.php +++ b/imp/lib/Mime/Viewer/Itip.php @@ -159,25 +159,25 @@ class IMP_Horde_Mime_Viewer_Itip extends Horde_Mime_Viewer_Driver case 'vEvent': $handled = false; $guid = $components[$key]->getAttribute('UID'); + // Check if this is an update. try { $registry->call('calendar/export', array($guid, 'text/calendar')); - } catch (Horde_Exception $e) {} - - // Try to update in calendar. - if ($registry->hasMethod('calendar/replace')) { - try { - $registry->call('calendar/replace', array('uid' => $guid, 'content' => $components[$key], 'contentType' => $this->_mimepart->getType())); - $handled = true; - $url = Horde::url($registry->link('calendar/show', array('uid' => $guid))); - $msgs[] = array('success', _("The event was updated in your calendar.") . - ' ' . Horde::link($url, _("View event"), null, '_blank') . Horde::img('mime/icalendar.png', _("View event")) . ''); - } catch (Horde_Exception $e) { - // Could be a missing permission. - $msgs[] = array('warning', _("There was an error updating the event:") . ' ' . $e->getMessage() . '. ' . _("Trying to import the event instead.")); + // Try to update in calendar. + if ($registry->hasMethod('calendar/replace')) { + try { + $registry->call('calendar/replace', array('uid' => $guid, 'content' => $components[$key], 'contentType' => $this->_mimepart->getType())); + $handled = true; + $url = Horde::url($registry->link('calendar/show', array('uid' => $guid))); + $msgs[] = array('success', _("The event was updated in your calendar.") . + ' ' . Horde::link($url, _("View event"), null, '_blank') . Horde::img('mime/icalendar.png', _("View event")) . ''); + } catch (Horde_Exception $e) { + // Could be a missing permission. + $msgs[] = array('warning', _("There was an error updating the event:") . ' ' . $e->getMessage() . '. ' . _("Trying to import the event instead.")); + } } - } - + } catch (Horde_Exception $e) {} + if (!$handled && $registry->hasMethod('calendar/import')) { // Import into calendar. $handled = true; -- 2.11.0