Expand description
Profile badges — fetch, validate, and cache.
Badges are not loaded during the critical boot path. The cache is filled
once after initial sync (see refresh_own_badges) so badge-gated perks
(e.g. raised emoji-pack limits) resolve without an on-demand network
round-trip. has_vector_badge is the cheap synchronous reader used by
those gates.
Constants§
- NEW_
REACTIONS_ PER_ POST_ BY_ TIER - Per-effective-tier cap on NEW reaction groups one user may open on a single message. Joining an existing reaction (+1) is never gated — only introducing an emoji the message doesn’t yet carry spends this allowance.
Functions§
- bug_
hunter_ tier - Cached Bug Hunter tier (0-3) for the current account. Cheap + synchronous; 0 until the award fetch fills it.
- check_
new_ reaction_ allowance - Sender-side gate for reacting to
reference_idwithemoji: joining an existing group always passes; opening a new group checks the message-wide group ceiling, then the per-tier allowance. “Groups I opened” is judged by insertion order in our own view — the earliest held reaction per emoji.Ok(())when the send may proceed. - check_
v2026 - Someone’s V for Vector 2026, looked up on demand (a profile). Our own, when found, is held, as the post-sync refresh would.
- effective_
max_ new_ reactions_ per_ post - The current account’s fresh-reaction allowance per message.
- effective_
tier - The account’s effective premium tier (0-3): the highest its badges grant. V for Vector 2025 is full premium (3); 2026 grants what Bug Hunter’s first tier does (1). Per-account perks (emoji limits, pins, Text Effects) read this.
- fetch_
bug_ hunter_ tier - Highest non-revoked tier + whether a seen award was revoked, for displaying
another user’s badge. Our own status goes through
refresh_own_bug_hunter, which also catches revocation of a since-purged award. - has_
fawkes_ badge - Fetch + validate whether
pubkeyholds the V for Vector (Guy Fawkes 2025) badge: a kind-30078d=fawkes_2025claim published within the event window. - has_
text_ effects - Text Effects (coloured text, gradients, rainbows) are a perk of any badge: tier 1 and up. Others’ coloured messages always render; only sending colour is gated.
- has_
v2026_ badge - Fetch whether
pubkeyholds V for Vector 2026: its own kind-30078d=vector_2026claim, published inside the window. - has_
vector_ 2026_ badge - Cached: whether this account holds V for Vector 2026.
- has_
vector_ badge - Cached flag for whether we hold the Vector badge. Cheap + synchronous, so safe to call from limit checks. Defaults to false when unset — badge perks stay off until the cache is filled post-sync.
- is_bot
- max_
account_ tier - The highest effective tier across ALL accounts on this install. The multi-account cap is device-level (adding a profile spans accounts), so it must not drop when you switch to an un-badged account — unlike the per-account perks. Reads each account’s badge state straight from its vector.db.
- note_
own_ badge_ confirmed - Record the result of an on-demand badge check. When the checked key is our
own and the badge is present, persist it (sticky) and emit
badges_updatedso badge-gated perks (raised emoji-pack limits) turn on immediately — this is the safety net for a post-syncrefresh_own_badgesthat missed the claim (the holding relay is often flaky during the saturated sync window) and is now sitting in its multi-hour re-check cooldown. An on-demand check runs at a quiet moment, so it lands where the sync-time sweep didn’t. - own_
summary - This account’s badges and perk tier, for the UI.
- refresh_
own - Resolve the account’s badges once its sync has settled, on every login and on every client, then tell the UI. The relay holding a claim is often the one the sync just saturated.
- set_bot
- Run this process as a bot: every tiered perk at its top tier, and emoji packs uncapped (any number equipped, every emoji in each). Fixed protocol ceilings, like a message’s reaction groups and the 64 KB event, still apply.