diff options
-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(); + } + } } } } |