Fix soem dispaly date issues.
This commit is contained in:
@@ -452,7 +452,10 @@ public partial class MailRenderingPageViewModel : MailBaseViewModel,
|
|||||||
// TODO: FromName and FromAddress is probably not correct here for mail lists.
|
// TODO: FromName and FromAddress is probably not correct here for mail lists.
|
||||||
FromAddress = message.From.Mailboxes.FirstOrDefault()?.Address ?? Translator.UnknownAddress;
|
FromAddress = message.From.Mailboxes.FirstOrDefault()?.Address ?? Translator.UnknownAddress;
|
||||||
FromName = message.From.Mailboxes.FirstOrDefault()?.Name ?? Translator.UnknownSender;
|
FromName = message.From.Mailboxes.FirstOrDefault()?.Name ?? Translator.UnknownSender;
|
||||||
CreationDate = message.Date.DateTime;
|
|
||||||
|
// Use the received date from MailCopy if available, otherwise fall back to the sent date from MIME message
|
||||||
|
CreationDate = initializedMailItemViewModel?.MailCopy.CreationDate ?? message.Date.DateTime;
|
||||||
|
|
||||||
ContactPicture = initializedMailItemViewModel?.MailCopy.SenderContact?.Base64ContactPicture;
|
ContactPicture = initializedMailItemViewModel?.MailCopy.SenderContact?.Base64ContactPicture;
|
||||||
|
|
||||||
// Automatically disable images for Junk folder to prevent pixel tracking.
|
// Automatically disable images for Junk folder to prevent pixel tracking.
|
||||||
|
|||||||
@@ -108,10 +108,13 @@ public static class MailkitClientExtensions
|
|||||||
var messageUid = CreateUid(folder.Id, messageSummary.UniqueId.Id);
|
var messageUid = CreateUid(folder.Id, messageSummary.UniqueId.Id);
|
||||||
var previewText = mime.GetPreviewText();
|
var previewText = mime.GetPreviewText();
|
||||||
|
|
||||||
|
// Use InternalDate (server received date) if available, otherwise fall back to Date header (sent date)
|
||||||
|
var creationDate = messageSummary.InternalDate?.UtcDateTime ?? mime.Date.UtcDateTime;
|
||||||
|
|
||||||
var copy = new MailCopy()
|
var copy = new MailCopy()
|
||||||
{
|
{
|
||||||
Id = messageUid,
|
Id = messageUid,
|
||||||
CreationDate = mime.Date.UtcDateTime,
|
CreationDate = creationDate,
|
||||||
ThreadId = messageSummary.GetThreadId(),
|
ThreadId = messageSummary.GetThreadId(),
|
||||||
MessageId = mime.GetMessageId(),
|
MessageId = mime.GetMessageId(),
|
||||||
Subject = mime.Subject,
|
Subject = mime.Subject,
|
||||||
|
|||||||
Reference in New Issue
Block a user