From e745dae1dcb93fce6985643de29903479295f8d7 Mon Sep 17 00:00:00 2001 From: kosyak Date: Sun, 2 Jun 2024 20:31:20 +0200 Subject: [PATCH] properly show contact name in muc --- src/main/java/eu/siacs/conversations/utils/UIHelper.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/utils/UIHelper.java b/src/main/java/eu/siacs/conversations/utils/UIHelper.java index e22f55446..84e4002a6 100644 --- a/src/main/java/eu/siacs/conversations/utils/UIHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/UIHelper.java @@ -519,10 +519,14 @@ public class UIHelper { if (message.getStatus() == Message.STATUS_RECEIVED) { final Contact contact = message.getContact(); if (conversation.getMode() == Conversation.MODE_MULTI) { - if (contact != null) { + String mucCounterpart = getDisplayedMucCounterpart(message.getCounterpart()); + + if (!mucCounterpart.isEmpty()) { + return mucCounterpart; + } else if (contact != null) { return contact.getDisplayName(); } else { - return getDisplayedMucCounterpart(message.getCounterpart()); + return mucCounterpart; } } else { return contact != null ? contact.getDisplayName() : "";