Browse Source

Only allow specifying a nick when the nick is not yet in use

master
Sven Slootweg 10 years ago
parent
commit
d9d23ce2c0
  1. 9
      ircd.py

9
ircd.py

@ -174,9 +174,12 @@ class user:
self.client.send_numeric("461", "%s USER :Not enough parameters." % self.nickname)
elif data[0] == "NICK":
if len(data) >= 2:
self.nickname = data[1]
self.registered_nick = True
self.verify_registration()
if data[1] not in self.server.users:
self.nickname = data[1]
self.registered_nick = True
self.verify_registration()
else:
self.client.send_numeric("433", "%s %s :Nickname is already in use." % (self.nickname, data[1]))
else:
self.client.send_numeric("461", "%s NICK :Not enough parameters." % self.nickname)
elif self.registered == 2 and data[0] == "PONG":

Loading…
Cancel
Save