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.
Functions§
- 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_
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.
- 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. - refresh_
own_ badges - Fetch our own badges and persist to the per-account cache. Called once after initial sync. The SessionGuard straddles the network fetch so a mid-fetch account swap can’t write account A’s badge into account B’s DB.