Amarula.Connection.AppStateOps (amarula v0.3.0)
View SourcePure app-state-sync helpers for Amarula.Connection.
The sync flow is Storage- and IQ-bound — requesting patches, persisting
collection state, decoding against stored keys, emitting events — and stays on
Connection. What's pure lives here: pulling shared sync-keys out of incoming
messages, and partitioning decoded changes into the chat/contact event lists.
Summary
Functions
Partition decoded app-state changes into {chats, contacts} for the
:chats_update / :contacts_update events.
Extract any appStateSyncKeyShare keys carried in a message as
[{key_id_b64, key_data}]. Returns [] for messages without a share.
All appStateSyncKeyShare keys across a batch of messages, flattened.
Functions
Partition decoded app-state changes into {chats, contacts} for the
:chats_update / :contacts_update events.
Extract any appStateSyncKeyShare keys carried in a message as
[{key_id_b64, key_data}]. Returns [] for messages without a share.
@spec sync_keys_in(Enumerable.t()) :: [{String.t(), binary()}]
All appStateSyncKeyShare keys across a batch of messages, flattened.