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

Builders/parsers for encrypted message participant nodes.

# `apply_outbound_options`

```elixir
@spec apply_outbound_options(ExWapp.Binary.Node.t(), keyword()) ::
  ExWapp.Binary.Node.t()
```

Applies the stanza options shared by encrypted direct and group messages.

Message type remains a stanza attribute. Media type is attached to each
encrypted payload, and additional metadata nodes are appended after the
encrypted content.

# `build_participant_encrypted_node`

```elixir
@spec build_participant_encrypted_node(String.t(), binary(), atom() | String.t()) ::
  ExWapp.Binary.Node.t()
```

Builds a participant node containing one encrypted payload.

# `enc_type_to_wire`

```elixir
@spec enc_type_to_wire(atom() | String.t()) :: String.t()
```

Converts an internal Signal encryption type to its WhatsApp wire value.

# `extract_participant_jids`

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

Extracts non-empty participant JIDs from encrypted participant nodes.

# `generate_participant_hash_v2`

```elixir
@spec generate_participant_hash_v2(list()) :: String.t() | nil
```

Generates WhatsApp's version 2 participant hash for a recipient list.

# `jid_to_ad_string`

```elixir
@spec jid_to_ad_string(term()) :: String.t()
```

Converts a JID string to ADString format matching whatsmeow/whatsapp-rust.

Format: `user.agent:device@server`
Example: `1234567890@s.whatsapp.net` → `1234567890.0:0@s.whatsapp.net`
Example: `1234567890:37@s.whatsapp.net` → `1234567890.0:37@s.whatsapp.net`

# `maybe_put_message_attr`

```elixir
@spec maybe_put_message_attr(map(), String.t(), term()) :: map()
```

Adds a message attribute only when its value is present.

---

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