From 7c1d85f377c8ca669440e6754707515259a6e1a5 Mon Sep 17 00:00:00 2001 From: Cyrille Bollu Date: Sun, 1 Nov 2020 18:23:06 +0100 Subject: Fixes "Save all to Files" function Signed-off-by: Cyrille Bollu Signed-off-by: Christoph Wurst --- lib/Controller/MessagesController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Controller/MessagesController.php') diff --git a/lib/Controller/MessagesController.php b/lib/Controller/MessagesController.php index b0188a5a5..b9882970b 100755 --- a/lib/Controller/MessagesController.php +++ b/lib/Controller/MessagesController.php @@ -462,7 +462,7 @@ class MessagesController extends Controller { if ($attachmentId === '0') { // Save all attachments /* @var $m IMAPMessage */ - $m = $folder->getMessage($id); + $m = $folder->getMessage($message->getUid()); $attachmentIds = array_map(function ($a) { return $a['id']; }, $m->attachments); @@ -471,7 +471,7 @@ class MessagesController extends Controller { } foreach ($attachmentIds as $aid) { - $attachment = $folder->getAttachment($message->getUid(), $attachmentId); + $attachment = $folder->getAttachment($message->getUid(), $aid); $fileName = $attachment->getName() ?? $this->l10n->t('Embedded message %s', [ $aid, -- cgit v1.2.3