diff --git a/modules/format_activity.py b/modules/format_activity.py index 6ed6b8cc..1e7f540e 100644 --- a/modules/format_activity.py +++ b/modules/format_activity.py @@ -82,8 +82,10 @@ class Module(ModuleManager.BaseModule): event["user"].nickname) def _on_join(self, event, user): - line = "- %s joined %s" % (user.hostmask(), event["channel"].name) - minimal_line = "%s joined %s" % (user.nickname, event["channel"].name) + nickname = self._colorize(user.nickname) + hostmask = "%s!%s" % (nickname, user.userhost()) + line = "- %s joined %s" % (hostmask, event["channel"].name) + minimal_line = "%s joined %s" % (nickname, event["channel"].name) self._event("join", event["server"], line, event["channel"].name, channel=event["channel"], user=user, minimal=minimal_line) diff --git a/src/IRCUser.py b/src/IRCUser.py index 7e6d60ac..5195cfc0 100644 --- a/src/IRCUser.py +++ b/src/IRCUser.py @@ -36,6 +36,10 @@ class User(IRCObject.Object): if self.nickname and self.username and self.hostname: return "%s!%s@%s" % (self.nickname, self.username, self.hostname) return None + def userhost(self) -> typing.Optional[str]: + if self.username and self.hostname: + return "%s@%s" % (self.username, self.hostname) + return None def get_id(self)-> int: return (self.identified_account_id_override or