Quote object UID for IMAP SEARCH command; read generated UID from XMLObject if we're working with libkolab bindings

This commit is contained in:
Thomas Bruederli 2012-11-08 14:03:06 +01:00
parent d98e8787c6
commit 6d75fdd5f3
2 changed files with 2 additions and 2 deletions

View file

@ -265,7 +265,7 @@ abstract class kolab_format
{
// get generated UID
if (!$this->data['uid']) {
$this->data['uid'] = kolabformat::getSerializedUID();
$this->data['uid'] = $this->xmlobject ? $this->xmlobject->getSerializedUID() : kolabformat::getSerializedUID();
$this->obj->setUid($this->data['uid']);
}
}

View file

@ -717,7 +717,7 @@ class kolab_storage_cache
{
if (!isset($this->uid2msg[$uid])) {
// use IMAP SEARCH to get the right message
$index = $this->imap->search_once($this->folder->name, ($deleted ? '' : 'UNDELETED ') . 'HEADER SUBJECT ' . $uid);
$index = $this->imap->search_once($this->folder->name, ($deleted ? '' : 'UNDELETED ') . 'HEADER SUBJECT "' . $uid. '"');
$results = $index->get();
$this->uid2msg[$uid] = $results[0];
}