ExWapp.Session.AppStateCommands (ExWapp v0.1.2)

Copy Markdown View Source

Chat and contact commands that reach the server through app-state sync.

Each command picks the patch that describes the change and hands it to the session, then reports success as :ok instead of leaking the hash state the transport returns.

This is orchestration, not actor work: nothing here touches the session process state, which is why it lives outside ExWapp.Session.Worker.

Summary

Functions

Archives a chat, synchronising the change to the other devices.

Creates or updates a contact, synchronising the change to the other devices.

Deletes a chat, synchronising the change to the other devices.

Deletes a contact, synchronising the change to the other devices.

Unarchives a chat, synchronising the change to the other devices.

Types

result()

@type result() :: :ok | {:error, term()}

Functions

archive_chat(server, jid)

@spec archive_chat(GenServer.server(), String.t()) :: result()

Archives a chat, synchronising the change to the other devices.

create_contact(server, jid, name)

@spec create_contact(GenServer.server(), String.t(), String.t()) :: result()

Creates or updates a contact, synchronising the change to the other devices.

delete_chat(server, jid)

@spec delete_chat(GenServer.server(), String.t()) :: result()

Deletes a chat, synchronising the change to the other devices.

delete_contact(server, jid)

@spec delete_contact(GenServer.server(), String.t()) :: result()

Deletes a contact, synchronising the change to the other devices.

unarchive_chat(server, jid)

@spec unarchive_chat(GenServer.server(), String.t()) :: result()

Unarchives a chat, synchronising the change to the other devices.