# `ExWapp.Session.Outbound.Group`
[🔗](https://github.com/elchemista/ex_wapp/blob/v0.1.5/lib/ex_wapp/session/outbound/group.ex#L1)

Group-specific outbound transformations and routing decisions.

The session worker remains responsible for transport calls, response
receives, timeouts, persistence, and retries. This module owns sender-key
payload construction, group target selection, group IQ shapes, and group
message-node composition.

# `group_info`

```elixir
@type group_info() :: %{participants: [String.t()], addressing_mode: String.t() | nil}
```

# `build_encrypted_message_node`

```elixir
@spec build_encrypted_message_node(
  String.t(),
  String.t(),
  [ExWapp.Binary.Node.t()],
  binary(),
  term(),
  term(),
  boolean()
) :: ExWapp.Binary.Node.t()
```

Builds the final encrypted group message node.

# `build_info_query`

```elixir
@spec build_info_query(String.t(), String.t()) :: ExWapp.Binary.Node.t()
```

Builds the IQ node used to request interactive group information.

# `build_sender_key_payloads`

```elixir
@spec build_sender_key_payloads(term(), String.t(), binary()) ::
  {:ok, binary(), binary()} | {:error, term()}
```

Creates the sender-key distribution payload and encrypted group payload.

# `distribution_targets`

```elixir
@spec distribution_targets(
  [term()],
  map(),
  term(),
  non_neg_integer() | nil,
  String.t(),
  String.t(),
  term(),
  map()
) :: {[String.t()], [String.t()]}
```

Resolves live and cached sender-key distribution targets.

Targets incompatible with the group's addressing mode and the current local
device are excluded.

# `finalize_sessions_result`

```elixir
@spec finalize_sessions_result(
  {:error, term()} | ExWapp.Signal.SessionStore.t(),
  map(),
  [String.t()]
) ::
  {:error, term()} | {:ok, ExWapp.Signal.SessionStore.t(), map(), [String.t()]}
```

Normalizes the group session preparation result.

# `parse_info_response`

```elixir
@spec parse_info_response(term(), String.t()) ::
  {:ok, group_info()} | {:error, term()}
```

Parses the interactive group information response.

# `prekey_targets`

```elixir
@spec prekey_targets(
  [term()],
  map(),
  ExWapp.Signal.SessionStore.t(),
  map(),
  String.t(),
  String.t(),
  non_neg_integer()
) :: [String.t()]
```

Selects group distribution targets that need a prekey bootstrap.

# `query_jids`

```elixir
@spec query_jids([term()], term(), String.t(), String.t()) :: [String.t()]
```

Builds the participant and local-account JIDs for the group USync query.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
