3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-01-12 05:02:33 +01:00

inspircd.nickClient: allow nick 0 to equal the target user's UID

This commit is contained in:
James Lu 2015-07-08 21:17:34 -07:00
parent 049b7f5049
commit 20772e5429

View File

@ -123,8 +123,10 @@ def nickClient(irc, numeric, newnick):
Changes the nick of a PyLink PseudoClient."""
if not utils.isInternalClient(irc, numeric):
raise LookupError('No such PyLink PseudoClient exists.')
if not utils.isNick(newnick):
raise ValueError('Invalid nickname %r.' % nick)
if newnick == '0':
newnick = numeric
elif not utils.isNick(newnick):
raise ValueError('Invalid nickname %r.' % newnick)
_sendFromUser(irc, numeric, 'NICK %s %s' % (newnick, int(time.time())))
irc.users[numeric].nick = newnick