Revert service storing and properly fix /mode handling issue
This commit is contained in:
parent
33051ae617
commit
ae4c342bd3
@ -216,7 +216,7 @@ class Channel(IRCContext):
|
||||
elif c in list_modes: # stuff like bans, quiets, and ban and invite exempts
|
||||
if c not in self.modes:
|
||||
self.modes[c] = {}
|
||||
self.modes[c][targets[i]] = (actor.rawnick, set_time)
|
||||
self.modes[c][targets[i]] = ((actor.rawnick if actor is not None else None), set_time)
|
||||
i += 1
|
||||
|
||||
else:
|
||||
|
@ -161,9 +161,6 @@ def connect_callback(cli):
|
||||
channels.Main = channels.add(botconfig.CHANNEL, cli)
|
||||
channels.Dummy = channels.add("*", cli)
|
||||
|
||||
context._who(cli, "ChanServ")
|
||||
context._who(cli, "NickServ")
|
||||
|
||||
if botconfig.ALT_CHANNELS:
|
||||
for chan in botconfig.ALT_CHANNELS.split(","):
|
||||
channels.add(chan, cli)
|
||||
|
10
src/hooks.py
10
src/hooks.py
@ -50,7 +50,7 @@ def who_reply(cli, bot_server, bot_nick, chan, ident, host, server, nick, status
|
||||
if "serv" in nick.lower():
|
||||
ch = channels.Dummy
|
||||
else:
|
||||
ch = channels.add(chan, cli)
|
||||
ch = channels.add(chan, cli)
|
||||
|
||||
if ch not in user.channels:
|
||||
user.channels[ch] = modes
|
||||
@ -63,7 +63,7 @@ def who_reply(cli, bot_server, bot_nick, chan, ident, host, server, nick, status
|
||||
event = Event("who_result", {}, away=is_away, data=0, ip_address=None, server=server, hop_count=hop, idle_time=None, extended_who=False)
|
||||
event.dispatch(var, ch, user)
|
||||
|
||||
if ch is channels.Main and not users.exists(nick) and ch is not channels.Dummy: # FIXME
|
||||
if ch is channels.Main and not users.exists(nick): # FIXME
|
||||
users.add(nick, ident=ident, host=host, account="*", inchan=True, modes=modes, moded=set())
|
||||
|
||||
@hook("whospcrpl")
|
||||
@ -116,7 +116,7 @@ def extended_who_reply(cli, bot_server, bot_nick, data, chan, ident, ip_address,
|
||||
if "serv" in nick.lower():
|
||||
ch = channels.Dummy
|
||||
else:
|
||||
ch = channels.add(chan, cli)
|
||||
ch = channels.add(chan, cli)
|
||||
|
||||
if ch not in user.channels:
|
||||
user.channels[ch] = modes
|
||||
@ -129,7 +129,7 @@ def extended_who_reply(cli, bot_server, bot_nick, data, chan, ident, ip_address,
|
||||
event = Event("who_result", {}, away=is_away, data=data, ip_address=ip_address, server=server, hop_count=hop, idle_time=idle, extended_who=True)
|
||||
event.dispatch(var, ch, user)
|
||||
|
||||
if ch is channels.Main and not users.exists(nick) and ch is not channels.Dummy: # FIXME
|
||||
if ch is channels.Main and not users.exists(nick): # FIXME
|
||||
users.add(nick, ident=ident, host=host, account=account, inchan=True, modes=modes, moded=set())
|
||||
|
||||
@hook("endofwho")
|
||||
@ -335,7 +335,7 @@ def mode_change(cli, rawnick, chan, mode, *targets):
|
||||
evt.dispatch(var)
|
||||
return
|
||||
|
||||
actor = users._get(rawnick) # FIXME
|
||||
actor = users._get(rawnick, allow_none=True) # FIXME
|
||||
target = channels.add(chan, cli)
|
||||
target.queue("mode_change", {"mode": mode, "targets": targets}, (var, actor, target))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user