Interface IConversationSettingsStore
- Namespace
- Signal.Application.Conversations
- Assembly
- Signal.Application.dll
Stores per-conversation settings. The default keeps them in memory (lost on restart); implement this port with a database to keep them. It is queried at most once per text message, so keep reads cheap (or cache).
public interface IConversationSettingsStore
Methods
GetAsync(PhoneNumber, Recipient, CancellationToken)
Gets a conversation's settings.
ValueTask<ConversationSettings?> GetAsync(PhoneNumber account, Recipient conversation, CancellationToken cancellationToken = default)
Parameters
accountPhoneNumberThe receiving account.
conversationRecipientThe group or direct-chat partner.
cancellationTokenCancellationTokenCancels the operation.
Returns
- ValueTask<ConversationSettings>
The settings, or null if none are stored (global configuration applies).
RemoveAsync(PhoneNumber, Recipient, CancellationToken)
Removes a conversation's settings, so the global configuration applies again.
Task<bool> RemoveAsync(PhoneNumber account, Recipient conversation, CancellationToken cancellationToken = default)
Parameters
accountPhoneNumberThe receiving account.
conversationRecipientThe group or direct-chat partner.
cancellationTokenCancellationTokenCancels the operation.
Returns
SetAsync(PhoneNumber, Recipient, ConversationSettings, CancellationToken)
Stores a conversation's settings, replacing earlier ones.
Task SetAsync(PhoneNumber account, Recipient conversation, ConversationSettings settings, CancellationToken cancellationToken = default)
Parameters
accountPhoneNumberThe receiving account.
conversationRecipientThe group or direct-chat partner.
settingsConversationSettingsThe settings.
cancellationTokenCancellationTokenCancels the operation.
Returns
- Task
A task that completes when the settings are stored.
Exceptions
- ArgumentException
A prefix is empty or contains whitespace.