TF-2345 Fixe attachments are not displayed when cid is present

Signed-off-by: dab246 <tdvu@linagora.com>
(cherry picked from commit d4a95bfa305b198f5d3c369e3f49decb495b6fba)
This commit is contained in:
dab246
2023-11-22 08:55:34 +07:00
committed by Dat H. Pham
parent cd00cea7d9
commit d14ff9d73c
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -34,6 +34,8 @@ class Attachment with EquatableMixin {
bool hasCid() => cid != null && cid?.isNotEmpty == true;
bool isInlined() => disposition == ContentDisposition.inline;
String getDownloadUrl(String baseDownloadUrl, AccountId accountId) {
final downloadUriTemplate = UriTemplate(baseDownloadUrl);
final downloadUri = downloadUriTemplate.expand({
@@ -13,7 +13,7 @@ extension ListAttachmentExtension on List<Attachment> {
return 0;
}
List<Attachment> get listAttachmentsDisplayedOutSide => where((attachment) => attachment.noCid()).toList();
List<Attachment> get listAttachmentsDisplayedOutSide => where((attachment) => attachment.noCid() || !attachment.isInlined()).toList();
List<Attachment> get listAttachmentsDisplayedInContent => where((attachment) => attachment.hasCid()).toList();