diff --git a/lib/jellyfish/room.ex b/lib/jellyfish/room.ex index 658d003a..d4ef81b9 100644 --- a/lib/jellyfish/room.ex +++ b/lib/jellyfish/room.ex @@ -231,7 +231,9 @@ defmodule Jellyfish.Room do do: send(peer.socket_pid, {:stop_connection, :peer_removed}) Logger.info("Removed peer #{inspect(peer_id)} from room #{inspect(state.id)}") - Event.broadcast_server_notification({:peer_disconnected, state.id, peer_id}) + + if peer.status == :connected, + do: Event.broadcast_server_notification({:peer_disconnected, state.id, peer_id}) {:ok, state} else