diff --git a/Wino.Core.Domain/Interfaces/IAccountService.cs b/Wino.Core.Domain/Interfaces/IAccountService.cs index 96c38315..63aba714 100644 --- a/Wino.Core.Domain/Interfaces/IAccountService.cs +++ b/Wino.Core.Domain/Interfaces/IAccountService.cs @@ -162,4 +162,12 @@ public interface IAccountService /// Identifies the account for which the synchronization identifier is being updated. /// Represents the new synchronization identifier to be set for the specified account. Task UpdateSyncIdentifierRawAsync(Guid accountId, string syncIdentifier); + + + /// + /// Gets whether the notifications are enabled for the given account id. + /// + /// Account id. + /// Whether the notifications should be created after sync or not. + Task IsNotificationsEnabled(Guid accountId); } diff --git a/Wino.Server/MessageHandlers/MailSynchronizationRequestHandler.cs b/Wino.Server/MessageHandlers/MailSynchronizationRequestHandler.cs index 47134a09..e888c3fe 100644 --- a/Wino.Server/MessageHandlers/MailSynchronizationRequestHandler.cs +++ b/Wino.Server/MessageHandlers/MailSynchronizationRequestHandler.cs @@ -23,14 +23,17 @@ public class MailSynchronizationRequestHandler : ServerMessageHandler IsNotificationsEnabled(Guid accountId) + { + var account = await GetAccountAsync(accountId); + + return account?.Preferences?.IsNotificationsEnabled ?? false; + } }