From 8fbf91a2f08e88f7dc797d4648b81c9f126928e6 Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 20 Jan 2020 13:42:36 +0000 Subject: [PATCH] show account and realname in JOIN formatting when available --- src/core_modules/format_activity.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/core_modules/format_activity.py b/src/core_modules/format_activity.py index 9360df08..90686a16 100644 --- a/src/core_modules/format_activity.py +++ b/src/core_modules/format_activity.py @@ -87,12 +87,22 @@ class Module(ModuleManager.BaseModule): def _on_join(self, event, user): channel_name = event["channel"].name + account = "" + if event["account"]: + account = " [{ACC}]" + realname = "" + if event["realname"]: + realname = " ({REAL})" + minimal = "{~NICK} joined {CHAN}" - line = "- {~NICK} ({UH}) joined {CHAN}" + line = "- {~NICK}%s%s ({UH}) joined {CHAN}" % (account, realname) + + formatting = {"UH": user.userhost(), "CHAN": event["channel"].name, + "ACC": event["account"], "REAL": event["realname"]} self._event("join", event["server"], line, event["channel"].name, channel=event["channel"], user=user, minimal=minimal, - formatting={"UH": user.userhost(), "CHAN": channel_name}) + formatting=formatting) @utils.hook("received.join") def join(self, event): self._on_join(event, event["user"])