dont allow guests to publish to room directories
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
e146c75279
commit
a65dd6dfb3
1 changed files with 5 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
use axum::extract::State;
|
||||
use axum_client_ip::InsecureClientIp;
|
||||
use conduit::{err, info, warn, Error, Result};
|
||||
use conduit::{err, info, warn, Err, Error, Result};
|
||||
use ruma::{
|
||||
api::{
|
||||
client::{
|
||||
|
@ -124,6 +124,10 @@ pub(crate) async fn set_room_visibility_route(
|
|||
return Err(Error::BadRequest(ErrorKind::NotFound, "Room not found"));
|
||||
}
|
||||
|
||||
if services.users.is_deactivated(sender_user).unwrap_or(false) && body.appservice_info.is_none() {
|
||||
return Err!(Request(Forbidden("Guests cannot publish to room directories")));
|
||||
}
|
||||
|
||||
if !user_can_publish_room(&services, sender_user, &body.room_id)? {
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::forbidden(),
|
||||
|
|
Loading…
Add table
Reference in a new issue