Skip to content

Commit

Permalink
fix(server): Only stream messages from the subscribed room
Browse files Browse the repository at this point in the history
  • Loading branch information
mxxntype committed May 20, 2024
1 parent dba6863 commit 090513a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/src/services/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,8 @@ impl proto::chat_server::Chat for Chat {
vec![]
});

if subscriber_rooms.contains(&message_room) {
// Check that the user is a member of the room and that he's subscribed to the rooms the message is from.
if subscriber_rooms.contains(&message_room) && subscribed_room == message_room {
use proto::serverside_room_event::Event;
let new_message = Event::NewMessage(msg.into());
let event = ServersideRoomEvent {
Expand Down

0 comments on commit 090513a

Please sign in to comment.