diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-01-24 16:36:29 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-01-24 16:52:07 +0300 |
commit | 7942f00f94e236e9bbcf4ce01fa19e46c6de1d80 (patch) | |
tree | e4f53ca6c90a4db3c2df75ddf4fbd9a7c862c36e /lib/Model | |
parent | 9f254d8a7fd5f64b1ca1169915ba7c5212dafd79 (diff) |
Show embedded messages as attachments
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/Model')
-rw-r--r-- | lib/Model/IMAPMessage.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Model/IMAPMessage.php b/lib/Model/IMAPMessage.php index 30301ebee..714342d6a 100644 --- a/lib/Model/IMAPMessage.php +++ b/lib/Model/IMAPMessage.php @@ -263,21 +263,20 @@ class IMAPMessage implements IMessage, JsonSerializable { */ private function hasAttachments($part) { foreach ($part->getParts() as $p) { - /** - * @var Horde_Mime_Part $p - */ + /** @var Horde_Mime_Part $p */ $filename = $p->getName(); - if (!is_null($p->getContentId())) { + if ($p->getContentId() !== null) { continue; } - if (isset($filename)) { + // TODO: show embedded messages and don't treat them as attachments + if ($p->getType() === 'message/rfc822' || isset($filename)) { // do not show technical attachments if (in_array($filename, $this->attachmentsToIgnore)) { continue; - } else { - return true; } + + return true; } if ($this->hasAttachments($p)) { return true; @@ -336,7 +335,8 @@ class IMAPMessage implements IMessage, JsonSerializable { // Any part with a filename is an attachment, // so an attached text file (type 0) is not mistaken as the message. $filename = $p->getName(); - if (isset($filename)) { + // TODO: show embedded messages and don't treat them as attachments + if ($p->getType() === 'message/rfc822' || isset($filename)) { if (in_array($filename, $this->attachmentsToIgnore)) { return; } |