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")
def handle_raw(self, event):
line = utils.irc.parse_line(event["line"])
if "batch" in line.tags and line.tags["batch"] in event[
"server"].batches:
server.batches[tag["batch"]].lines.append(line)
if ("batch" in event["line"].tags and
event["line"].tags["batch"] in event["server"].batches):
server.batches[tag["batch"]].lines.append(event["line"])
else:
self._handle(event["server"], line)
self._handle(event["server"], event["line"])
@utils.hook("raw.send")
def handle_send(self, event):

View file

@ -207,7 +207,8 @@ class Server(IRCObject.Object):
return
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()
def check_users(self):
for user in self.new_users: