ExWapp.Session.Outbound.IQRequests (ExWapp v0.1.2)

Copy Markdown View Source

Effect boundary for outbound USync, prekey, and group-info IQ requests.

The caller supplies the transport send function. Receives and timeouts run in the caller process, preserving the existing session-worker mailbox contract.

Summary

Functions

Fetches a prekey for one device JID.

Fetches prekeys for several device JIDs in one IQ request.

Queries the linked-device map and persists the successful USync result.

Queries current group participants and addressing mode.

Types

request_state()

@type request_state() :: %{
  :store => term(),
  optional(:runtime_cfg) => map() | nil,
  optional(atom()) => term()
}

send_node_fun()

@type send_node_fun() :: (ExWapp.Binary.Node.t() -> :ok | {:error, term()})

Functions

fetch_prekey(state, jid, signal_sessions, send_node_fun)

Fetches a prekey for one device JID.

fetch_prekeys_batch(state, device_jids, signal_sessions, send_node_fun)

Fetches prekeys for several device JIDs in one IQ request.

query_devices(state, jids, send_node_fun)

@spec query_devices(request_state(), [String.t()], send_node_fun()) ::
  {:ok, map()} | {:error, term()}

Queries the linked-device map and persists the successful USync result.

query_group_info(state, group_jid, send_node_fun)

@spec query_group_info(request_state(), String.t(), send_node_fun()) ::
  {:ok, ExWapp.Session.Outbound.Group.group_info()} | {:error, term()}

Queries current group participants and addressing mode.