more correct fallback for unknown join conditions
This commit is contained in:
parent
b390dbbbe1
commit
fcfe4eed1e
2 changed files with 5 additions and 0 deletions
|
|
@ -384,6 +384,8 @@ class RoomSettingsSectionsController(final String roomId)
|
||||||
)) {
|
)) {
|
||||||
(null, 0) => description,
|
(null, 0) => description,
|
||||||
(final alias?, 0) => alias,
|
(final alias?, 0) => alias,
|
||||||
|
(final alias?, 1) =>
|
||||||
|
"$alias and ${canonicalAlias.altAliases.first}",
|
||||||
(final alias?, final others) =>
|
(final alias?, final others) =>
|
||||||
"$alias and $others more",
|
"$alias and $others more",
|
||||||
(null, _) => canonicalAlias.altAliases.join(", "),
|
(null, _) => canonicalAlias.altAliases.join(", "),
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,8 @@ sealed class JoinRulesContent extends Content with _$JoinRulesContent {
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const AllowCondition({
|
class const AllowCondition({
|
||||||
final String? roomId,
|
final String? roomId,
|
||||||
|
|
||||||
|
@JsonKey(unknownEnumValue: AllowConditionType.unknown)
|
||||||
required final AllowConditionType type,
|
required final AllowConditionType type,
|
||||||
}) with _$AllowCondition {
|
}) with _$AllowCondition {
|
||||||
Map<String, Object?> toJson() => _$AllowConditionToJson(this);
|
Map<String, Object?> toJson() => _$AllowConditionToJson(this);
|
||||||
|
|
@ -32,4 +34,5 @@ class const AllowCondition({
|
||||||
enum AllowConditionType {
|
enum AllowConditionType {
|
||||||
@JsonValue("m.room_membership")
|
@JsonValue("m.room_membership")
|
||||||
membership,
|
membership,
|
||||||
|
unknown,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue