From 5abd54f943aa7e47726c0e48a5e0d61f4b7dce72 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Tue, 17 Dec 2019 11:26:59 +0100 Subject: show nick for /me in 1:1 chats fixes #421 --- src/main/java/de/pixart/messenger/utils/UIHelper.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/java/de/pixart/messenger/utils/UIHelper.java b/src/main/java/de/pixart/messenger/utils/UIHelper.java index f34952e1d..dcbe51b53 100644 --- a/src/main/java/de/pixart/messenger/utils/UIHelper.java +++ b/src/main/java/de/pixart/messenger/utils/UIHelper.java @@ -517,8 +517,18 @@ public class UIHelper { if (conversation instanceof Conversation && conversation.getMode() == Conversation.MODE_MULTI) { return ((Conversation) conversation).getMucOptions().getSelf().getName(); } else { - final Jid jid = conversation.getAccount().getJid(); - return jid.getLocal() != null ? jid.getLocal() : Jid.ofDomain(jid.getDomain()).toString(); + final Account account = conversation.getAccount(); + final Jid jid = account.getJid(); + final String displayName = account.getDisplayName(); + if (displayName != null ) { + return displayName; + } else { + if (jid.getLocal() != null) { + return jid.getLocal(); + } else { + return Jid.ofDomain(jid.getDomain()).toString(); + } + } } } } -- cgit v1.2.3