From 2750f29989a5a84a896fd3ea8bae9112de48203b Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 5 Mar 2019 09:30:36 +0000 Subject: [PATCH] We need to pass a user object to _privmsg --- modules/format_activity.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/format_activity.py b/modules/format_activity.py index ebc770b3..fbfc9f90 100644 --- a/modules/format_activity.py +++ b/modules/format_activity.py @@ -15,7 +15,7 @@ class Module(ModuleManager.BaseModule): symbols.append(server.prefix_modes[mode]) return "".join(symbols) - def _privmsg(self, event, channel, nickname): + def _privmsg(self, event, channel, user, nickname): symbols = "" if channel: symbols = self._mode_symbols(user, channel, event["server"]) @@ -28,11 +28,16 @@ class Module(ModuleManager.BaseModule): @utils.hook("send.message.channel") @utils.hook("received.message.channel") def channel_message(self, event): - nickname = event["server"].nickname - if "user" in event: + nickname = None + user = None + if "user" in event and event["user"]: + user = event["user"] nickname = event["user"].nickname + else: + nickname = event["server"].nickname + user = event["server"].get_user(nickname) - line = self._privmsg(event, event["channel"], nickname) + line = self._privmsg(event, event["channel"], user, nickname) self._event("message.channel", event["server"], line, event["channel"].name)