feat: Enhanced sender avatars with gravatar and favicons integration (#685)
* feat: Enhanced sender avatars with gravatar and favicons integration * chore: Remove unused known companies thumbnails * feat(thumbnail): add IThumbnailService and refactor usage - Introduced a new interface `IThumbnailService` for handling thumbnail-related functionalities. - Registered `IThumbnailService` with its implementation `ThumbnailService` in the service container. - Updated `NotificationBuilder` to use an instance of `IThumbnailService` instead of static methods. - Refactored `ThumbnailService` from a static class to a regular class with instance methods and variables. - Modified `ImagePreviewControl` to utilize the new `IThumbnailService` instance. - Completed integration of `IThumbnailService` in the application by registering it in `App.xaml.cs`. * style: Show favicons as squares - Changed `hintCrop` in `NotificationBuilder` to `None` for app logo display. - Added `FaviconSquircle`, `FaviconImage`, and `isFavicon` to `ImagePreviewControl` for favicon handling. - Updated `UpdateInformation` method to manage favicon visibility. - Introduced `GetBitmapImageAsync` for converting Base64 to Bitmap images. - Enhanced XAML to include `FaviconSquircle` for improved UI appearance. * refactor thumbnail service * Removed old code and added clear method * added prefetch function * Change key from host to email * Remove redundant code * Test event * Fixed an issue with the thumbnail updated event. * Fix cutted favicons * exclude some domain from favicons * add yandex.ru * fix buttons in settings * remove prefetch method * Added thumbnails propagation to mailRenderingPage * Revert MailItemViewModel to object * Remove redundant code * spaces * await load parameter added * fix spaces * fix case sensativity for mail list thumbnails * change duckdns to google * Some cleanup. --------- Co-authored-by: Aleh Khantsevich <aleh.khantsevich@gmail.com> Co-authored-by: Burak Kaan Köse <bkaankose@outlook.com>
This commit is contained in:
committed by
GitHub
parent
a8cb332232
commit
256fd1cce2
14
Wino.Core.Domain/Entities/Shared/Thumbnail.cs
Normal file
14
Wino.Core.Domain/Entities/Shared/Thumbnail.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using SQLite;
|
||||
|
||||
namespace Wino.Core.Domain.Entities.Shared;
|
||||
|
||||
public class Thumbnail
|
||||
{
|
||||
[PrimaryKey]
|
||||
public string Domain { get; set; }
|
||||
|
||||
public string Gravatar { get; set; }
|
||||
public string Favicon { get; set; }
|
||||
public DateTime LastUpdated { get; set; }
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Models.Calendar;
|
||||
using Wino.Core.Domain.Models.Reader;
|
||||
|
||||
namespace Wino.Core.Domain.Interfaces;
|
||||
|
||||
public interface IPreferencesService
|
||||
public interface IPreferencesService: INotifyPropertyChanged
|
||||
{
|
||||
/// <summary>
|
||||
/// When any of the preferences are changed.
|
||||
@@ -193,6 +194,16 @@ public interface IPreferencesService
|
||||
/// </summary>
|
||||
bool IsShowActionLabelsEnabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Setting: Enable/disable Gravatar for sender avatars.
|
||||
/// </summary>
|
||||
bool IsGravatarEnabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Setting: Enable/disable Favicon for sender avatars.
|
||||
/// </summary>
|
||||
bool IsFaviconEnabled { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Calendar
|
||||
|
||||
20
Wino.Core.Domain/Interfaces/IThumbnailService.cs
Normal file
20
Wino.Core.Domain/Interfaces/IThumbnailService.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Wino.Core.Domain.Interfaces;
|
||||
|
||||
public interface IThumbnailService
|
||||
{
|
||||
/// <summary>
|
||||
/// Clears the thumbnail cache.
|
||||
/// </summary>
|
||||
Task ClearCache();
|
||||
|
||||
/// <summary>
|
||||
/// Gets thumbnail
|
||||
/// </summary>
|
||||
/// <param name="email">Address for thumbnail</param>
|
||||
/// <param name="awaitLoad">Force to wait for thumbnail loading.
|
||||
/// Should be used in non-UI threads or where delay is acceptable
|
||||
/// </param>
|
||||
ValueTask<string> GetThumbnailAsync(string email, bool awaitLoad = false);
|
||||
}
|
||||
@@ -623,6 +623,11 @@
|
||||
"SettingsShowPreviewText_Title": "Show Preview Text",
|
||||
"SettingsShowSenderPictures_Description": "Hide/show the thumbnail sender pictures.",
|
||||
"SettingsShowSenderPictures_Title": "Show Sender Avatars",
|
||||
"SettingsEnableGravatarAvatars_Title": "Gravatar",
|
||||
"SettingsEnableGravatarAvatars_Description": "Use gravatar (if available) as sender picture",
|
||||
"SettingsEnableFavicons_Title": "Domain icons (Favicons)",
|
||||
"SettingsEnableFavicons_Description": "Use domain favicons (if available) as sender picture",
|
||||
"SettingsMailList_ClearAvatarsCache_Button": "Clear cached avatars",
|
||||
"SettingsSignature_AddCustomSignature_Button": "Add signature",
|
||||
"SettingsSignature_AddCustomSignature_Title": "Add custom signature",
|
||||
"SettingsSignature_DeleteSignature_Title": "Delete signature",
|
||||
|
||||
Reference in New Issue
Block a user