Expand description
Account preferences that follow you between your own devices: the block list, the mute list, and nicknames.
Each is a private, parameterized-replaceable kind 30078 with its own d tag, NIP-44 self-encrypted, riding the SAME self-sync subscription as the Community, Invite and Pinned lists — so each inherits boot sync, reconnect re-sync and live cross-device edits with no new plumbing.
Vector’s own lists, deliberately not NIP-51. Social clients disagree on what a mute is — several treat it as a soft block — so round-tripping through the shared kind-10000 would blur the mute/block separation Vector draws on purpose. Isolation costs interop and buys exactness.
Newest wins, whole list. These are one person’s settings edited from one device at a time, so the replaceable event’s own last-write-wins is the merge. A device that was offline can therefore republish over a change it never saw; the pre-publish fetch below shrinks that window, and these are deliberate, infrequent actions rather than latency-sensitive ones.
Structs§
- IdList
- A set of ids (npubs for blocks, chat ids for mutes).
- Nickname
Map - npub → nickname. A map rather than a list so a rename replaces rather than duplicates, and so the wire form stays stable under reordering.
- Notify
Entry - One scope’s notification settings on the wire. Level is spelled out rather than numbered so a future rung does not silently become an old one, and an absent field means inherit, exactly as it does on disk.
- Notify
Map - scope id → settings, for communities, channels and DMs alike.
Enums§
- Pref
- Which list a call refers to. Keeps one set of network/storage plumbing for all three rather than three near-identical copies that can drift.
Constants§
- ALL_
PREFS - Every list, in the order hydration walks them.
Notifycomes afterMutesso a device holding both applies the richer one last and wins the overlap. - BLOCKS_
D_ TAG - MUTES_
D_ TAG - NICKNAMES_
D_ TAG - NOTIFY_
D_ TAG - RAIL_
D_ TAG
Functions§
- fetch_
raw - Fetch a list’s relay copy as raw JSON, or
Nonewhen the relays hold none. - flush_
rail - Publish the arrangement if it has unsent edits.
- hydrate_
all - Pull every list once at login and apply it, so this device is reconciled before the user can touch anything. The live subscription also delivers these, but it races the user; this does not.
- ingest_
remote - Consume a sibling device’s update. Never republishes — the relay echoes our own publishes back on this same subscription, and answering an echo with a publish loops forever.
- is_
hydrated - Has
prefbeen reconciled with the relays yet this session? - load_
blocks - load_
local_ raw - Raw JSON of a list’s local mirror. Callers parse into whichever shape the list uses; the storage layer stays shape-agnostic.
- load_
mutes - load_
nicknames - load_
notify - load_
rail - mark_
hydrated - Mark
prefreconciled. Called when a copy is applied AND when the relays confirm none exists — “there is nothing to preserve” is just as reconciled as having read it, and without that a first-ever account could never publish. - publish_
raw - Persist locally, then publish self-encrypted.
- rail_
is_ dirty - Whether the rail holds edits the relays have not seen.
- save_
local_ raw - save_
rail_ debounced - Commit an arrangement: on disk now, on the relays once the dragging stops.