Fix soem dispaly date issues.

This commit is contained in:
Burak Kaan Köse
2025-11-14 12:56:37 +01:00
parent 540a4e5117
commit 249a950dc1
2 changed files with 8 additions and 2 deletions
@@ -452,7 +452,10 @@ public partial class MailRenderingPageViewModel : MailBaseViewModel,
// TODO: FromName and FromAddress is probably not correct here for mail lists.
FromAddress = message.From.Mailboxes.FirstOrDefault()?.Address ?? Translator.UnknownAddress;
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;
// 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 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()
{
Id = messageUid,
CreationDate = mime.Date.UtcDateTime,
CreationDate = creationDate,
ThreadId = messageSummary.GetThreadId(),
MessageId = mime.GetMessageId(),
Subject = mime.Subject,