make enums fall back to unknown or null where possible

Futureproofing.
This commit is contained in:
Henry Hiles 2026-10-23 20:12:54 -04:00
commit 53d9c2b1e6
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
2 changed files with 28 additions and 6 deletions

View file

@ -240,6 +240,7 @@ class const EventRenderer(
.joined => "since joined",
.shared => "all history visible (shared)",
.worldReadable => "all history visible (world readable)",
.unknown => "something Nexus doesn't know about",
}}",
),
PinnedEventsContent(:final pinnedEvents) => () {

View file

@ -57,6 +57,7 @@ class const MembershipRenderer(
.leave => event.sender == event.stateKey ? "left" : (previous == .ban ? "was unbanned from" : "was kicked from"),
.ban => "was banned from",
.knock => "asked to join",
.unknown => "changed their membership in",
}} the room${event.sender == event.stateKey ? "" : " by"}",
),
if (event.sender != event.stateKey)