show account and realname in JOIN formatting when available
This commit is contained in:
parent
f4a001152a
commit
8fbf91a2f0
1 changed files with 12 additions and 2 deletions
|
@ -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"])
|
||||
|
|
Loading…
Reference in a new issue