Table of Contents

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

account PhoneNumber

The receiving account.

conversation Recipient

The group or direct-chat partner.

cancellationToken CancellationToken

Cancels 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

account PhoneNumber

The receiving account.

conversation Recipient

The group or direct-chat partner.

cancellationToken CancellationToken

Cancels the operation.

Returns

Task<bool>

true if settings existed.

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

account PhoneNumber

The receiving account.

conversation Recipient

The group or direct-chat partner.

settings ConversationSettings

The settings.

cancellationToken CancellationToken

Cancels the operation.

Returns

Task

A task that completes when the settings are stored.

Exceptions

ArgumentException

A prefix is empty or contains whitespace.