Commit 501b81f6 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.

Conflicts:
	src/backend/zarafa/importer.php
parent 6e24e777
......@@ -482,18 +482,21 @@ class ImportChangesICS implements IImportChanges {
// Get the entryid of the message we're moving
$entryid = mapi_msgstore_entryidfromsourcekey($this->store, $this->folderid, hex2bin($id));
if(!$entryid)
throw new StatusException(sprintf("ImportChangesICS->ImportMessageMove('%s','%s'): Error, unable to resolve source message id", $id, $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", $id, $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", $id, $newfolder, $errorCase, mapi_last_hresult()), $code);
}
// check if the source message is in the current syncinterval
......@@ -700,4 +703,4 @@ class ImportChangesICS implements IImportChanges {
return $ret;
}
}
?>
\ No newline at end of file
?>
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