TF-106 Fix display inlined image CIDs of emails

This commit is contained in:
dab246
2021-10-18 14:46:11 +07:00
committed by Dat H. Pham
parent 1432cb0209
commit 60ffa5ace0
25 changed files with 202 additions and 81 deletions
@@ -0,0 +1,23 @@
import 'package:model/model.dart';
extension ListAttachmentExtension on List<Attachment> {
num totalSize() {
num totalSize = 0;
forEach((attachment) {
if (attachment.size != null) {
totalSize += attachment.size!.value;
}
});
return totalSize;
}
List<Attachment> get attachmentsWithDispositionAttachment {
return where((attachment) => attachment.disposition == ContentDisposition.attachment).toList();
}
List<Attachment> get attachmentWithDispositionInlines {
return where((attachment) => attachment.disposition == ContentDisposition.inline && attachment.cidNotEmpty())
.toList();
}
}