Resolves direct-message fanout targets.
This module owns the pure decision layer for recipient devices, linked devices, self-chat payload selection, and soft cached targets. Store reads, cache eviction, logging, encryption, and transport remain at the worker boundary.
Summary
Functions
Resolves all encrypted target specifications from a prepared session context.
Resolves live and cached target candidates without applying cache effects.
Returns whether the destination belongs to the local account identity.
Types
@type payload_kind() :: :recipient | :own
@type target_spec() :: %{jid: String.t(), payload_kind: payload_kind()}
Functions
@spec resolve(context()) :: resolution()
Resolves all encrypted target specifications from a prepared session context.
Cached-only targets are included only when a prekey bundle proves them reachable. Unreachable cached targets are returned as eviction batches so the worker can apply the storage effect after this pure decision.
@spec resolve_soft_targets( ExWapp.Signal.SessionStore.t() | nil, term(), term(), term(), term() ) :: {[String.t()], [String.t()]}
Resolves live and cached target candidates without applying cache effects.
The second tuple element contains cached targets that the caller should evict. Returning that decision keeps persistence outside this module.
Returns whether the destination belongs to the local account identity.
Both phone-number and LID identities are considered.