Commit 96d81986 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #288 in ZP/z-push from...

Merge pull request #288 in ZP/z-push from bugfix/ZP-971-don-t-fail-when-source-message-id to develop

* commit 'ae2a761c':
  ZP-971 Don't fail when source message id is not found on move operations to the waste basket.
parents ae8a9fd3 ae2a761c
......@@ -550,18 +550,21 @@ class ImportChangesICS implements IImportChanges {
// Get the entryid of the message we're moving
$entryid = mapi_msgstore_entryidfromsourcekey($this->store, $this->folderid, hex2bin($sk));
if(!$entryid)
throw new StatusException(sprintf("ImportChangesICS->ImportMessageMove('%s','%s'): Error, unable to resolve source message id", $sk, $newfolder), SYNC_MOVEITEMSSTATUS_INVALIDSOURCEID);
$srcmessage = false;
//open the source message
$srcmessage = mapi_msgstore_openentry($this->store, $entryid);
if (!$srcmessage) {
if ($entryid) {
//open the source message
$srcmessage = mapi_msgstore_openentry($this->store, $entryid);
}
if(!$entryid || !$srcmessage) {
$code = SYNC_MOVEITEMSSTATUS_INVALIDSOURCEID;
// if we move to the trash and the source message is not found, we can also just tell the mobile that we successfully moved to avoid errors (ZP-624)
if ($newfolder == ZPush::GetBackend()->GetWasteBasket()) {
$code = SYNC_MOVEITEMSSTATUS_SUCCESS;
}
throw new StatusException(sprintf("ImportChangesICS->ImportMessageMove('%s','%s'): Error, unable to open source message: 0x%X", $sk, $newfolder, mapi_last_hresult()), $code);
$errorCase = !$entryid ? "resolve source message id" : "open source message";
throw new StatusException(sprintf("ImportChangesICS->ImportMessageMove('%s','%s'): Error, unable to %s: 0x%X", $sk, $newfolder, $errorCase, mapi_last_hresult()), $code);
}
// check if the source message is in the current syncinterval
......
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