aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/utils/UIHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/eu/siacs/conversations/utils/UIHelper.java')
-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() : "";