pass folder info explizitly on even more bo calls to cancel out problems there

This commit is contained in:
Klaus Leithoff 2014-01-20 16:03:32 +00:00
parent 658b773dc1
commit d0e562ebef
2 changed files with 13 additions and 7 deletions

View File

@ -743,8 +743,8 @@ class mail_activesync implements activesync_plugin_write, activesync_plugin_send
if ($preferencesArray['message_forwarding'] == 'asmail')
{
$rawHeader='';
$rawHeader = $this->mail->getMessageRawHeader($smartdata['itemid'], $_partID);
$rawBody = $this->mail->getMessageRawBody($smartdata['itemid'], $_partID);
$rawHeader = $this->mail->getMessageRawHeader($smartdata['itemid'], $_partID,$folder);
$rawBody = $this->mail->getMessageRawBody($smartdata['itemid'], $_partID,$folder);
$mailObject->AddStringAttachment($rawHeader.$rawBody, $mailObject->EncodeHeader($headers['SUBJECT']), '7bit', 'message/rfc822');
}
else
@ -780,6 +780,9 @@ class mail_activesync implements activesync_plugin_write, activesync_plugin_send
$body .= $bodyBUFF;
// get all the attachments and add them too.
// start handle Attachments
// $_uid, $_partID=null, Horde_Mime_Part $_structure=null, $fetchEmbeddedImages=true, $fetchTextCalendar=false, $resolveTNEF=true, $_folderName=''
$attachments = $this->mail->getMessageAttachments($uid, null, null, true, false, true , $folder);
$attachments = $this->mail->getMessageAttachments($uid);
$attachmentNames = false;
if (is_array($attachments) && count($attachments)>0)
@ -793,8 +796,8 @@ class mail_activesync implements activesync_plugin_write, activesync_plugin_send
{
case 'MESSAGE/RFC822':
$rawHeader = $rawBody = '';
$rawHeader = $this->mail->getMessageRawHeader($uid, $attachment['partID']);
$rawBody = $this->mail->getMessageRawBody($uid, $attachment['partID']);
$rawHeader = $this->mail->getMessageRawHeader($uid, $attachment['partID'],$folder);
$rawBody = $this->mail->getMessageRawBody($uid, $attachment['partID'],$folder);
$mailObject->AddStringAttachment($rawHeader.$rawBody, $mailObject->EncodeHeader($attachment['name']), '7bit', 'message/rfc822');
break;
default:
@ -1204,7 +1207,8 @@ class mail_activesync implements activesync_plugin_write, activesync_plugin_send
}
// we still need the attachments to be added ( if there are any )
// start handle Attachments
$attachments = $this->mail->getMessageAttachments($id);
// $_uid, $_partID=null, Horde_Mime_Part $_structure=null, $fetchEmbeddedImages=true, $fetchTextCalendar=false, $resolveTNEF=true, $_folderName=''
$attachments = $this->mail->getMessageAttachments($id, null, null, true, false, true , $_folderName);
if (is_array($attachments) && count($attachments)>0)
{
debugLog(__METHOD__.__LINE__.' gather Attachments for BodyCreation of/for MessageID:'.$id.' found:'.count($attachments));

View File

@ -4384,15 +4384,17 @@ class mail_bo
* @param boolean $fetchEmbeddedImages=true,
* @param boolean $fetchTextCalendar=false,
* @param boolean $resolveTNEF=true
* @param string $_folder folder to work on
* @return array an array of information about the attachment: array of array(name, size, mimeType, partID, encoding)
*/
function getMessageAttachments($_uid, $_partID=null, Horde_Mime_Part $_structure=null, $fetchEmbeddedImages=true, $fetchTextCalendar=false, $resolveTNEF=true)
function getMessageAttachments($_uid, $_partID=null, Horde_Mime_Part $_structure=null, $fetchEmbeddedImages=true, $fetchTextCalendar=false, $resolveTNEF=true, $_folder='')
{
if (self::$debug) error_log( __METHOD__.":$_uid, $_partID");
if (empty($_folder)) $_folder = ($this->sessionData['mailbox']? $this->sessionData['mailbox'] : $this->icServer->getCurrentMailbox());
if (!isset($_structure))
{
$_structure = $this->getStructure($_uid, $_partID,null,true);
$_structure = $this->getStructure($_uid, $_partID,$_folder,true);
}
if (!$_structure || !$_structure->contentTypeMap()) return array();
foreach($_structure->contentTypeMap() as $mime_id => $mime_type)