Expand description
Account data, tags, filters, and public-room listing. Profile nick lookup and any restricted user directory are product concerns, not in this crate.
Structs§
- Directory
Match - One ranked, labeled match — [
rank_directory_candidates]’s own output row, carryingpublic_idalong so the route handler cancrate::store::ensure_matrix_userit into an mxid without a second identity-database round trip. - Public
Rooms Filter - Public
Rooms Query - Public
Rooms Request Body - TagBody
- User
Directory Result - User
Directory Search Request - User
Directory Search Response
Constants§
- DEFAULT_
DIRECTORY_ RESULTS limit’s default when the client omits it — matchesroutes::dm::lookup_recipients’s ownMAX_LOOKUP_RESULTS.- DEFAULT_
PUBLIC_ ROOMS_ LIMIT - FILTER_
MAX_ BYTES - Ceiling on a stored Filter JSON object (P8 brief item 4).
- MAX_
DIRECTORY_ RESULTS - Ceiling a client-supplied
limitis clamped to — the DM lookup has no client-facinglimitat all (always 10); the Matrix endpoint’s own spec shape does take one, so this is the abuse-prevention ceiling on it. - MAX_
PUBLIC_ ROOMS_ LIMIT - MAX_
SEARCH_ TERM_ LEN - A trimmed, lowercased
search_termlonger than this is truncated rather than refused — matchesroutes::dm::lookup_recipients’s ownMAX_LOOKUP_QUERY_LEN. - MAX_
TAGS_ PER_ ROOM - MAX_
TAG_ NAME_ BYTES
Functions§
- apply_
tag_ delete DELETE .../tags/{tag}— idempotent: removing an absent tag is a silent no-op, matching Matrix’s own DELETE semantics.- apply_
tag_ put PUT .../tags/{tag}’s whole DB-side decision: validate the tag name andorder, refuse growing pastMAX_TAGS_PER_ROOMon a genuinely NEW tag (re-setting an existing tag’sordernever counts against the cap), then upsert. Membership is checked by the route handler, not here (this function takes no caller/room-membership context at all — the “testable cores” convention this module states).- check_
account_ data_ type_ allowed m.fully_readis refused on both the global and per-room account-data endpoints (P8 brief items 1/2): it belongs to room account data viaPOST .../read_markers(crate::ephemeral::apply_read_markers), which is the only writer this server ever lets touch it — a rawPUThere would let a client desync it from the receipt bookkeeping that route also updates in the same call.- check_
caller_ owns_ user_ id - Every
/user/{userId}/...route in this module: the path’suserId(a full mxid) must be the caller’s own — this server has no notion of one account managing another’s account data/tags/filters. - clamp_
public_ rooms_ limit - list_
public_ rooms - One page of public rooms from the messenger database alone.
- public_
room_ json - One
chunkentry’s wire shape (P8 brief item 7) —name/topicare omitted entirely (notnull) when the room never set them, matching Matrix’s own convention of omitting rather than nulling absent profile fields. - read_
tags {"tags": {...}}’stagsobject, or empty when the room has nom.tagaccount-data row yet.- require_
member - require_
member_ or_ invited - The tags gate (P8 brief item 3): joined OR invited, unlike plain per-room account data (item 2), which requires a full join.
- search_
users_ by_ localpart - Match an mxid localpart stored in this database. No nick index and no restricted directory: a product owns both of those.
- validate_
account_ data_ content PUTaccount-data content must be a JSON object (Matrix’s own shape for every account-data type) withincrate::store::MATRIX_EVENT_CONTENT_MAX_BYTESonce serialized — same ceilingroutes::matrix::rooms::put_stateapplies to state-event content. Returns the serialized string ready to store.- validate_
filter_ definition - A Filter must be a JSON object within
FILTER_MAX_BYTESonce serialized — stored verbatim, opaque, interpreted only by a later/syncpiece. Returns the serialized string ready to store. - validate_
tag_ name - validate_
tag_ order order(P8 brief item 3): when present, must be in[0, 1].- whoami_
response GET /account/whoami’s wire shape: the caller’s own mxid and the device this credential resolved to (minting it on first use — see [auth::device_id_for]’s own doc). This is how a client with no/loginflow (this server has none — plan §1) learns its own device id.is_guestis alwaysfalse: this server has no guest accounts.- write_
tags