TF-825 Download email as EML file (#2854)

This commit is contained in:
Dat Vu
2024-05-16 15:50:01 +07:00
committed by GitHub
parent 175f285e51
commit ca4cf68f87
29 changed files with 153 additions and 26 deletions
+2 -2
View File
@@ -44,8 +44,8 @@ class Attachment with EquatableMixin {
final downloadUri = downloadUriTemplate.expand({
'accountId' : accountId.id.value,
'blobId' : '${blobId?.value}',
'name' : '$name',
'type' : '${type?.mimeType}',
'name' : name ?? '',
'type' : type?.mimeType ?? '',
});
return Uri.decodeFull(downloadUri);
}
+2 -1
View File
@@ -27,5 +27,6 @@ enum EmailActionType {
unsubscribe,
composeFromUnsubscribeMailtoLink,
archiveMessage,
printAll
printAll,
downloadMessageAsEML
}
+1
View File
@@ -1,6 +1,7 @@
class EmailProperty {
static const String id = 'id';
static const String blobId = 'blobId';
static const String keywords = 'keywords';
static const String size = 'size';
static const String receivedAt = 'receivedAt';
+15
View File
@@ -0,0 +1,15 @@
import 'package:model/email/attachment.dart';
class EMLAttachment extends Attachment {
EMLAttachment({
super.partId,
super.blobId,
super.size,
super.name,
super.type,
super.cid,
super.disposition,
});
}
+4
View File
@@ -1,6 +1,7 @@
import 'package:core/presentation/extensions/string_extension.dart';
import 'package:equatable/equatable.dart';
import 'package:jmap_dart_client/jmap/core/id.dart';
import 'package:jmap_dart_client/jmap/core/unsigned_int.dart';
import 'package:jmap_dart_client/jmap/core/utc_date.dart';
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
@@ -21,6 +22,7 @@ import 'package:model/mailbox/select_mode.dart';
class PresentationEmail with EquatableMixin {
final EmailId? id;
final Id? blobId;
final Map<KeyWordIdentifier, bool>? keywords;
final UnsignedInt? size;
final UTCDate? receivedAt;
@@ -44,6 +46,7 @@ class PresentationEmail with EquatableMixin {
PresentationEmail({
this.id,
this.blobId,
this.keywords,
this.size,
this.receivedAt,
@@ -142,6 +145,7 @@ class PresentationEmail with EquatableMixin {
@override
List<Object?> get props => [
id,
blobId,
keywords,
size,
receivedAt,