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:
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using Serilog;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Domain.Models.AutoDiscovery;
|
||||
@@ -43,7 +43,7 @@ namespace Wino.Core.Services
|
||||
{
|
||||
var content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
return JsonConvert.DeserializeObject<AutoDiscoverySettings>(content);
|
||||
return JsonSerializer.Deserialize<AutoDiscoverySettings>(content);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -636,10 +636,7 @@ namespace Wino.Core.Services
|
||||
_ => CreateReferencedDraft(builder, message, draftCreationOptions, account, signature),
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(builder.HtmlBody))
|
||||
{
|
||||
builder.TextBody = HtmlAgilityPackExtensions.GetPreviewText(builder.HtmlBody);
|
||||
}
|
||||
builder.SetHtmlBody(builder.HtmlBody);
|
||||
|
||||
message.Body = builder.ToMessageBody();
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Newtonsoft.Json;
|
||||
using Serilog;
|
||||
using Wino.Core.Domain;
|
||||
using Wino.Core.Domain.Enums;
|
||||
@@ -44,7 +44,7 @@ namespace Wino.Core.Services
|
||||
|
||||
var stremValue = await new StreamReader(resourceStream).ReadToEndAsync().ConfigureAwait(false);
|
||||
|
||||
var translationLookups = JsonConvert.DeserializeObject<Dictionary<string, string>>(stremValue);
|
||||
var translationLookups = JsonSerializer.Deserialize<Dictionary<string, string>>(stremValue);
|
||||
|
||||
// Insert new translation key-value pairs.
|
||||
// Overwrite existing values for the same keys.
|
||||
|
||||
Reference in New Issue
Block a user