mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-17 15:13:02 +01:00
Fixed stupid nick-handling bugs
This commit is contained in:
parent
9808581d37
commit
0dbab5b0fc
@ -243,9 +243,9 @@ class Irc(object):
|
|||||||
|
|
||||||
Handles PING commands already.
|
Handles PING commands already.
|
||||||
"""
|
"""
|
||||||
_nickSetters = set(('001', '002', '003', '004', '250', '251', '252', '254',
|
_nickSetters = set('001', '002', '003', '004', '250', '251', '252', '254',
|
||||||
'255', '265', '266', '372', '375', '376', '333', '353',
|
'255', '265', '266', '372', '375', '376', '333', '353',
|
||||||
'332', '366'))
|
'332', '366')
|
||||||
def __init__(self, nick, user='', ident='', callbacks=None):
|
def __init__(self, nick, user='', ident='', callbacks=None):
|
||||||
world.ircs.append(self)
|
world.ircs.append(self)
|
||||||
self.nick = nick
|
self.nick = nick
|
||||||
@ -344,16 +344,17 @@ class Irc(object):
|
|||||||
if msg.command == 'NICK' and msg.nick == self.nick:
|
if msg.command == 'NICK' and msg.nick == self.nick:
|
||||||
if ircdb.users.hasUser(self.nick):
|
if ircdb.users.hasUser(self.nick):
|
||||||
ircdb.users.delUser(self.nick)
|
ircdb.users.delUser(self.nick)
|
||||||
self.nick = ircutils.nick(msg.args[0])
|
|
||||||
(nick, user, domain) = ircutils.splitHostmask(msg.prefix)
|
|
||||||
if ircdb.users.hasUser(self.prefix):
|
if ircdb.users.hasUser(self.prefix):
|
||||||
ircdb.users.delUser(self.prefix)
|
ircdb.users.delUser(self.prefix)
|
||||||
|
self.nick = ircutils.nick(msg.args[0])
|
||||||
|
(nick, user, domain) = ircutils.splitHostmask(msg.prefix)
|
||||||
self.prefix = '%s!%s@%s' % (self.nick, user, domain)
|
self.prefix = '%s!%s@%s' % (self.nick, user, domain)
|
||||||
elif msg.command in self._nickSetters:
|
elif msg.command in self._nickSetters:
|
||||||
|
#debug.printf('msg.command in self._nickSetters')
|
||||||
newnick = ircutils.nick(msg.args[0])
|
newnick = ircutils.nick(msg.args[0])
|
||||||
if self.nick != newnick:
|
if self.nick != newnick:
|
||||||
debug.printf('Hmm...self.nick != newnick. Odd.')
|
debug.printf('Hmm...self.nick != newnick. Odd.')
|
||||||
self.nick = newnick
|
self.nick = newnick
|
||||||
# Respond to PING requests.
|
# Respond to PING requests.
|
||||||
elif msg.command == 'PING':
|
elif msg.command == 'PING':
|
||||||
self.sendMsg(ircmsgs.pong(msg.args[0]))
|
self.sendMsg(ircmsgs.pong(msg.args[0]))
|
||||||
|
Loading…
Reference in New Issue
Block a user