Do not add inline attachment images again on draft

This commit is contained in:
Hadi Nategh 2015-06-11 17:43:17 +00:00
parent 96271f73f1
commit 5ba5b0fb45

View File

@ -1650,14 +1650,19 @@ class mail_compose
} }
$this->sessionData['body'] = mail_ui::resolve_inline_images($this->sessionData['body'], $_folder, $_uid, $_partID,'plain'); $this->sessionData['body'] = mail_ui::resolve_inline_images($this->sessionData['body'], $_folder, $_uid, $_partID,'plain');
} }
if(($attachments = $mail_bo->getMessageAttachments($_uid,$_partID))) { if(($attachments = $mail_bo->getMessageAttachments($_uid,$_partID))) {
foreach($attachments as $attachment) { foreach($attachments as $attachment) {
$this->addMessageAttachment($_uid, $attachment['partID'], $cid = $attachment['cid'];
$_folder, preg_match("/[cid:{$cid}]/", $bodyParts['0']['body'], $match);
$attachment['name'], if (!$match || !$attachment['cid'])
$attachment['mimeType'], {
$attachment['size']); $this->addMessageAttachment($_uid, $attachment['partID'],
$_folder,
$attachment['name'],
$attachment['mimeType'],
$attachment['size']);
}
} }
} }
$mail_bo->closeConnection(); $mail_bo->closeConnection();