aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations
diff options
context:
space:
mode:
authorChristian S. <kriztan@users.noreply.github.com>2015-07-05 17:04:19 +0200
committerChristian S. <kriztan@users.noreply.github.com>2015-07-05 17:04:19 +0200
commit05af6127296d28004d961698e2cb17e9c45c4763 (patch)
tree60e43f2fe9d1782c31899bbcb73697020864e4f8 /src/main/java/eu/siacs/conversations
parent0f8529d9f7e3680306ac13bc6bd46ee71bfee6c8 (diff)
show nicknames in MUCs instead of the user part of the JID
Diffstat (limited to 'src/main/java/eu/siacs/conversations')
-rw-r--r--src/main/java/eu/siacs/conversations/utils/UIHelper.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/UIHelper.java b/src/main/java/eu/siacs/conversations/utils/UIHelper.java
index 19a8653f6..b918c0834 100644
--- a/src/main/java/eu/siacs/conversations/utils/UIHelper.java
+++ b/src/main/java/eu/siacs/conversations/utils/UIHelper.java
@@ -222,7 +222,12 @@ public class UIHelper {
public static String getMessageDisplayName(final Message message) {
if (message.getStatus() == Message.STATUS_RECEIVED) {
if (message.getConversation().getMode() == Conversation.MODE_MULTI) {
- return getDisplayedMucCounterpart(message.getCounterpart());
+ final Contact contact = message.getContact();
+ if (message.getContact() != null) {
+ return contact != null ? contact.getDisplayName() : "";
+ } else {
+ return getDisplayedMucCounterpart(message.getCounterpart());
+ }
} else {
final Contact contact = message.getContact();
return contact != null ? contact.getDisplayName() : "";