diff options
| author | 2019-03-05 09:52:38 +0000 | |
|---|---|---|
| committer | 2019-03-05 09:52:38 +0000 | |
| commit | 79930be7a32785a051391f1619b3e274c2d24178 (patch) | |
| tree | 4e40a34958a1104f9b5c8ef8f32690a265611677 /modules | |
| parent | _on_topic doesn't take an IRCChannel param (diff) | |
| signature | ||
private notices shouldn't be sent out as formatted.notice.channel
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/format_activity.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/modules/format_activity.py b/modules/format_activity.py index 699f662b..2e973296 100644 --- a/modules/format_activity.py +++ b/modules/format_activity.py @@ -42,21 +42,28 @@ class Module(ModuleManager.BaseModule): event["channel"].name) def _on_notice(self, event, sender, target): - line = "(notice->%s) <%s> %s" % ( - target, sender, event["message"]) + return "(notice->%s) <%s> %s" % (target, sender, event["message"]) + def _channel_notice(self, event, sender, channel): + line = self._on_notice(event, sender, channel.name) self._event("notice.channel", event["server"], line, None) + def _private_notice(self, event, sender, target): + line = self._on_notice(event, sender, target) + self._event("notice.private", event["server"], line, None) + @utils.hook("received.notice.channel", priority=EventManager.PRIORITY_HIGH) def channel_notice(self, event): - self._on_notice(event, event["user"].nickname, event["channel"].name) + self._channel_notice(event, event["user"].nickname, event["channel"]) @utils.hook("send.notice.channel") def self_notice_channel(self, event): - self._on_notice(event, event["server"].nickname, event["channel"].name) + self._channel_notice(event, event["server"].nickname, event["channel"]) @utils.hook("received.notice.private", priority=EventManager.PRIORITY_HIGH) def private_notice(self, event): - self._on_notice(event, event["user"].nickname, event["server"].nickname) + self._private_notice(event, event["user"].nickname, + event["server"].nickname) @utils.hook("send.notice.private") def self_private_notice(self, event): - self._on_notice(event, event["server"].nickname, event["user"].nickname) + self._private_notice(event, event["server"].nickname, + event["user"].nickname) def _on_join(self, event, nickname): line = "%s joined %s" % (nickname, event["channel"].name) |
