Commit 85dbce30 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge branch 'bugfix/ZP-895-integer-ids-can-trigger-name-switches' of...

Merge branch 'bugfix/ZP-895-integer-ids-can-trigger-name-switches' of https://stash.z-hub.io/scm/zp/z-push into feature/ZP-556-having-access-to-the-public-folder
parents 85cf6f6c 30181ce6
...@@ -481,6 +481,11 @@ class ImportChangesICS implements IImportChanges { ...@@ -481,6 +481,11 @@ class ImportChangesICS implements IImportChanges {
public function ImportMessageReadFlag($id, $flags) { public function ImportMessageReadFlag($id, $flags) {
list($fsk,$sk) = MAPIUtils::SplitMessageId($id); 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 // read flag change for our current folder
if ($this->folderidHex == $fsk || empty($fsk)) { if ($this->folderidHex == $fsk || empty($fsk)) {
...@@ -507,7 +512,9 @@ class ImportChangesICS implements IImportChanges { ...@@ -507,7 +512,9 @@ class ImportChangesICS implements IImportChanges {
} }
// yeah OL sucks - ZP-779 // yeah OL sucks - ZP-779
else { 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); $store = ZPush::GetBackend()->GetMAPIStoreForFolderId(ZPush::GetAdditionalSyncFolderStore($fsk), $fsk);
$entryid = mapi_msgstore_entryidfromsourcekey($store, hex2bin($fsk), hex2bin($sk)); $entryid = mapi_msgstore_entryidfromsourcekey($store, hex2bin($fsk), hex2bin($sk));
$realMessage = mapi_msgstore_openentry($store, $entryid); $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