Commit 4a10fca5 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-1024 Prepend the short folderid to the MR ID of the calendar when on

accepting the MR.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 054390f0
...@@ -810,6 +810,7 @@ class BackendKopano implements IBackend, ISearchProvider { ...@@ -810,6 +810,7 @@ class BackendKopano implements IBackend, ISearchProvider {
// We have to return the ID of the new calendar item, so do that here // We have to return the ID of the new calendar item, so do that here
$calendarid = ""; $calendarid = "";
$calFolderId = "";
if (isset($entryid)) { if (isset($entryid)) {
$newitem = mapi_msgstore_openentry($this->store, $entryid); $newitem = mapi_msgstore_openentry($this->store, $entryid);
// new item might be in a delegator's store. ActiveSync does not support accepting them. // new item might be in a delegator's store. ActiveSync does not support accepting them.
...@@ -817,8 +818,9 @@ class BackendKopano implements IBackend, ISearchProvider { ...@@ -817,8 +818,9 @@ class BackendKopano implements IBackend, ISearchProvider {
throw new StatusException(sprintf("BackendKopano->MeetingResponse('%s','%s', '%s'): Object with entryid '%s' was not found in user's store (0x%X). It might be in a delegator's store.", $requestid, $folderid, $response, bin2hex($entryid), mapi_last_hresult()), SYNC_MEETRESPSTATUS_SERVERERROR, null, LOGLEVEL_WARN); throw new StatusException(sprintf("BackendKopano->MeetingResponse('%s','%s', '%s'): Object with entryid '%s' was not found in user's store (0x%X). It might be in a delegator's store.", $requestid, $folderid, $response, bin2hex($entryid), mapi_last_hresult()), SYNC_MEETRESPSTATUS_SERVERERROR, null, LOGLEVEL_WARN);
} }
$newprops = mapi_getprops($newitem, array(PR_SOURCE_KEY)); $newprops = mapi_getprops($newitem, array(PR_SOURCE_KEY, PR_PARENT_SOURCE_KEY));
$calendarid = bin2hex($newprops[PR_SOURCE_KEY]); $calendarid = bin2hex($newprops[PR_SOURCE_KEY]);
$calFolderId = bin2hex($newprops[PR_PARENT_SOURCE_KEY]);
} }
// on recurring items, the MeetingRequest class responds with a wrong entryid // on recurring items, the MeetingRequest class responds with a wrong entryid
...@@ -835,8 +837,9 @@ class BackendKopano implements IBackend, ISearchProvider { ...@@ -835,8 +837,9 @@ class BackendKopano implements IBackend, ISearchProvider {
if (is_array($items)) { if (is_array($items)) {
$newitem = mapi_msgstore_openentry($this->store, $items[0]); $newitem = mapi_msgstore_openentry($this->store, $items[0]);
$newprops = mapi_getprops($newitem, array(PR_SOURCE_KEY)); $newprops = mapi_getprops($newitem, array(PR_SOURCE_KEY, PR_PARENT_SOURCE_KEY));
$calendarid = bin2hex($newprops[PR_SOURCE_KEY]); $calendarid = bin2hex($newprops[PR_SOURCE_KEY]);
$calFolderId = bin2hex($newprops[PR_PARENT_SOURCE_KEY]);
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendKopano->MeetingResponse('%s','%s', '%s'): found other calendar entryid", $requestid, $folderid, $response)); ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendKopano->MeetingResponse('%s','%s', '%s'): found other calendar entryid", $requestid, $folderid, $response));
} }
...@@ -849,7 +852,15 @@ class BackendKopano implements IBackend, ISearchProvider { ...@@ -849,7 +852,15 @@ class BackendKopano implements IBackend, ISearchProvider {
$folder = mapi_msgstore_openentry($this->store, $folderentryid); $folder = mapi_msgstore_openentry($this->store, $folderentryid);
mapi_folder_deletemessages($folder, array($reqentryid), 0); mapi_folder_deletemessages($folder, array($reqentryid), 0);
return $calendarid; $prefix = '';
// prepend the short folderid of the target calendar: if available and short ids are used
if ($calFolderId) {
$shortFolderId = ZPush::GetDeviceManager()->GetFolderIdForBackendId($calFolderId);
if ($calFolderId != $shortFolderId) {
$prefix = $shortFolderId . ':';
}
}
return $prefix . $calendarid;
} }
/** /**
......
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