diff options
author | Christian Schneppe <christian.schneppe@pix-art.de> | 2019-12-17 11:26:59 +0100 |
---|---|---|
committer | Christian Schneppe <christian.schneppe@pix-art.de> | 2019-12-17 11:26:59 +0100 |
commit | 5abd54f943aa7e47726c0e48a5e0d61f4b7dce72 (patch) | |
tree | 4ae1c982e6d947a3b4e7479106b97a449277b2e7 /src/main | |
parent | b8602852b77e2b0f9f52b7bcb4fc87040e02ef48 (diff) |
show nick for /me in 1:1 chats
fixes #421
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/de/pixart/messenger/utils/UIHelper.java | 14 |
1 files changed, 12 insertions, 2 deletions
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(); + } + } } } } |