TF-1865: Modify sending email in composer when tap item and Long press item
(cherry picked from commit 5cfda1d92f38da9e5e4fab1413e6e52229a51639)
This commit is contained in:
@@ -17,5 +17,6 @@ enum EmailActionType {
|
||||
selection,
|
||||
moveToSpam,
|
||||
unSpam,
|
||||
openInNewTab
|
||||
openInNewTab,
|
||||
resend
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
import 'package:core/domain/extensions/datetime_extension.dart';
|
||||
import 'package:core/presentation/extensions/string_extension.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:intl/intl.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';
|
||||
@@ -101,6 +103,10 @@ class PresentationEmail with EquatableMixin {
|
||||
|
||||
bool get pushNotificationActivated => !isDraft && !hasRead;
|
||||
|
||||
String getCreateTimeAt(String newLocale) {
|
||||
return DateFormat(sentAt?.value.toPattern(), newLocale).format(sentAt?.value ?? DateTime.now());
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [
|
||||
id,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:jmap_dart_client/jmap/core/properties/properties.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/utc_date.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/email_body_part.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/email/keyword_identifier.dart';
|
||||
@@ -135,4 +136,31 @@ extension EmailExtension on Email {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
PresentationEmail sendingEmailToPresentationEmail(
|
||||
{
|
||||
SelectMode selectMode = SelectMode.INACTIVE,
|
||||
EmailId? emailId,
|
||||
UTCDate? createAt,
|
||||
}
|
||||
) {
|
||||
return PresentationEmail(
|
||||
id: emailId ?? id,
|
||||
keywords: keywords,
|
||||
size: size,
|
||||
receivedAt: receivedAt,
|
||||
hasAttachment: hasAttachment,
|
||||
preview: preview,
|
||||
subject: subject,
|
||||
sentAt: createAt ?? sentAt,
|
||||
from: from,
|
||||
to: to,
|
||||
cc: cc,
|
||||
bcc: bcc,
|
||||
replyTo: replyTo,
|
||||
mailboxIds: mailboxIds,
|
||||
selectMode: selectMode,
|
||||
emailHeader: headers?.toList()
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user