Embedded images replaced with cid linked resources. (#313)
* Added logic to replace embedded images with linked resources * Added alt text for images and replaced NewtonSoft with Text.Json * Fix draft mime preparation * Fix crashes for signatures without images. --------- Co-authored-by: Burak Kaan Köse <bkaankose@outlook.com>
This commit is contained in:
@@ -8,6 +8,7 @@ using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using MimeKit;
|
||||
using MimeKit.Utils;
|
||||
using Wino.Core.Domain;
|
||||
using Wino.Core.Domain.Entities;
|
||||
using Wino.Core.Domain.Enums;
|
||||
@@ -237,12 +238,9 @@ namespace Wino.Mail.ViewModels
|
||||
{
|
||||
if (GetHTMLBodyFunction != null)
|
||||
{
|
||||
bodyBuilder.HtmlBody = await GetHTMLBodyFunction();
|
||||
bodyBuilder.SetHtmlBody(await GetHTMLBodyFunction());
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(bodyBuilder.HtmlBody))
|
||||
bodyBuilder.TextBody = HtmlAgilityPackExtensions.GetPreviewText(bodyBuilder.HtmlBody);
|
||||
|
||||
if (bodyBuilder.HtmlBody != null && bodyBuilder.TextBody != null)
|
||||
CurrentMimeMessage.Body = bodyBuilder.ToMessageBody();
|
||||
}
|
||||
@@ -401,7 +399,6 @@ namespace Wino.Mail.ViewModels
|
||||
{
|
||||
DialogService.InfoBarMessage("Busy", "Mail is being processed. Please wait a moment and try again.", InfoBarMessageType.Warning);
|
||||
}
|
||||
|
||||
catch (ComposerMimeNotFoundException)
|
||||
{
|
||||
DialogService.InfoBarMessage(Translator.Info_ComposerMissingMIMETitle, Translator.Info_ComposerMissingMIMEMessage, InfoBarMessageType.Error);
|
||||
|
||||
Reference in New Issue
Block a user