Merge pull request #808 from nyuszika7h/fix-who

Fix WHO clash with external plugins (e.g. ChanTracker)
This commit is contained in:
Valentin Lorentz 2014-08-05 12:00:31 +02:00
commit 0c6315afac
2 changed files with 9 additions and 3 deletions

View File

@ -205,7 +205,10 @@ class NickAuth(callbacks.Plugin):
ircdb.users.setUser(user, flush=False) ircdb.users.setUser(user, flush=False)
def do354(self, irc, msg): def do354(self, irc, msg):
(__, ident, host, nick, account) = msg.args if len(msg.args) != 6 or msg.args[1] != '1':
return
(__, ___, ident, host, nick, account) = msg.args
prefix = '%s!%s@%s' % (nick, ident, host) prefix = '%s!%s@%s' % (nick, ident, host)
user = ircdb.users.getUserFromNick(irc.network, account) user = ircdb.users.getUserFromNick(irc.network, account)

View File

@ -491,7 +491,10 @@ class IrcState(IrcCommandDispatcher):
def do354(self, irc, msg): def do354(self, irc, msg):
# WHOX reply. # WHOX reply.
(__, user, host, nick, ___) = msg.args if len(msg.args) != 6 or msg.args[1] != '1':
return
(__, ___, user, host, nick, ___) = msg.args
hostmask = '%s!%s@%s' % (nick, user, host) hostmask = '%s!%s@%s' % (nick, user, host)
self.nicksToHostmasks[nick] = hostmask self.nicksToHostmasks[nick] = hostmask
@ -1085,7 +1088,7 @@ class Irc(IrcCommandDispatcher):
def doJoin(self, msg): def doJoin(self, msg):
if msg.nick == self.nick: if msg.nick == self.nick:
channel = msg.args[0] channel = msg.args[0]
self.queueMsg(ircmsgs.who(channel, args=('%uhna',))) # Ends with 315. self.queueMsg(ircmsgs.who(channel, args=('%tuhna,1',))) # Ends with 315.
self.queueMsg(ircmsgs.mode(channel)) # Ends with 329. self.queueMsg(ircmsgs.mode(channel)) # Ends with 329.
for channel in msg.args[0].split(','): for channel in msg.args[0].split(','):
self.queueMsg(ircmsgs.mode(channel, '+b')) self.queueMsg(ircmsgs.mode(channel, '+b'))