BaileysEx.Signal.Session (baileys_ex v0.1.0-alpha.9)

Copy Markdown View Source

Session assertion helpers aligned with Baileys rc.9 assertSessions.

Summary

Functions

Validates that active E2E sessions exist for the specified JIDs, fetching any missing pre-keys.

Decodes E2E session pre-keys from the server payload and injects them into the signal repository.

Types

context()

@type context() :: %{
  :signal_repository => BaileysEx.Signal.Repository.t(),
  optional(:query_fun) => (BaileysEx.BinaryNode.t() ->
                             {:ok, BaileysEx.BinaryNode.t()} | {:error, term()}),
  optional(atom()) => term()
}

Functions

assert_sessions(context, jids, opts)

@spec assert_sessions(context(), [String.t()], keyword()) ::
  {:ok, context(), boolean()} | {:error, term()}

Validates that active E2E sessions exist for the specified JIDs, fetching any missing pre-keys.

parse_and_inject_e2e_sessions(response, repo)

@spec parse_and_inject_e2e_sessions(
  BaileysEx.BinaryNode.t(),
  BaileysEx.Signal.Repository.t()
) ::
  {:ok, BaileysEx.Signal.Repository.t()} | {:error, term()}

Decodes E2E session pre-keys from the server payload and injects them into the signal repository.