pass ParsedLine on message and formatted.* message events
This commit is contained in:
parent
a783e71ad4
commit
0a302dfd21
3 changed files with 5 additions and 5 deletions
|
@ -42,19 +42,19 @@ class Module(ModuleManager.BaseModule):
|
||||||
line = self._privmsg(event, event["channel"], user, nickname)
|
line = self._privmsg(event, event["channel"], user, nickname)
|
||||||
self._event("message.channel", event["server"], line,
|
self._event("message.channel", event["server"], line,
|
||||||
event["channel"].name, channel=event["channel"], user=user,
|
event["channel"].name, channel=event["channel"], user=user,
|
||||||
from_self=event["from_self"])
|
parsed_line=event["line"])
|
||||||
|
|
||||||
def _on_notice(self, event, sender):
|
def _on_notice(self, event, sender):
|
||||||
return "(notice) <%s> %s" % (sender, event["message"])
|
return "(notice) <%s> %s" % (sender, event["message"])
|
||||||
def _channel_notice(self, event, sender, channel):
|
def _channel_notice(self, event, sender, channel):
|
||||||
line = self._on_notice(event, sender)
|
line = self._on_notice(event, sender)
|
||||||
self._event("notice.channel", event["server"], line,
|
self._event("notice.channel", event["server"], line,
|
||||||
event["channel"].name, from_self=event["from_self"])
|
event["channel"].name, parsed_line=event["line"])
|
||||||
|
|
||||||
def _private_notice(self, event, sender, target):
|
def _private_notice(self, event, sender, target):
|
||||||
line = self._on_notice(event, sender)
|
line = self._on_notice(event, sender)
|
||||||
self._event("notice.private", event["server"], line, None,
|
self._event("notice.private", event["server"], line, None,
|
||||||
from_self=event["from_self"])
|
parsed_line=event["line"])
|
||||||
|
|
||||||
@utils.hook("received.notice.channel", priority=EventManager.PRIORITY_HIGH)
|
@utils.hook("received.notice.channel", priority=EventManager.PRIORITY_HIGH)
|
||||||
def channel_notice(self, event):
|
def channel_notice(self, event):
|
||||||
|
|
|
@ -11,7 +11,7 @@ class Module(ModuleManager.BaseModule):
|
||||||
default_event = any(default_events)
|
default_event = any(default_events)
|
||||||
|
|
||||||
kwargs = {"command": line.command, "args": line.args, "tags": line.tags,
|
kwargs = {"command": line.command, "args": line.args, "tags": line.tags,
|
||||||
"server": server, "source": line.source,
|
"server": server, "source": line.source, "line": line,
|
||||||
"direction": utils.Direction.Recv}
|
"direction": utils.Direction.Recv}
|
||||||
|
|
||||||
self.events.on("raw.received").on(line.command).call_unsafe(**kwargs)
|
self.events.on("raw.received").on(line.command).call_unsafe(**kwargs)
|
||||||
|
|
|
@ -53,7 +53,7 @@ def message(events, event):
|
||||||
|
|
||||||
kwargs = {"server": event["server"], "target": target_obj,
|
kwargs = {"server": event["server"], "target": target_obj,
|
||||||
"target_str": target_str, "user": user, "tags": event["tags"],
|
"target_str": target_str, "user": user, "tags": event["tags"],
|
||||||
"is_channel": is_channel, "from_self": from_self}
|
"is_channel": is_channel, "from_self": from_self, "line": event["line"]}
|
||||||
|
|
||||||
action = False
|
action = False
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue