Expand description
The relays an account says are its own, by what they are for, as the relays page shows and changes them.
Seven sets, in six lists:
- Outbox and inbox: the relays the account writes to, where its
notes are to be found, and the relays it reads, where what is meant
for it is to be sent. Both are in its relay list (NIP-65, kind 10002):
one
rtag for each relay, markedwriteorread, or unmarked when it is both. - The others are each a list of
relaytags (NIP-51): in the list’s tags, for anyone to read, or among the tags it keeps to itself, encrypted in its content as a bookmark list’s are. Where direct messages go (NIP-17, kind 10050), which is for anyone to read; the relays it searches (kind 10007); the relays profiles and relay lists are looked up on (kind 10086); the relays it trusts (kind 10089); and the relays it never connects to (kind 10006).
The list of relays an account keeps what is its alone on (kind 10013) is not among them: what is kept here and not published, a draft, is kept on this machine, and that list is neither read nor written.
A list is changed as Amethyst changes it, so that each client finds what the other left: everything in it that is not a relay stays as it was, and a relay stays where it was, said to anyone or kept private. One that is new goes where the list keeps its relays: among the public ones if those are all it has, and among the private ones otherwise; and in a first list, where lists of its kind keep them.
flowchart LR
subgraph page["The relays page"]
outbox["Outbox"]
inbox["Inbox"]
dm["Direct messages"]
search["Search"]
indexer["Indexer"]
trusted["Trusted"]
blocked["Blocked"]
end
outbox --> k10002["Kind 10002: r tags, marked write or read"]
inbox --> k10002
dm --> k10050["Kind 10050: relay tags, public"]
search --> k10007["Kind 10007"]
indexer --> k10086["Kind 10086"]
trusted --> k10089["Kind 10089"]
blocked --> k10006["Kind 10006"]
k10007 --> halves["relay tags, in the list's tags or encrypted in its content"]
k10086 --> halves
k10089 --> halves
k10006 --> halvesWhat each set is used for, and what a relay has to do to be of use in
one (Section::hindrances), is in crate::guide::relays.
Structs§
- Listed
Relays - An account’s relays of one kind, as its newest list of that kind has
them: a list of
relaytags, some for anyone to read and some kept to itself, encrypted in its content as a bookmark list’s are. - Relay
Lists - An account’s relay lists, as they were last read.
- Relay
Sets - An account’s relays, by what they are for.
Enums§
- Hindrance
- What a relay says of itself that gets in the way of what the set it is in is for.
- Kept
- What a list keeps to itself, as far as it was read.
- Section
- One of an account’s sets of relays.
Constants§
- ADVERTISED_
TAG 🔒 - The name of the tag that names a relay in a relay list (NIP-65), and in the other lists of relays (NIP-51, NIP-17).
- NIP_
AUTH - NIP_
SEARCH - The NIPs a relay has to support to be of use in one of the sets: search, and saying who is asking.
- RELAY_
TAG 🔒
Functions§
- advertised
- The relays the relay list
listsays its account writes to, and those it says it reads. None of either without a list. - advertised_
list - The relay list (NIP-65) that replaces
earlier, if there is one to replace: withoutboxfor the relays written to andinboxfor those read, a relay in both named once, and whatever elseearlierhad in it as it was. The relays written to come in their order, and after them those that are only read, in theirs: a list has one order for both. - listed
- The list of
sectionthat replacesearlier, if there is one to replace: withtags, andcontentfor what it keeps to itself. - names_
relay 🔒 - Whether
tagnames a relay, as tags callednamedo in a list. - relays_
named 🔒 - The relays that the tags
fieldscallname, each once, in their order. - replacing 🔒
- When the list that replaces
earlieris written: atnowor, ifearlierclaims to be from later, after it. It has to be the newer of the two. - typed_
relay - The relay
typednames, as someone types one: its address, with or without thewss://nearly all of them start with.