From fcfe4eed1ecacd0e8ebd4f6502a81bb085e21237 Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Thu, 22 Oct 2026 14:32:58 -0400 Subject: [PATCH] more correct fallback for unknown join conditions --- lib/controllers/room_settings_sections.dart | 2 ++ lib/models/content/join_rules.dart | 3 +++ 2 files changed, 5 insertions(+) diff --git a/lib/controllers/room_settings_sections.dart b/lib/controllers/room_settings_sections.dart index 33a3d4a..b847e55 100644 --- a/lib/controllers/room_settings_sections.dart +++ b/lib/controllers/room_settings_sections.dart @@ -384,6 +384,8 @@ class RoomSettingsSectionsController(final String roomId) )) { (null, 0) => description, (final alias?, 0) => alias, + (final alias?, 1) => + "$alias and ${canonicalAlias.altAliases.first}", (final alias?, final others) => "$alias and $others more", (null, _) => canonicalAlias.altAliases.join(", "), diff --git a/lib/models/content/join_rules.dart b/lib/models/content/join_rules.dart index 8062657..948a762 100644 --- a/lib/models/content/join_rules.dart +++ b/lib/models/content/join_rules.dart @@ -21,6 +21,8 @@ sealed class JoinRulesContent extends Content with _$JoinRulesContent { @JsonSerializable() class const AllowCondition({ final String? roomId, + + @JsonKey(unknownEnumValue: AllowConditionType.unknown) required final AllowConditionType type, }) with _$AllowCondition { Map toJson() => _$AllowConditionToJson(this); @@ -32,4 +34,5 @@ class const AllowCondition({ enum AllowConditionType { @JsonValue("m.room_membership") membership, + unknown, }