From 05af6127296d28004d961698e2cb17e9c45c4763 Mon Sep 17 00:00:00 2001 From: "Christian S." Date: Sun, 5 Jul 2015 17:04:19 +0200 Subject: show nicknames in MUCs instead of the user part of the JID --- src/main/java/eu/siacs/conversations/utils/UIHelper.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/java/eu/siacs/conversations') 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() : ""; -- cgit v1.2.3