From 348aabc290850ef6c1b7f5a921b49272cbee85a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=A4fer?= Date: Mon, 1 Oct 2018 21:08:48 +0200 Subject: XEP-0392/CCG: prefer JID over nickname --- poezio/user.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'poezio/user.py') diff --git a/poezio/user.py b/poezio/user.py index 655eb0de..5d5d43c1 100644 --- a/poezio/user.py +++ b/poezio/user.py @@ -59,7 +59,11 @@ class User: theme = get_theme() if theme.ccg_palette: # use XEP-0392 CCG - fg_color = colors.ccg_text_to_color(theme.ccg_palette, self.nick) + if self.jid and self.jid.domain: + input_ = str(self.jid.bare) + else: + input_ = self.nick + fg_color = colors.ccg_text_to_color(theme.ccg_palette, input_) self.color = fg_color, -1 else: mod = len(theme.LIST_COLOR_NICKNAMES) -- cgit v1.2.3