From f671621bd36f940f27c7c3057f71f669af6d7c5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Ro=C5=BCnawski?= <48837433+roznawsk@users.noreply.github.com> Date: Wed, 31 Jan 2024 16:01:18 +0100 Subject: [PATCH] Fix (#146) --- lib/jellyfish/room.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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