Skip to content

Commit

Permalink
Support in Core for EAS 16 style of recurrence/exception handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Jan 21, 2016
1 parent efc945a commit 89a2b31
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
13 changes: 9 additions & 4 deletions framework/Core/lib/Horde/Core/ActiveSync/Connector.php
Expand Up @@ -210,12 +210,17 @@ public function calendar_replace($uid, Horde_ActiveSync_Message_Appointment $con
/**
* Delete an event from Horde's calendar storage
*
* @param string $uid The UID of the event to delete
* @param string $calendar The calendar id. @since 2.12.0
* @param string $uid The UID of the event to delete
* @param string $calendar The calendar id. @since 2.12.0 @deprecated (Not used).
* @param string $instanceid The instanceid if this is a EAS 16.0 instance.
* @since 2.23.0
*/
public function calendar_delete($uid, $calendar = null)
public function calendar_delete($uid, $calendar = null, $instanceid = null)
{
$this->_registry->calendar->delete($uid, null, $calendar);
if ($instanceid) {
$instanceid = new Horde_Date($instanceid, 'UTC');
}
$this->_registry->calendar->delete($uid, $instanceid, null);
}

/**
Expand Down
26 changes: 20 additions & 6 deletions framework/Core/lib/Horde/Core/ActiveSync/Driver.php
Expand Up @@ -1598,19 +1598,22 @@ public function statMessage($folderid, $id)
/**
* Delete a message
*
* @param string $folderid The folder id
* @param array $ids The message ids to delete
* @param string $folderid The folder id
* @param array $ids The message ids to delete
* @param boolean $instanceids If true, $ids is a hash of
* instanceids => uids. @since 2.23.0
*
* @return array An array of succesfully deleted messages (currently
* only guarenteed for email messages).
*/
public function deleteMessage($folderid, array $ids)
public function deleteMessage($folderid, array $ids, $instanceids = false)
{
$this->_logger->info(sprintf(
"[%s] Horde_Core_ActiveSync_Driver::deleteMessage() %s: %s",
"[%s] Horde_Core_ActiveSync_Driver::deleteMessage() %s: %s %s",
$this->_pid,
$folderid,
print_r($ids, true))
print_r($ids, true),
$instanceids)
);

$parts = $this->_parseFolderId($folderid);
Expand All @@ -1623,10 +1626,21 @@ public function deleteMessage($folderid, array $ids)
}
ob_start();
$results = $ids;

switch ($class) {
case Horde_ActiveSync::CLASS_CALENDAR:
if ($instanceids) {
reset($ids);
list($ids, $instanceid) = each($ids);
} else {
$instanceid = false;
}
try {
$this->_connector->calendar_delete($ids, $folder_id);
$this->_logger->info(sprintf(
'calendar_delete: %s %s %s',
print_r($ids, true), $folder_id, $instanceid)
);
$this->_connector->calendar_delete($ids, $folder_id, $instanceid);
} catch (Horde_Exception $e) {
// Since we don't get back successfully deleted ids and we can
// can pass an array of ids to delete, we need to see what ids
Expand Down

0 comments on commit 89a2b31

Please sign in to comment.