Trusted-contact token helpers aligned with Baileys' privacy-token flow.
Summary
Functions
Append a stored TC token node to the provided content list.
Build a tctoken child node for a JID when a stored token exists.
Fetch trusted-contact privacy tokens for the given JIDs.
Handle a privacy_token notification by persisting trusted-contact tokens.
Functions
@spec build_content(BaileysEx.Signal.Store.t() | nil, String.t(), [ BaileysEx.BinaryNode.t() ]) :: [BaileysEx.BinaryNode.t()] | nil
Append a stored TC token node to the provided content list.
Mirrors Baileys buildTcTokenFromJid: if no token exists, returns the
existing content when present or nil when it is empty.
@spec build_node(BaileysEx.Signal.Store.t() | nil, String.t()) :: BaileysEx.BinaryNode.t() | nil
Build a tctoken child node for a JID when a stored token exists.
@spec get_privacy_tokens(term(), [String.t()], keyword()) :: {:ok, BaileysEx.BinaryNode.t()} | {:error, term()}
Fetch trusted-contact privacy tokens for the given JIDs.
@spec handle_notification( BaileysEx.BinaryNode.t(), keyword() ) :: :ok
Handle a privacy_token notification by persisting trusted-contact tokens.