2024-04-18 01:44:37 +02:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
2024-12-27 00:18:46 +01:00
|
|
|
using Google.Apis.Calendar.v3.Data;
|
2024-04-18 01:44:37 +02:00
|
|
|
using MimeKit;
|
2024-12-27 00:18:46 +01:00
|
|
|
using Wino.Core.Domain.Entities.Calendar;
|
2024-11-10 23:28:25 +01:00
|
|
|
using Wino.Core.Domain.Entities.Mail;
|
|
|
|
|
using Wino.Core.Domain.Entities.Shared;
|
2025-02-22 23:09:53 +01:00
|
|
|
using Wino.Core.Domain.Enums;
|
2024-04-18 01:44:37 +02:00
|
|
|
using Wino.Core.Domain.Interfaces;
|
|
|
|
|
using Wino.Core.Domain.Models.MailItem;
|
2026-02-15 02:20:18 +01:00
|
|
|
using Wino.Core.Domain.Models.Calendar;
|
2024-04-18 01:44:37 +02:00
|
|
|
using Wino.Core.Domain.Models.Synchronization;
|
2024-11-30 23:05:07 +01:00
|
|
|
using Wino.Services;
|
2024-04-18 01:44:37 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
namespace Wino.Core.Integration.Processors;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Database change processor that handles common operations for all synchronizers.
|
|
|
|
|
/// When a synchronizer detects a change, it should call the appropriate method in this class to reflect the change in the database.
|
|
|
|
|
/// Different synchronizers might need additional implementations.
|
|
|
|
|
/// <see cref="IGmailChangeProcessor"/>, <see cref="IOutlookChangeProcessor"/> and <see cref="IImapChangeProcessor"/>
|
|
|
|
|
/// None of the synchronizers can directly change anything in the database.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface IDefaultChangeProcessor
|
2024-04-18 01:44:37 +02:00
|
|
|
{
|
2025-02-16 11:54:23 +01:00
|
|
|
Task UpdateAccountAsync(MailAccount account);
|
2025-03-19 23:22:57 +01:00
|
|
|
// Task<string> UpdateAccountDeltaSynchronizationIdentifierAsync(Guid accountId, string deltaSynchronizationIdentifier);
|
2025-02-16 11:54:23 +01:00
|
|
|
Task DeleteAssignmentAsync(Guid accountId, string mailCopyId, string remoteFolderId);
|
|
|
|
|
Task ChangeMailReadStatusAsync(string mailCopyId, bool isRead);
|
|
|
|
|
Task ChangeFlagStatusAsync(string mailCopyId, bool isFlagged);
|
|
|
|
|
Task<bool> CreateMailAsync(Guid AccountId, NewMailItemPackage package);
|
|
|
|
|
Task DeleteMailAsync(Guid accountId, string mailId);
|
|
|
|
|
Task<List<MailCopy>> GetDownloadedUnreadMailsAsync(Guid accountId, IEnumerable<string> downloadedMailCopyIds);
|
|
|
|
|
Task SaveMimeFileAsync(Guid fileId, MimeMessage mimeMessage, Guid accountId);
|
|
|
|
|
Task DeleteFolderAsync(Guid accountId, string remoteFolderId);
|
|
|
|
|
Task InsertFolderAsync(MailItemFolder folder);
|
|
|
|
|
Task UpdateFolderAsync(MailItemFolder folder);
|
|
|
|
|
Task<List<MailItemFolder>> GetLocalFoldersAsync(Guid accountId);
|
|
|
|
|
Task<List<MailItemFolder>> GetSynchronizationFoldersAsync(MailSynchronizationOptions options);
|
|
|
|
|
Task<bool> MapLocalDraftAsync(Guid accountId, Guid localDraftCopyUniqueId, string newMailCopyId, string newDraftId, string newThreadId);
|
|
|
|
|
Task UpdateFolderLastSyncDateAsync(Guid folderId);
|
|
|
|
|
Task UpdateRemoteAliasInformationAsync(MailAccount account, List<RemoteAccountAlias> remoteAccountAliases);
|
2026-04-13 01:09:40 +02:00
|
|
|
Task UpdateAliasSendCapabilityAsync(Guid accountId, string aliasAddress, AliasSendCapability capability);
|
2025-02-16 11:54:23 +01:00
|
|
|
// Calendar
|
|
|
|
|
Task<List<AccountCalendar>> GetAccountCalendarsAsync(Guid accountId);
|
|
|
|
|
|
|
|
|
|
Task DeleteCalendarItemAsync(Guid calendarItemId);
|
2025-12-30 23:32:00 +01:00
|
|
|
Task DeleteCalendarItemAsync(string calendarRemoteEventId, Guid calendarId);
|
2026-02-10 21:35:55 +01:00
|
|
|
Task<CalendarItem> GetCalendarItemAsync(Guid calendarId, string remoteEventId);
|
2025-02-16 11:54:23 +01:00
|
|
|
|
|
|
|
|
Task DeleteAccountCalendarAsync(AccountCalendar accountCalendar);
|
|
|
|
|
Task InsertAccountCalendarAsync(AccountCalendar accountCalendar);
|
|
|
|
|
Task UpdateAccountCalendarAsync(AccountCalendar accountCalendar);
|
|
|
|
|
|
|
|
|
|
Task UpdateCalendarDeltaSynchronizationToken(Guid calendarId, string deltaToken);
|
2025-02-23 22:17:40 +01:00
|
|
|
Task<List<MailCopy>> GetMailCopiesAsync(IEnumerable<string> mailCopyIds);
|
2025-02-22 00:22:00 +01:00
|
|
|
Task CreateMailRawAsync(MailAccount account, MailItemFolder mailItemFolder, NewMailItemPackage package);
|
2025-02-22 23:09:53 +01:00
|
|
|
Task DeleteUserMailCacheAsync(Guid accountId);
|
2026-02-10 21:35:55 +01:00
|
|
|
Task UpsertMailInvitationCalendarMappingAsync(MailInvitationCalendarMapping mapping);
|
|
|
|
|
Task<MailInvitationCalendarMapping> GetMailInvitationCalendarMappingAsync(Guid accountId, string mailCopyId);
|
2025-02-23 17:05:46 +01:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Checks whether the mail exists in the folder.
|
|
|
|
|
/// When deciding Create or Update existing mail, we need to check if the mail exists in the folder.
|
|
|
|
|
/// Also duplicate assignments for Gmail's virtual Archive folder is ignored.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="messageId">Message id</param>
|
|
|
|
|
/// <param name="folderId">Folder's local id.</param>
|
|
|
|
|
/// <returns>Whether mail exists in the folder or not.</returns>
|
|
|
|
|
Task<bool> IsMailExistsInFolderAsync(string messageId, Guid folderId);
|
2025-02-23 22:17:40 +01:00
|
|
|
Task<List<string>> AreMailsExistsAsync(IEnumerable<string> mailCopyIds);
|
2025-03-19 23:22:57 +01:00
|
|
|
Task<string> UpdateAccountDeltaSynchronizationIdentifierAsync(Guid accountId, string synchronizationDeltaIdentifier);
|
2025-02-16 11:54:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public interface IGmailChangeProcessor : IDefaultChangeProcessor
|
|
|
|
|
{
|
2025-02-22 23:09:53 +01:00
|
|
|
Task<bool> HasAccountAnyDraftAsync(Guid accountId);
|
2025-02-16 11:54:23 +01:00
|
|
|
Task MapLocalDraftAsync(string mailCopyId, string newDraftId, string newThreadId);
|
|
|
|
|
Task CreateAssignmentAsync(Guid accountId, string mailCopyId, string remoteFolderId);
|
|
|
|
|
Task ManageCalendarEventAsync(Event calendarEvent, AccountCalendar assignedCalendar, MailAccount organizerAccount);
|
2025-02-23 17:05:46 +01:00
|
|
|
Task<GmailArchiveComparisonResult> GetGmailArchiveComparisonResultAsync(Guid archiveFolderId, List<string> onlineArchiveMailIds);
|
2025-02-16 11:54:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public interface IOutlookChangeProcessor : IDefaultChangeProcessor
|
|
|
|
|
{
|
2024-04-18 01:44:37 +02:00
|
|
|
/// <summary>
|
2025-02-16 11:54:23 +01:00
|
|
|
/// Updates Folder's delta synchronization identifier.
|
|
|
|
|
/// Only used in Outlook since it does per-folder sync.
|
2024-04-18 01:44:37 +02:00
|
|
|
/// </summary>
|
2025-02-16 11:54:23 +01:00
|
|
|
/// <param name="folderId">Folder id</param>
|
|
|
|
|
/// <param name="synchronizationIdentifier">New synchronization identifier.</param>
|
|
|
|
|
/// <returns>New identifier if success.</returns>
|
|
|
|
|
Task UpdateFolderDeltaSynchronizationIdentifierAsync(Guid folderId, string deltaSynchronizationIdentifier);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Outlook may expire folder's delta token after a while.
|
|
|
|
|
/// Recommended action for this scenario is to reset token and do full sync.
|
|
|
|
|
/// This method resets the token for the given folder.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="folderId">Local folder id to reset token for.</param>
|
|
|
|
|
/// <returns>Empty string to assign folder delta sync for.</returns>
|
|
|
|
|
Task<string> ResetFolderDeltaTokenAsync(Guid folderId);
|
|
|
|
|
|
|
|
|
|
Task ManageCalendarEventAsync(Microsoft.Graph.Models.Event calendarEvent, AccountCalendar assignedCalendar, MailAccount organizerAccount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public interface IImapChangeProcessor : IDefaultChangeProcessor
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Returns all known uids for the given folder.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="folderId">Folder id to retrieve uIds for.</param>
|
|
|
|
|
Task<IList<uint>> GetKnownUidsForFolderAsync(Guid folderId);
|
2026-02-06 01:18:12 +01:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the most recent mail IDs for a folder (for notification purposes).
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="folderId">Folder ID.</param>
|
|
|
|
|
/// <param name="count">Number of recent mails to return.</param>
|
|
|
|
|
Task<IEnumerable<string>> GetRecentMailIdsForFolderAsync(Guid folderId, int count);
|
2026-02-15 02:20:18 +01:00
|
|
|
|
|
|
|
|
Task ManageCalendarEventAsync(CalDavCalendarEvent calendarEvent, AccountCalendar assignedCalendar, MailAccount organizerAccount);
|
|
|
|
|
Task SaveCalendarItemIcsAsync(Guid accountId, Guid calendarId, Guid calendarItemId, string remoteEventId, string remoteResourceHref, string eTag, string icsContent);
|
2026-02-18 20:43:10 +01:00
|
|
|
Task<string> GetCalendarItemIcsETagAsync(Guid accountId, Guid calendarId, Guid calendarItemId);
|
2026-02-15 02:20:18 +01:00
|
|
|
Task DeleteCalendarItemIcsAsync(Guid accountId, Guid calendarItemId);
|
|
|
|
|
Task DeleteCalendarIcsForCalendarAsync(Guid accountId, Guid calendarId);
|
2025-02-16 11:54:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class DefaultChangeProcessor(IDatabaseService databaseService,
|
|
|
|
|
IFolderService folderService,
|
|
|
|
|
IMailService mailService,
|
|
|
|
|
ICalendarService calendarService,
|
|
|
|
|
IAccountService accountService,
|
|
|
|
|
IMimeFileService mimeFileService) : BaseDatabaseService(databaseService), IDefaultChangeProcessor
|
|
|
|
|
{
|
|
|
|
|
protected IMailService MailService = mailService;
|
|
|
|
|
protected ICalendarService CalendarService = calendarService;
|
|
|
|
|
protected IFolderService FolderService = folderService;
|
|
|
|
|
protected IAccountService AccountService = accountService;
|
|
|
|
|
|
|
|
|
|
private readonly IMimeFileService _mimeFileService = mimeFileService;
|
2024-04-18 01:44:37 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task<string> UpdateAccountDeltaSynchronizationIdentifierAsync(Guid accountId, string synchronizationDeltaIdentifier)
|
2025-03-19 23:22:57 +01:00
|
|
|
=> AccountService.UpdateSyncIdentifierRawAsync(accountId, synchronizationDeltaIdentifier);
|
2024-04-18 01:44:37 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task ChangeFlagStatusAsync(string mailCopyId, bool isFlagged)
|
|
|
|
|
=> MailService.ChangeFlagStatusAsync(mailCopyId, isFlagged);
|
2024-04-18 01:44:37 +02:00
|
|
|
|
2025-02-23 22:17:40 +01:00
|
|
|
public Task<List<string>> AreMailsExistsAsync(IEnumerable<string> mailCopyIds)
|
|
|
|
|
=> MailService.AreMailsExistsAsync(mailCopyIds);
|
|
|
|
|
|
|
|
|
|
public Task<List<MailCopy>> GetMailCopiesAsync(IEnumerable<string> mailCopyIds)
|
|
|
|
|
=> MailService.GetMailItemsAsync(mailCopyIds);
|
|
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task ChangeMailReadStatusAsync(string mailCopyId, bool isRead)
|
|
|
|
|
=> MailService.ChangeReadStatusAsync(mailCopyId, isRead);
|
2024-04-18 01:44:37 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task DeleteAssignmentAsync(Guid accountId, string mailCopyId, string remoteFolderId)
|
|
|
|
|
=> MailService.DeleteAssignmentAsync(accountId, mailCopyId, remoteFolderId);
|
2024-04-18 01:44:37 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task DeleteMailAsync(Guid accountId, string mailId)
|
|
|
|
|
=> MailService.DeleteMailAsync(accountId, mailId);
|
2024-04-18 01:44:37 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task<bool> CreateMailAsync(Guid accountId, NewMailItemPackage package)
|
|
|
|
|
=> MailService.CreateMailAsync(accountId, package);
|
2024-04-18 01:44:37 +02:00
|
|
|
|
2025-02-22 00:22:00 +01:00
|
|
|
public Task CreateMailRawAsync(MailAccount account, MailItemFolder mailItemFolder, NewMailItemPackage package)
|
|
|
|
|
=> MailService.CreateMailRawAsync(account, mailItemFolder, package);
|
2024-04-18 01:44:37 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task<bool> MapLocalDraftAsync(Guid accountId, Guid localDraftCopyUniqueId, string newMailCopyId, string newDraftId, string newThreadId)
|
|
|
|
|
=> MailService.MapLocalDraftAsync(accountId, localDraftCopyUniqueId, newMailCopyId, newDraftId, newThreadId);
|
2024-04-18 01:44:37 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task<List<MailItemFolder>> GetLocalFoldersAsync(Guid accountId)
|
|
|
|
|
=> FolderService.GetFoldersAsync(accountId);
|
2024-04-18 01:44:37 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task<List<MailItemFolder>> GetSynchronizationFoldersAsync(MailSynchronizationOptions options)
|
|
|
|
|
=> FolderService.GetSynchronizationFoldersAsync(options);
|
2024-04-18 01:44:37 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task DeleteFolderAsync(Guid accountId, string remoteFolderId)
|
|
|
|
|
=> FolderService.DeleteFolderAsync(accountId, remoteFolderId);
|
2024-04-18 01:44:37 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task InsertFolderAsync(MailItemFolder folder)
|
|
|
|
|
=> FolderService.InsertFolderAsync(folder);
|
2024-04-18 01:44:37 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task UpdateFolderAsync(MailItemFolder folder)
|
|
|
|
|
=> FolderService.UpdateFolderAsync(folder);
|
2024-07-09 01:05:16 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task<List<MailCopy>> GetDownloadedUnreadMailsAsync(Guid accountId, IEnumerable<string> downloadedMailCopyIds)
|
|
|
|
|
=> MailService.GetDownloadedUnreadMailsAsync(accountId, downloadedMailCopyIds);
|
2024-04-18 01:44:37 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task SaveMimeFileAsync(Guid fileId, MimeMessage mimeMessage, Guid accountId)
|
|
|
|
|
=> _mimeFileService.SaveMimeMessageAsync(fileId, mimeMessage, accountId);
|
2024-06-02 21:35:03 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task UpdateFolderLastSyncDateAsync(Guid folderId)
|
|
|
|
|
=> FolderService.UpdateFolderLastSyncDateAsync(folderId);
|
2024-08-15 23:57:45 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task UpdateAccountAsync(MailAccount account)
|
|
|
|
|
=> AccountService.UpdateAccountAsync(account);
|
2024-08-16 01:29:31 +02:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task UpdateRemoteAliasInformationAsync(MailAccount account, List<RemoteAccountAlias> remoteAccountAliases)
|
|
|
|
|
=> AccountService.UpdateRemoteAliasInformationAsync(account, remoteAccountAliases);
|
2024-12-27 00:18:46 +01:00
|
|
|
|
2026-04-13 01:09:40 +02:00
|
|
|
public Task UpdateAliasSendCapabilityAsync(Guid accountId, string aliasAddress, AliasSendCapability capability)
|
|
|
|
|
=> AccountService.UpdateAliasSendCapabilityAsync(accountId, aliasAddress, capability);
|
|
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task<List<AccountCalendar>> GetAccountCalendarsAsync(Guid accountId)
|
|
|
|
|
=> CalendarService.GetAccountCalendarsAsync(accountId);
|
2024-12-27 00:18:46 +01:00
|
|
|
|
2026-02-15 02:20:18 +01:00
|
|
|
public virtual Task DeleteCalendarItemAsync(Guid calendarItemId)
|
2025-02-16 11:54:23 +01:00
|
|
|
=> CalendarService.DeleteCalendarItemAsync(calendarItemId);
|
2024-12-27 00:18:46 +01:00
|
|
|
|
2026-02-15 02:20:18 +01:00
|
|
|
public virtual Task DeleteCalendarItemAsync(string calendarRemoteEventId, Guid calendarId)
|
2025-12-30 23:32:00 +01:00
|
|
|
=> CalendarService.DeleteCalendarItemAsync(calendarRemoteEventId, calendarId);
|
|
|
|
|
|
2026-02-10 21:35:55 +01:00
|
|
|
public Task<CalendarItem> GetCalendarItemAsync(Guid calendarId, string remoteEventId)
|
|
|
|
|
=> CalendarService.GetCalendarItemAsync(calendarId, remoteEventId);
|
|
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task DeleteAccountCalendarAsync(AccountCalendar accountCalendar)
|
|
|
|
|
=> CalendarService.DeleteAccountCalendarAsync(accountCalendar);
|
2024-12-27 00:18:46 +01:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task InsertAccountCalendarAsync(AccountCalendar accountCalendar)
|
|
|
|
|
=> CalendarService.InsertAccountCalendarAsync(accountCalendar);
|
2024-12-27 00:18:46 +01:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task UpdateAccountCalendarAsync(AccountCalendar accountCalendar)
|
|
|
|
|
=> CalendarService.UpdateAccountCalendarAsync(accountCalendar);
|
2025-01-07 13:42:10 +01:00
|
|
|
|
2025-02-16 11:54:23 +01:00
|
|
|
public Task UpdateCalendarDeltaSynchronizationToken(Guid calendarId, string deltaToken)
|
|
|
|
|
=> CalendarService.UpdateCalendarDeltaSynchronizationToken(calendarId, deltaToken);
|
2025-02-22 23:09:53 +01:00
|
|
|
|
|
|
|
|
public async Task DeleteUserMailCacheAsync(Guid accountId)
|
|
|
|
|
{
|
|
|
|
|
await _mimeFileService.DeleteUserMimeCacheAsync(accountId).ConfigureAwait(false);
|
|
|
|
|
await AccountService.DeleteAccountMailCacheAsync(accountId, AccountCacheResetReason.ExpiredCache).ConfigureAwait(false);
|
|
|
|
|
}
|
2025-02-23 17:05:46 +01:00
|
|
|
|
2026-02-10 21:35:55 +01:00
|
|
|
public async Task UpsertMailInvitationCalendarMappingAsync(MailInvitationCalendarMapping mapping)
|
|
|
|
|
{
|
|
|
|
|
if (mapping == null || mapping.AccountId == Guid.Empty || string.IsNullOrWhiteSpace(mapping.MailCopyId))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
var existing = await Connection.Table<MailInvitationCalendarMapping>()
|
|
|
|
|
.FirstOrDefaultAsync(x => x.AccountId == mapping.AccountId && x.MailCopyId == mapping.MailCopyId)
|
|
|
|
|
.ConfigureAwait(false);
|
|
|
|
|
|
|
|
|
|
if (existing == null)
|
|
|
|
|
{
|
|
|
|
|
if (mapping.Id == Guid.Empty)
|
|
|
|
|
mapping.Id = Guid.NewGuid();
|
|
|
|
|
|
|
|
|
|
mapping.UpdatedAtUtc = DateTime.UtcNow;
|
|
|
|
|
await Connection.InsertAsync(mapping, typeof(MailInvitationCalendarMapping)).ConfigureAwait(false);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
existing.InvitationUid = mapping.InvitationUid;
|
|
|
|
|
existing.CalendarId = mapping.CalendarId;
|
|
|
|
|
existing.CalendarItemId = mapping.CalendarItemId;
|
|
|
|
|
existing.CalendarRemoteEventId = mapping.CalendarRemoteEventId;
|
|
|
|
|
existing.UpdatedAtUtc = DateTime.UtcNow;
|
|
|
|
|
|
|
|
|
|
await Connection.UpdateAsync(existing, typeof(MailInvitationCalendarMapping)).ConfigureAwait(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Task<MailInvitationCalendarMapping> GetMailInvitationCalendarMappingAsync(Guid accountId, string mailCopyId)
|
|
|
|
|
{
|
|
|
|
|
if (accountId == Guid.Empty || string.IsNullOrWhiteSpace(mailCopyId))
|
|
|
|
|
return Task.FromResult<MailInvitationCalendarMapping>(null);
|
|
|
|
|
|
|
|
|
|
return Connection.Table<MailInvitationCalendarMapping>()
|
|
|
|
|
.FirstOrDefaultAsync(x => x.AccountId == accountId && x.MailCopyId == mailCopyId);
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-23 17:05:46 +01:00
|
|
|
public Task<bool> IsMailExistsInFolderAsync(string messageId, Guid folderId)
|
|
|
|
|
=> MailService.IsMailExistsAsync(messageId, folderId);
|
2024-04-18 01:44:37 +02:00
|
|
|
}
|