Commit 30181ce6 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-895 Transform $fsk into a backendId after splitting. If message is in

another folder and no additional folderid is in the message id, we can
not perform the operation and fail.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 3e9eb346
......@@ -453,6 +453,11 @@ class ImportChangesICS implements IImportChanges {
public function ImportMessageReadFlag($id, $flags) {
list($fsk,$sk) = MAPIUtils::SplitMessageId($id);
// if $fsk is set, we convert it into a backend id.
if ($fsk) {
$fsk = ZPush::GetDeviceManager()->GetBackendIdForFolderId($fsk);
}
// read flag change for our current folder
if ($this->folderidHex == $fsk || empty($fsk)) {
......@@ -479,7 +484,9 @@ class ImportChangesICS implements IImportChanges {
}
// yeah OL sucks - ZP-779
else {
$fsk = ZPush::GetDeviceManager()->GetBackendIdForFolderId($fsk);
if (!$fsk) {
throw new StatusException(sprintf("ImportChangesICS->ImportMessageReadFlag('%s','%d'): Error setting read state. The message is in another folder but id is unknown as no short folder id is available. Please remove your device states to fully resync your device. Operation ignored.", $id, $flags), SYNC_STATUS_OBJECTNOTFOUND);
}
$store = ZPush::GetBackend()->GetMAPIStoreForFolderId(ZPush::GetAdditionalSyncFolderStore($fsk), $fsk);
$entryid = mapi_msgstore_entryidfromsourcekey($store, hex2bin($fsk), hex2bin($sk));
$realMessage = mapi_msgstore_openentry($store, $entryid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment