only check missed modes if our mode changes and MODE #chan
responds
This commit is contained in:
parent
cded6b6877
commit
ef2d80511d
5 changed files with 3 additions and 15 deletions
|
@ -22,7 +22,7 @@ class Channel(IRCObject.Object):
|
|||
self.user_modes = {} # type: typing.Dict[IRCUser.User, typing.Set]
|
||||
self.created_timestamp = None
|
||||
self.buffer = IRCBuffer.Buffer(bot, server)
|
||||
self.seen_who = False
|
||||
self.seen_modes = False
|
||||
|
||||
self._setting_cache_prefix = "channelsetting%s-" % self.id
|
||||
|
||||
|
|
|
@ -225,11 +225,6 @@ class Module(ModuleManager.BaseModule):
|
|||
def handle_354(self, event):
|
||||
core.handle_354(self.events, event)
|
||||
|
||||
# RPLENDOFWHO
|
||||
@utils.hook("raw.received.315")
|
||||
def handle_315(self, event):
|
||||
core.handle_315(self.events, event)
|
||||
|
||||
# response to an empty mode command
|
||||
@utils.hook("raw.received.324")
|
||||
def handle_324(self, event):
|
||||
|
|
|
@ -115,6 +115,7 @@ def part(events, event):
|
|||
def handle_324(events, event):
|
||||
if event["line"].args[1] in event["server"].channels:
|
||||
channel = event["server"].channels.get(event["line"].args[1])
|
||||
channel.seen_modes = True
|
||||
modes = event["line"].args[2]
|
||||
args = event["line"].args[3:]
|
||||
new_modes = channel.parse_modes(modes, args[:])
|
||||
|
|
|
@ -150,14 +150,6 @@ def handle_354(events, event):
|
|||
events.on("received.whox").call(server=event["server"],
|
||||
user=target)
|
||||
|
||||
def handle_315(events, event):
|
||||
target = event["line"].args[1]
|
||||
if target in event["server"].channels:
|
||||
channel = event["server"].channels.get(target)
|
||||
events.on("received.endofwho").call(server=event["server"],
|
||||
channel=channel)
|
||||
channel.seen_who = True
|
||||
|
||||
def _nick_in_use(server):
|
||||
new_nick = "%s|" % server.connection_params.nickname
|
||||
server.send_nick(new_nick)
|
||||
|
|
|
@ -77,7 +77,7 @@ class Module(ModuleManager.BaseModule):
|
|||
self._mask_remove(event["channel"], mode[1], arg)
|
||||
elif mode[1] in dict(event["server"].prefix_modes):
|
||||
if (event["server"].irc_equals(event["server"].nickname, arg)
|
||||
and event["channel"].seen_who):
|
||||
and event["channel"].seen_modes):
|
||||
self._query_lists(event["server"], event["channel"])
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue