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.
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§
Functions§
- fetch_
raw - Fetch a list’s relay copy as raw JSON, or
Nonewhen the relays hold none. - 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 - 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.
- save_
local_ raw