Files
Wino-Mail/Wino.Core.Domain/Interfaces/INotificationBuilder.cs

31 lines
894 B
C#
Raw Normal View History

2024-04-18 01:44:37 +02:00
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Wino.Core.Domain.Models.MailItem;
2025-02-16 11:54:23 +01:00
namespace Wino.Core.Domain.Interfaces;
public interface INotificationBuilder
2024-04-18 01:44:37 +02:00
{
2025-02-16 11:54:23 +01:00
/// <summary>
/// Creates toast notifications for new mails.
/// </summary>
Task CreateNotificationsAsync(Guid inboxFolderId, IEnumerable<IMailItem> newMailItems);
2024-04-18 01:44:37 +02:00
2025-02-16 11:54:23 +01:00
/// <summary>
/// Gets the unread Inbox messages for each account and updates the taskbar icon.
/// </summary>
/// <returns></returns>
Task UpdateTaskbarIconBadgeAsync();
2024-04-18 01:44:37 +02:00
2025-02-16 11:54:23 +01:00
/// <summary>
/// Creates test notification for test purposes.
/// </summary>
Task CreateTestNotificationAsync(string title, string message);
feat(notification): ✨ Remove notification when read externally (#707) * feat(notification): ✨ Add notification removal feature Implemented a new method `RemoveNotificationAsync` in the `INotificationBuilder` interface to allow the removal of toast notifications for specific emails identified by a unique ID. This change enhances the notification management by ensuring that notifications can be cleared when emails are marked as read. The `NotificationBuilder` class has been updated to include logic for removing existing notifications and to use the unique ID as a tag for the toast notifications, facilitating their removal. Additionally, the `AppShellViewModel` has been modified to call this new method when an email is updated and marked as read. This improvement aims to provide a better user experience by keeping the notification area relevant and up-to-date. * feat(notification): ✨ Add MailReadStatusChanged event handling Introduced a new event system for handling email read status changes. This includes the addition of a listener in `NotificationBuilder` that removes notifications when an email is marked as read. • Added `MailReadStatusChanged` record to represent the event. • Registered a listener in `NotificationBuilder` to handle notification removal. • Removed the `OnMailUpdated` method from `AppShellViewModel`, delegating notification management to the new event system. • Updated `MailService` to send `MailReadStatusChanged` events when emails are marked as read. This change improves the communication between components and enhances the notification management system. * refactor: Remove comments * Little cleanup. --------- Co-authored-by: Burak Kaan Köse <bkaankose@outlook.com>
2025-07-26 12:51:53 +02:00
/// <summary>
/// Removes the toast notification for a specific mail by unique id.
/// </summary>
void RemoveNotification(Guid mailUniqueId);
2024-04-18 01:44:37 +02:00
}