Amarula.Protocol.USync.Protocols (amarula v0.1.0)
View SourceUSync protocol definitions.
Port of src/WAUSync/Protocols/. Each protocol contributes three things to
a USync query:
query_element/1— the node placed inside<query>(what to fetch)user_element/2— the per-user node placed inside<user>(may benil)parse/2— turns a result child node into a parsed value
Protocols are addressed by atom (:devices, :contact, :status,
:disappearing_mode, :bot_profile, :lid, :username). parse/2 is also
keyed by the wire tag string so the result parser can dispatch directly.
Summary
Functions
Parse a result child node by its wire tag. Returns nil when the value
should be dropped from the result map (matches Baileys' null filtering).
Functions
@spec parse(String.t(), Amarula.Protocol.Binary.Node.t()) :: any()
Parse a result child node by its wire tag. Returns nil when the value
should be dropped from the result map (matches Baileys' null filtering).
@spec query_element(atom()) :: Amarula.Protocol.Binary.Node.t()
@spec user_element(atom(), map()) :: Amarula.Protocol.Binary.Node.t() | nil