Tokenize IRC data as soon as it comes out of IRCServer

This commit is contained in:
jesopo 2019-05-09 10:36:33 +01:00
parent cb25f70418
commit f7eae1a978
2 changed files with 6 additions and 6 deletions

View file

@ -24,12 +24,11 @@ class Module(ModuleManager.BaseModule):
@utils.hook("raw.received") @utils.hook("raw.received")
def handle_raw(self, event): def handle_raw(self, event):
line = utils.irc.parse_line(event["line"]) if ("batch" in event["line"].tags and
if "batch" in line.tags and line.tags["batch"] in event[ event["line"].tags["batch"] in event["server"].batches):
"server"].batches: server.batches[tag["batch"]].lines.append(event["line"])
server.batches[tag["batch"]].lines.append(line)
else: else:
self._handle(event["server"], line) self._handle(event["server"], event["line"])
@utils.hook("raw.send") @utils.hook("raw.send")
def handle_send(self, event): def handle_send(self, event):

View file

@ -207,7 +207,8 @@ class Server(IRCObject.Object):
return return
self.bot.log.debug("%s (raw recv) | %s", [str(self), line]) self.bot.log.debug("%s (raw recv) | %s", [str(self), line])
self.events.on("raw.received").call_unsafe(server=self, line=line) self.events.on("raw.received").call_unsafe(server=self,
line=utils.irc.parse_line(line))
self.check_users() self.check_users()
def check_users(self): def check_users(self):
for user in self.new_users: for user in self.new_users: