diff --git a/lib/features/email/data/network/email_api.dart b/lib/features/email/data/network/email_api.dart index 23b92d26c..c4e20c8e0 100644 --- a/lib/features/email/data/network/email_api.dart +++ b/lib/features/email/data/network/email_api.dart @@ -93,13 +93,15 @@ class EmailAPI with HandleSetErrorMixin { .execute(); final resultList = result.parse( - getEmailInvocation.methodCallId, GetEmailResponse.deserialize); + getEmailInvocation.methodCallId, + GetEmailResponse.deserialize + ); - return Future.sync(() async { + if (resultList?.list.isNotEmpty == true) { return resultList!.list.first; - }).catchError((error) { - throw error; - }); + } else { + throw NotFoundEmailException(); + } } Future sendEmail( diff --git a/lib/features/thread/domain/constants/thread_constants.dart b/lib/features/thread/domain/constants/thread_constants.dart index a60335f33..0ba8e2a41 100644 --- a/lib/features/thread/domain/constants/thread_constants.dart +++ b/lib/features/thread/domain/constants/thread_constants.dart @@ -45,7 +45,10 @@ class ThreadConstants { EmailProperty.attachments, EmailProperty.headers, EmailProperty.keywords, - EmailProperty.mailboxIds + EmailProperty.mailboxIds, + EmailProperty.messageId, + EmailProperty.inReplyTo, + EmailProperty.references, }); static final propertiesGetDetailedEmail = Properties({ diff --git a/model/lib/email/email_property.dart b/model/lib/email/email_property.dart index 867d7a6e9..ecada6f55 100644 --- a/model/lib/email/email_property.dart +++ b/model/lib/email/email_property.dart @@ -19,4 +19,7 @@ class EmailProperty { static const String attachments = 'attachments'; static const String headers = 'headers'; static const String headerMdnKey = 'Disposition-Notification-To'; + static const String messageId = 'messageId'; + static const String inReplyTo = 'inReplyTo'; + static const String references = 'references'; } \ No newline at end of file