Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/Model
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-01-24 16:36:29 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-01-24 16:52:07 +0300
commit7942f00f94e236e9bbcf4ce01fa19e46c6de1d80 (patch)
treee4f53ca6c90a4db3c2df75ddf4fbd9a7c862c36e /lib/Model
parent9f254d8a7fd5f64b1ca1169915ba7c5212dafd79 (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.php16
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;
}