Amarula.Protocol.USync.Devices (amarula v0.1.0)
View SourceTurn a parsed USync result into the concrete list of device JIDs to encrypt
for. Port of Baileys extractDeviceJids (src/Utils/signal.ts).
Each USync result entry carries the user's id (jid) and a "devices" map
with a :device_list. We expand that into one JID per device, applying the
same three filters Baileys uses:
- drop device 0 when
exclude_zero_devices?is set - drop our own sending device (same user and same device)
- drop non-zero devices that lack a
key_index(server rejects them)
Summary
Functions
Expand result_list (the :list from USync.parse_result/2) into device JIDs.
Types
@type device_jid() :: %{ user: String.t(), device: non_neg_integer(), server: String.t(), jid: String.t() }
Functions
@spec extract([map()], String.t(), String.t() | nil, boolean()) :: [device_jid()]
Expand result_list (the :list from USync.parse_result/2) into device JIDs.
my_jid / my_lid identify our own account so we can skip our sending
device. exclude_zero_devices? mirrors Baileys' excludeZeroDevices flag.