summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Schäfer <j.wielicki@sotecware.net>2018-10-01 21:08:48 +0200
committerJonas Schäfer <j.wielicki@sotecware.net>2018-10-15 19:56:22 +0200
commit348aabc290850ef6c1b7f5a921b49272cbee85a8 (patch)
tree5e2a524f8974e298d3ba6ba6d7582d940e571957
parentd85ad57f1e7a2338e20176a4450732a3d52f2747 (diff)
downloadpoezio-348aabc290850ef6c1b7f5a921b49272cbee85a8.tar.gz
poezio-348aabc290850ef6c1b7f5a921b49272cbee85a8.tar.bz2
poezio-348aabc290850ef6c1b7f5a921b49272cbee85a8.tar.xz
poezio-348aabc290850ef6c1b7f5a921b49272cbee85a8.zip
XEP-0392/CCG: prefer JID over nickname
-rw-r--r--poezio/user.py6
1 files changed, 5 insertions, 1 deletions
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)