From 225ee8dbadcd0da610d8b7d68dada4c28848ecf0 Mon Sep 17 00:00:00 2001 From: "soeren.kaschubowski" Date: Thu, 29 Aug 2024 14:11:50 +0200 Subject: [PATCH 1/2] Allow viewing of attachments when shared by mail Signed-off-by: soeren.kaschubowski --- lib/Service/AttachmentService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Service/AttachmentService.php b/lib/Service/AttachmentService.php index 968bbf03e81..7964f453cfd 100644 --- a/lib/Service/AttachmentService.php +++ b/lib/Service/AttachmentService.php @@ -525,7 +525,7 @@ private function getTextFilePublic(?int $documentId, string $shareToken): File { // is the file shared with this token? try { $share = $this->shareManager->getShareByToken($shareToken); - if ($share->getShareType() === IShare::TYPE_LINK) { + if (in_array($share->getShareType(), [IShare::TYPE_LINK, IShare::TYPE_EMAIL])) { // shared file or folder? if ($share->getNodeType() === 'file') { $textFile = $share->getNode(); From 7146e707379d03b81c46bc761c81a2f4c3f7a77d Mon Sep 17 00:00:00 2001 From: "soeren.kaschubowski" Date: Thu, 29 Aug 2024 15:30:12 +0200 Subject: [PATCH 2/2] Spaces -> Tabs Signed-off-by: soeren.kaschubowski --- lib/Service/AttachmentService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Service/AttachmentService.php b/lib/Service/AttachmentService.php index 7964f453cfd..43cdc346d38 100644 --- a/lib/Service/AttachmentService.php +++ b/lib/Service/AttachmentService.php @@ -525,7 +525,7 @@ private function getTextFilePublic(?int $documentId, string $shareToken): File { // is the file shared with this token? try { $share = $this->shareManager->getShareByToken($shareToken); - if (in_array($share->getShareType(), [IShare::TYPE_LINK, IShare::TYPE_EMAIL])) { + if (in_array($share->getShareType(), [IShare::TYPE_LINK, IShare::TYPE_EMAIL])) { // shared file or folder? if ($share->getNodeType() === 'file') { $textFile = $share->getNode();