check if specified user belongs to us

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-02-28 12:40:26 -05:00 committed by June
parent 5a8abaa54d
commit abf41f4c79

View file

@ -1009,6 +1009,12 @@ impl Service {
} }
} }
UserCommand::ListJoinedRooms { user_id } => { UserCommand::ListJoinedRooms { user_id } => {
if user_id.server_name() != services().globals.server_name() {
return Ok(RoomMessageEventContent::text_plain(
"User does not belong to our server.",
));
}
let mut rooms: Vec<(OwnedRoomId, u64, String)> = vec![]; // room ID, members joined, room name let mut rooms: Vec<(OwnedRoomId, u64, String)> = vec![]; // room ID, members joined, room name
for room_id in services().rooms.state_cache.rooms_joined(&user_id) { for room_id in services().rooms.state_cache.rooms_joined(&user_id) {