aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main/java/eu/siacs/conversations/utils/UIHelper.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/UIHelper.java b/src/main/java/eu/siacs/conversations/utils/UIHelper.java
index b918c0834..c44593615 100644
--- a/src/main/java/eu/siacs/conversations/utils/UIHelper.java
+++ b/src/main/java/eu/siacs/conversations/utils/UIHelper.java
@@ -221,15 +221,14 @@ public class UIHelper {
public static String getMessageDisplayName(final Message message) {
if (message.getStatus() == Message.STATUS_RECEIVED) {
+ final Contact contact = message.getContact();
if (message.getConversation().getMode() == Conversation.MODE_MULTI) {
- final Contact contact = message.getContact();
- if (message.getContact() != null) {
- return contact != null ? contact.getDisplayName() : "";
+ if (contact != null) {
+ return contact.getDisplayName();
} else {
return getDisplayedMucCounterpart(message.getCounterpart());
}
} else {
- final Contact contact = message.getContact();
return contact != null ? contact.getDisplayName() : "";
}
} else {
@@ -262,4 +261,4 @@ public class UIHelper {
body = body.replace("?","").replace("¿","");
return LOCATION_QUESTIONS.contains(body);
}
-}
+} \ No newline at end of file