Correctly implement the expunge argument for object deletion

This commit is contained in:
Thomas Bruederli 2012-03-08 21:32:22 +01:00
parent 83fe5ad8f5
commit 6e70c942c5
2 changed files with 23 additions and 2 deletions

16
plugins/libkolab/README Normal file
View file

@ -0,0 +1,16 @@
libkolab plugin to access to Kolab groupware data
=================================================
The contained library classes establish a connection to the Kolab server
and manage the access to the Kolab groupware objects stored in various
IMAP folders. For reading and writing these objects, the PHP bindings of
the libkolabxml library are used.
REQUIREMENTS
------------
* libkolabxml PHP bindings
- kolabformat.so loaded into PHP
- kolabformat.php placed somewhere in the include_path
* Horde Kolab_Format package and all of its dependencies

View file

@ -314,16 +314,21 @@ class kolab_storage_folder
* Delete the specified object from this folder.
*
* @param mixed $object The Kolab object to delete or object UID
* @param boolean $trigger Should the folder be triggered?
* @param boolean $expunge Should the folder be expunged?
* @param boolean $trigger Should the folder update be triggered?
*
* @return boolean True if successful, false on error
*/
public function delete($object, $expunge = true, $trigger = true)
{
if ($msguid = is_array($object) ? $object['_msguid'] : $this->uid2msguid($object)) {
$msguid = is_array($object) ? $object['_msguid'] : $this->uid2msguid($object);
if ($msguid && $expunge) {
return $this->imap->delete_message($msguid, $this->name);
}
else if ($msguid) {
return $this->imap->set_flag($msguid, 'DELETED', $this->name);
}
return false;
}