1 files changed, 13 insertions, 0 deletions
diff --git a/src/ui/RoomSettings.cpp b/src/ui/RoomSettings.cpp
index 42db1955..2d124e1e 100644
--- a/src/ui/RoomSettings.cpp
+++ b/src/ui/RoomSettings.cpp
@@ -78,6 +78,8 @@ RoomSettings::RoomSettings(QString roomid, QObject *parent)
accessRules_ = 3;
} else if (info_.join_rule == state::JoinRule::Restricted) {
accessRules_ = 4;
+ } else if (info_.join_rule == state::JoinRule::KnockRestricted) {
+ accessRules_ = 5;
}
emit accessJoinRulesChanged();
}
@@ -263,6 +265,14 @@ RoomSettings::supportsRestricted() const
info_.version != "3" && info_.version != "4" && info_.version != "5" &&
info_.version != "6" && info_.version != "7";
}
+bool
+RoomSettings::supportsKnockRestricted() const
+{
+ return info_.version != "" && info_.version != "1" && info_.version != "2" &&
+ info_.version != "3" && info_.version != "4" && info_.version != "5" &&
+ info_.version != "6" && info_.version != "7" && info_.version != "8" &&
+ info_.version != "9";
+}
void
RoomSettings::changeNotifications(int currentIndex)
@@ -349,6 +359,9 @@ RoomSettings::changeAccessRules(int index)
case 4:
event.join_rule = state::JoinRule::Restricted;
break;
+ case 5:
+ event.join_rule = state::JoinRule::KnockRestricted;
+ break;
default:
event.join_rule = state::JoinRule::Invite;
}
|