summaryrefslogtreecommitdiff
path: root/src/api/server_server.rs
diff options
context:
space:
mode:
authorTimo Kösters <timo@koesters.xyz>2022-10-11 11:53:13 +0200
committerTimo Kösters <timo@koesters.xyz>2022-10-11 11:53:13 +0200
commitc30cc6120b31e8d631bfe8c988d399c120c638c3 (patch)
tree1041e776da76887017e4fb1734d3271683af6a53 /src/api/server_server.rs
parent2b7c19835b65e4dd3a6a32466a9f45b06bf1ced2 (diff)
downloadconduit-c30cc6120b31e8d631bfe8c988d399c120c638c3.zip
fix: send right errors on make/send join in restricted rooms
Diffstat (limited to 'src/api/server_server.rs')
-rw-r--r--src/api/server_server.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/api/server_server.rs b/src/api/server_server.rs
index 3750598..c9f6a78 100644
--- a/src/api/server_server.rs
+++ b/src/api/server_server.rs
@@ -1283,10 +1283,10 @@ pub async fn create_join_event_template_route(
if let Some(join_rules_event_content) = join_rules_event_content {
if matches!(
join_rules_event_content.join_rule,
- JoinRule::Restricted { .. }
+ JoinRule::Restricted { .. } | JoinRule::KnockRestricted { .. }
) {
return Err(Error::BadRequest(
- ErrorKind::Unknown,
+ ErrorKind::UnableToAuthorizeJoin,
"Conduit does not support restricted rooms yet.",
));
}
@@ -1376,10 +1376,10 @@ async fn create_join_event(
if let Some(join_rules_event_content) = join_rules_event_content {
if matches!(
join_rules_event_content.join_rule,
- JoinRule::Restricted { .. }
+ JoinRule::Restricted { .. } | JoinRule::KnockRestricted { .. }
) {
return Err(Error::BadRequest(
- ErrorKind::Unknown,
+ ErrorKind::UnableToAuthorizeJoin,
"Conduit does not support restricted rooms yet.",
));
}