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

View File

@ -155,7 +155,7 @@ def connect_callback():
signal.signal(SIGUSR2, sighandler) signal.signal(SIGUSR2, sighandler)
def who_end(event, var, request): def who_end(event, var, request):
if request == channels.Main.name: if request is channels.Main:
if "WHOX" not in hooks.Features: if "WHOX" not in hooks.Features:
if not var.DISABLE_ACCOUNTS: if not var.DISABLE_ACCOUNTS:
plog("IRCd does not support accounts, disabling account-related features.") 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 admins.append(user.nick) # FIXME
def admin_endwho(event, var, target): 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 return
admins.sort(key=str.lower) admins.sort(key=str.lower)