Pure JID helpers used by session send/decrypt flows.
Keeping these helpers isolated makes the session orchestration code easier to reason about and test.
Summary
Functions
Fallback self-chat strategy used when a DSM-only send appears silently dropped.
Builds target specs for self-chat fanout.
Functions
@spec build_self_chat_fallback_target_specs([String.t()], [String.t()], String.t()) :: [ %{jid: String.t(), payload_kind: :recipient | :own} ]
Fallback self-chat strategy used when a DSM-only send appears silently dropped.
It keeps one primary target as :recipient payload and uses :own payload for
the remaining fanout targets.
@spec build_self_chat_target_specs([String.t()], [String.t()], String.t()) :: [ %{jid: String.t(), payload_kind: :recipient | :own} ]
Builds target specs for self-chat fanout.
WhatsMeow parity: for self-chat, every non-current target gets the DSM payload. There is no plain "recipient payload" branch in self-chat fanout.
@spec device_id(term()) :: non_neg_integer() | nil