From 9e7f44374a65b4230dc3041f2130ad8f0f0c92f7 Mon Sep 17 00:00:00 2001 From: swee Date: Thu, 12 Dec 2024 13:19:48 -0800 Subject: [PATCH] Update server.py --- server.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index edd13eb..df796ab 100644 --- a/server.py +++ b/server.py @@ -191,7 +191,7 @@ def session(connection, client): if pending2[0] == ":": pending2[1:] if "!" in pending2 or ":" in pending2 or "#" in pending2 or "*" in pending2: connection.sendall(bytes(f":{server} 432 {pending} {pending2} :Erroneus nickname\r\n","UTF-8")) - elif pending.lower() in lower_nicks or pending in reserved: + elif pending2.lower() in lower_nicks or pending2 in reserved: connection.sendall(bytes(f":{server} 433 {pending} {pending2} :Nickname is already in use.\r\n","UTF-8")) else: # Broadcast the nickname change @@ -211,7 +211,10 @@ def session(connection, client): conection.sendall(bytes(f":{pending}!~{username}@{hostname} {text}\r\n","UTF-8")) property_list[pending2] = property_list.pop(pending) nickname_list[pending2] = nickname_list.pop(pending) + del lower_nicks[pending.lower()] + lower_nicks[pending2.lower()] = pending2 pending = pending2 + threading.Thread(target=pinger, args=[pending, connection]).start() print(f"User {pending} set nick") elif command == "PART": if len(args) == 0: