Skip to content

Commit

Permalink
Only issue a 'delete' action if all copies of an object are gone
Browse files Browse the repository at this point in the history
Otherwise we just deleted a duplicated object or updated the original one.
(An update results in an ADDED + DELETED folder action)
  • Loading branch information
thomasjfox authored and mrubinsk committed Jun 5, 2015
1 parent fc7565e commit 9c97608
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -95,9 +95,15 @@ public function synchronize($params = array())
foreach ($params['changes'][Horde_Kolab_Storage_Folder_Stamp::ADDED] as $bid => $object) {
$this->_updateLog($prefix.$object['uid'], $bid, $stamp);
}
foreach ($params['changes'][Horde_Kolab_Storage_Folder_Stamp::DELETED] as $bid => $object) {
foreach ($params['changes'][Horde_Kolab_Storage_Folder_Stamp::DELETED] as $bid => $object_uid) {
// Check if the object is really gone from the folder.
// Otherwise we just deleted a duplicated object or updated the original one.
// (An update results in an ADDED + DELETED folder action)
if ($this->data->objectIdExists($object_uid) == true)
continue;

$this->history->log(
$prefix.$object, array('action' => 'delete', 'bid' => $bid, 'stamp' => $stamp), true
$prefix.$object_uid, array('action' => 'delete', 'bid' => $bid, 'stamp' => $stamp), true
);
}
} else {
Expand Down

0 comments on commit 9c97608

Please sign in to comment.