Update who_end event parameter

This commit is contained in:
Vgr E. Barry 2017-01-13 11:57:16 -05:00
parent 0ca9e8cbdb
commit a620860cc5
2 changed files with 12 additions and 9 deletions

View File

@ -139,20 +139,23 @@ def end_who(cli, bot_server, bot_nick, target, rest):
4 - A string containing some information; traditionally "End of /WHO list."
This fires off the "who_end" event, and dispatches it with two
arguments: The game state namespace and a str of the request that
was originally sent.
arguments: The game state namespace and the channel or user the
request was made to, or None if it could not be resolved.
"""
try:
chan = channels.get(target)
target = channels.get(target)
except KeyError:
pass
try:
target = users._get(target) # FIXME
except KeyError:
target = None
else:
if chan._pending is not None:
for name, params, args in chan._pending:
if target._pending is not None:
for name, params, args in target._pending:
Event(name, params).dispatch(*args)
chan._pending = None
target._pending = None
Event("who_end", {}).dispatch(var, target)

View File

@ -155,7 +155,7 @@ def connect_callback():
signal.signal(SIGUSR2, sighandler)
def who_end(event, var, request):
if request == channels.Main.name:
if request is channels.Main:
if "WHOX" not in hooks.Features:
if not var.DISABLE_ACCOUNTS:
plog("IRCd does not support accounts, disabling account-related features.")
@ -6604,7 +6604,7 @@ def show_admins(cli, nick, chan, rest):
admins.append(user.nick) # FIXME
def admin_endwho(event, var, target):
if not var.ADMIN_PINGING or target != channels.Main.name:
if not var.ADMIN_PINGING or target is not channels.Main:
return
admins.sort(key=str.lower)