Expand description
Account preferences that follow you between your own devices: the block list, the mute list, nicknames, and the general settings document.
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§
- Adopted
Settings - The outcome of taking a relay copy of the settings document.
- Archive
Map - chat id → the newest message time the archiving device had seen (unix ms). A chat counts as archived only while nothing newer has been said in it, so a reply brings it back on every device whether or not this list has caught up.
- 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.
- Relay
Copy - A list as one relay copy carries it: the plaintext and when it was signed.
- Streamer
Settings - Streamer Mode: masks everyone who has not opted in, on every device of the account.
- Synced
Settings - Account-wide switches that follow the user between devices.
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. - ARCHIVE_
D_ TAG - BANNERS_
D_ TAG - BLOCKS_
D_ TAG - MUTES_
D_ TAG - NICKNAMES_
D_ TAG - NOTIFY_
D_ TAG - RAIL_
D_ TAG - SETTINGS_
D_ TAG - START_
D_ TAG - STREAMER_
NOTIF_ LEVELS - The streaming overlay’s levels, in the spelling the wire and the page share.
Functions§
- adopt_
settings - Take a relay copy of the settings (
None= the relays hold none) and mark them reconciled. - edit_
layout - Load, change and commit one layout, one edit at a time: commands run on several threads, and two read-modify-writes interleaved would drop one of them. Returns the layout and whether anything moved (nothing is written when nothing did).
- fetch_
raw - Fetch a list’s newest relay copy,
Ok(None)when the relays hold none. - flush_
layout - 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 answers an echo with a publish — the
relay echoes our own publishes back on this same subscription, and that loops
forever. The one republish is a held settings intent the copy lacks, which an
echo of our own latest publish already carries.
Nonefor a settings copy older than this device’s, which changes nothing. - is_
hydrated - Has
prefbeen reconciled with the relays yet this session? - layout_
is_ dirty - Whether a layout holds edits the relays have not seen.
- live_
d_ tags - Every self-synced list’s d tag, for the live subscriptions: built from
ALL_PREFS, so a new list can’t be read at boot and then never heard from again. - load_
archive - load_
blocks - load_
hidden_ banners - 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 - load_
settings - load_
start - The Main Menu’s pins, in the rail’s shape: keys are pin keys (
crate::start_menu). - 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. Settings always go out from the local copy,
through
publish_settings, which keeps their signing order. - publish_
settings - Publish the local settings, signed after every copy this device has adopted or signed so the relays keep it over them.
- revoke_
archive - Forget an archive that activity at
active_athas outlived, on this device only. An outlived entry is harmless (every reader looks past it) and leaves the relays with the next archive change; publishing it from every device the message reaches would race them against each other. The bool says whether anything changed. - save_
layout_ debounced - Commit an arrangement: on disk now, on the relays once the dragging stops.
- save_
local_ raw - set_
advanced - Turn Advanced Mode on or off, committed locally. The caller publishes.
- set_
archived - Archive a chat as of
at(Some) or bring it back (None), committed locally. The caller publishes. Refused until the relay copy has been read, for the same reason as the banners. - set_
banner_ hidden - Hide or show a community’s banner, committed locally. The caller publishes.
- set_
players - Allow or refuse embedded video players. Held like
set_streamer_on: switching them off is a privacy choice, so it must not wait for the relay copy. - set_
streamer_ notif - Choose what notifications additionally hide while live. Held like
set_streamer_on. - set_
streamer_ on - Go live or stop, in effect at once. The caller publishes.
- set_
streamer_ wallpapers - Choose whether chat wallpapers stay plain while live. Held like
set_streamer_on.