Commit 0e33e24b authored by Sebastian Kummer's avatar Sebastian Kummer

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

Merge pull request #374 in ZP/z-push from bugfix/ZP-1052-attached-eml-message-does-not-have to develop

* commit '27067630':
  ZP-1052 Attached eml message does not have size.
  ZP-1052 Attached eml message does not have size.
parent 6109ac52
......@@ -748,6 +748,12 @@ class MAPIProvider {
// android devices require attachment size in order to display an attachment properly
if (!isset($attachprops[PR_ATTACH_SIZE])) {
$stream = mapi_openpropertytostream($mapiattach, PR_ATTACH_DATA_BIN);
// 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()) {
$embMessage = mapi_attach_openobj($mapiattach);
$addrbook = $this->getAddressbook();
$stream = mapi_inetmapi_imtoinet($this->session, $addrbook, $embMessage, array('use_tnef' => -1));
}
$stat = mapi_stream_stat($stream);
$attach->estimatedDataSize = $stat['cb'];
}
......
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