Commit 434057e2 authored by zhub admin's avatar zhub admin

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

Merge pull request #421 in ZP/z-push from ~JELLE/z-push:replace-mapi_openpropertytostream to bugfix/ZP-1097-change-calls-to-deprecated-mapi_openpropertytostream

* commit '0a7c9f27':
  replace deprecated mapi_openpropertytostream
parents f7490789 0a7c9f27
...@@ -730,7 +730,7 @@ class BackendKopano implements IBackend, ISearchProvider { ...@@ -730,7 +730,7 @@ class BackendKopano implements IBackend, ISearchProvider {
$attachment->contenttype = "message/rfc822"; $attachment->contenttype = "message/rfc822";
} }
else else
$stream = mapi_openpropertytostream($attach, PR_ATTACH_DATA_BIN); $stream = mapi_openproperty($attach, PR_ATTACH_DATA_BIN, IID_IStream, 0, 0);
if(!$stream) if(!$stream)
throw new StatusException(sprintf("KopanoBackend->GetAttachmentData('%s'): Error, unable to open attachment data stream: 0x%X", $attname, mapi_last_hresult()), SYNC_ITEMOPERATIONSSTATUS_INVALIDATT); throw new StatusException(sprintf("KopanoBackend->GetAttachmentData('%s'): Error, unable to open attachment data stream: 0x%X", $attname, mapi_last_hresult()), SYNC_ITEMOPERATIONSSTATUS_INVALIDATT);
......
...@@ -304,7 +304,7 @@ ...@@ -304,7 +304,7 @@
if (!empty($msgbody) && strrpos($msgbody, $separator) === false) { if (!empty($msgbody) && strrpos($msgbody, $separator) === false) {
$msgbody = $separator . $msgbody; $msgbody = $separator . $msgbody;
$stream = mapi_openpropertytostream($this->message, PR_BODY, MAPI_CREATE | MAPI_MODIFY); $stream = mapi_openproperty($this->message, PR_BODY, IID_IStream, 0, MAPI_CREATE | MAPI_MODIFY);
mapi_stream_setsize($stream, strlen($msgbody)); mapi_stream_setsize($stream, strlen($msgbody));
mapi_stream_write($stream, $msgbody); mapi_stream_write($stream, $msgbody);
mapi_stream_commit($stream); mapi_stream_commit($stream);
......
...@@ -313,7 +313,7 @@ ...@@ -313,7 +313,7 @@
// Set Body // Set Body
$body = $this->getBody(); $body = $this->getBody();
$stream = mapi_openpropertytostream($outgoing, PR_BODY, MAPI_CREATE | MAPI_MODIFY); $stream = mapi_openproperty($outgoing, PR_BODY, IID_IStream, 0, MAPI_MODIFY | MAPI_CREATE);
mapi_stream_setsize($stream, strlen($body)); mapi_stream_setsize($stream, strlen($body));
mapi_stream_write($stream, $body); mapi_stream_write($stream, $body);
mapi_stream_commit($stream); mapi_stream_commit($stream);
...@@ -487,7 +487,7 @@ ...@@ -487,7 +487,7 @@
$this->setRecipientsForResponse($outgoing, tdmtTaskUpd, true); $this->setRecipientsForResponse($outgoing, tdmtTaskUpd, true);
$body = $this->getBody(); $body = $this->getBody();
$stream = mapi_openpropertytostream($outgoing, PR_BODY, MAPI_CREATE | MAPI_MODIFY); $stream = mapi_openproperty($outgoing, PR_BODY, IID_IStream, 0, MAPI_CREATE | MAPI_MODIFY);
mapi_stream_setsize($stream, strlen($body)); mapi_stream_setsize($stream, strlen($body));
mapi_stream_write($stream, $body); mapi_stream_write($stream, $body);
mapi_stream_commit($stream); mapi_stream_commit($stream);
...@@ -633,7 +633,7 @@ ...@@ -633,7 +633,7 @@
// Set Body // Set Body
$body = $this->getBody(); $body = $this->getBody();
$stream = mapi_openpropertytostream($outgoing, PR_BODY, MAPI_CREATE | MAPI_MODIFY); $stream = mapi_openproperty($outgoing, PR_BODY, IID_IStream, 0, MAPI_CREATE | MAPI_MODIFY);
mapi_stream_setsize($stream, strlen($body)); mapi_stream_setsize($stream, strlen($body));
mapi_stream_write($stream, $body); mapi_stream_write($stream, $body);
mapi_stream_commit($stream); mapi_stream_commit($stream);
......
...@@ -733,7 +733,7 @@ class MAPIProvider { ...@@ -733,7 +733,7 @@ class MAPIProvider {
} }
// android devices require attachment size in order to display an attachment properly // android devices require attachment size in order to display an attachment properly
if (!isset($attachprops[PR_ATTACH_SIZE])) { if (!isset($attachprops[PR_ATTACH_SIZE])) {
$stream = mapi_openpropertytostream($mapiattach, PR_ATTACH_DATA_BIN); $stream = mapi_openproperty($mapiattach, PR_ATTACH_DATA_BIN, IID_IStream, 0, 0);
// It's not possible to open some (embedded only?) messages, so we need to open the attachment object itself to get the data // It's not possible to open some (embedded only?) messages, so we need to open the attachment object itself to get the data
if (mapi_last_hresult()) { if (mapi_last_hresult()) {
$embMessage = mapi_attach_openobj($mapiattach); $embMessage = mapi_attach_openobj($mapiattach);
......
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