Try to fix logic

This commit is contained in:
Charles Descamps 2025-04-21 19:35:41 -07:00
parent 91e7b0ace8
commit fe4aa750fe

View file

@ -98,7 +98,7 @@ def handle_client(sock, client_address, socket_list, usernames, chat_rooms, clie
chat_room = chat_rooms.get(sock, "default")
send_message = f"{username} >> {message}".encode('utf-8')
for client_sock in socket_list:
if client_sock != sock and chat_rooms.get(client_sock) == chat_room:
if chat_rooms.get(client_sock) == chat_room:
try:
client_sock.send(send_message)
except Exception as e: