TF-3685 Fix From field is displayed incorrectly in Drafts on mobile
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
import 'package:tmail_ui_user/features/base/upgradeable/upgrade_database_steps.dart';
|
||||||
|
import 'package:tmail_ui_user/features/caching/caching_manager.dart';
|
||||||
|
|
||||||
|
class UpgradeHiveDatabaseStepsV15 extends UpgradeDatabaseSteps {
|
||||||
|
|
||||||
|
final CachingManager _cachingManager;
|
||||||
|
|
||||||
|
UpgradeHiveDatabaseStepsV15(this._cachingManager);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> onUpgrade(int oldVersion, int newVersion) async {
|
||||||
|
if (oldVersion > 0 && oldVersion < newVersion && newVersion == 15) {
|
||||||
|
await _cachingManager.clearDetailedEmailCache();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
|
|
||||||
class CacheVersion {
|
class CacheVersion {
|
||||||
static const int hiveDBVersion = 14;
|
static const int hiveDBVersion = 15;
|
||||||
}
|
}
|
||||||
@@ -86,6 +86,9 @@ extension SetupEmailContentExtension on ComposerController {
|
|||||||
setupEmailRequestReadReceiptFlagForEditDraft(
|
setupEmailRequestReadReceiptFlagForEditDraft(
|
||||||
uiState.emailCurrent.hasRequestReadReceipt,
|
uiState.emailCurrent.hasRequestReadReceipt,
|
||||||
);
|
);
|
||||||
|
setupSelectedIdentityForEditDraft(
|
||||||
|
uiState.emailCurrent.identityIdFromHeader,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
emailContentsViewState.value = Right(uiState);
|
emailContentsViewState.value = Right(uiState);
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ extension DetailedEmailExtension on DetailedEmail {
|
|||||||
references: references?.ids.toList(),
|
references: references?.ids.toList(),
|
||||||
inlineImages: inlineImages?.toHiveCache(),
|
inlineImages: inlineImages?.toHiveCache(),
|
||||||
sMimeStatusHeader: sMimeStatusHeader?.toMapString(),
|
sMimeStatusHeader: sMimeStatusHeader?.toMapString(),
|
||||||
|
identityHeader: identityHeader?.toMapString(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,7 +41,8 @@ extension DetailedEmailExtension on DetailedEmail {
|
|||||||
messageId: messageId,
|
messageId: messageId,
|
||||||
references: references,
|
references: references,
|
||||||
inlineImages: inlineImages,
|
inlineImages: inlineImages,
|
||||||
sMimeStatusHeader: sMimeStatusHeader
|
sMimeStatusHeader: sMimeStatusHeader,
|
||||||
|
identityHeader: identityHeader,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,6 +29,12 @@ extension DetailedEmailHiveCacheExtension on DetailedEmailHiveCache {
|
|||||||
sMimeStatusHeader: sMimeStatusHeader != null
|
sMimeStatusHeader: sMimeStatusHeader != null
|
||||||
? Map.fromIterables(sMimeStatusHeader!.keys.map((value) => IndividualHeaderIdentifier(value)), sMimeStatusHeader!.values)
|
? Map.fromIterables(sMimeStatusHeader!.keys.map((value) => IndividualHeaderIdentifier(value)), sMimeStatusHeader!.values)
|
||||||
: null,
|
: null,
|
||||||
|
identityHeader: identityHeader != null
|
||||||
|
? Map.fromIterables(
|
||||||
|
identityHeader!.keys.map((value) => IndividualHeaderIdentifier(value)),
|
||||||
|
identityHeader!.values,
|
||||||
|
)
|
||||||
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,6 +17,7 @@ extension EmailExtension on Email {
|
|||||||
references: references,
|
references: references,
|
||||||
inlineImages: allAttachments.listAttachmentsDisplayedInContent,
|
inlineImages: allAttachments.listAttachmentsDisplayedInContent,
|
||||||
sMimeStatusHeader: sMimeStatusHeader,
|
sMimeStatusHeader: sMimeStatusHeader,
|
||||||
|
identityHeader: identityHeader,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -17,6 +17,7 @@ class DetailedEmail with EquatableMixin {
|
|||||||
final MessageIdsHeaderValue? references;
|
final MessageIdsHeaderValue? references;
|
||||||
final List<Attachment>? inlineImages;
|
final List<Attachment>? inlineImages;
|
||||||
final Map<IndividualHeaderIdentifier, String?>? sMimeStatusHeader;
|
final Map<IndividualHeaderIdentifier, String?>? sMimeStatusHeader;
|
||||||
|
final Map<IndividualHeaderIdentifier, String?>? identityHeader;
|
||||||
|
|
||||||
DetailedEmail({
|
DetailedEmail({
|
||||||
required this.emailId,
|
required this.emailId,
|
||||||
@@ -30,6 +31,7 @@ class DetailedEmail with EquatableMixin {
|
|||||||
this.references,
|
this.references,
|
||||||
this.inlineImages,
|
this.inlineImages,
|
||||||
this.sMimeStatusHeader,
|
this.sMimeStatusHeader,
|
||||||
|
this.identityHeader,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -45,5 +47,6 @@ class DetailedEmail with EquatableMixin {
|
|||||||
references,
|
references,
|
||||||
inlineImages,
|
inlineImages,
|
||||||
sMimeStatusHeader,
|
sMimeStatusHeader,
|
||||||
|
identityHeader,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -182,6 +182,7 @@ class GetEmailContentInteractor {
|
|||||||
emailCurrent: emailCache.copyWith(
|
emailCurrent: emailCache.copyWith(
|
||||||
headers: detailedEmail.headers,
|
headers: detailedEmail.headers,
|
||||||
sMimeStatusHeader: detailedEmail.sMimeStatusHeader,
|
sMimeStatusHeader: detailedEmail.sMimeStatusHeader,
|
||||||
|
identityHeader: detailedEmail.identityHeader,
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ class DetailedEmailHiveCache extends HiveObject with EquatableMixin {
|
|||||||
@HiveField(9)
|
@HiveField(9)
|
||||||
Map<String, String?>? sMimeStatusHeader;
|
Map<String, String?>? sMimeStatusHeader;
|
||||||
|
|
||||||
|
@HiveField(10)
|
||||||
|
Map<String, String?>? identityHeader;
|
||||||
|
|
||||||
DetailedEmailHiveCache({
|
DetailedEmailHiveCache({
|
||||||
required this.emailId,
|
required this.emailId,
|
||||||
required this.timeSaved,
|
required this.timeSaved,
|
||||||
@@ -52,6 +55,7 @@ class DetailedEmailHiveCache extends HiveObject with EquatableMixin {
|
|||||||
this.references,
|
this.references,
|
||||||
this.inlineImages,
|
this.inlineImages,
|
||||||
this.sMimeStatusHeader,
|
this.sMimeStatusHeader,
|
||||||
|
this.identityHeader,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -66,5 +70,6 @@ class DetailedEmailHiveCache extends HiveObject with EquatableMixin {
|
|||||||
references,
|
references,
|
||||||
inlineImages,
|
inlineImages,
|
||||||
sMimeStatusHeader,
|
sMimeStatusHeader,
|
||||||
|
identityHeader,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -64,6 +64,7 @@ class ThreadConstants {
|
|||||||
EmailProperty.attachments,
|
EmailProperty.attachments,
|
||||||
EmailProperty.headers,
|
EmailProperty.headers,
|
||||||
IndividualHeaderIdentifier.sMimeStatusHeader.value,
|
IndividualHeaderIdentifier.sMimeStatusHeader.value,
|
||||||
|
IndividualHeaderIdentifier.identityHeader.value,
|
||||||
});
|
});
|
||||||
|
|
||||||
static final propertiesCalendarEvent = Properties({
|
static final propertiesCalendarEvent = Properties({
|
||||||
|
|||||||
Reference in New Issue
Block a user