Tokenize IRC data as soon as it comes out of IRCServer
This commit is contained in:
parent
cb25f70418
commit
f7eae1a978
2 changed files with 6 additions and 6 deletions
|
@ -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):
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue