aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/utils/UIHelper.java
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2016-03-25 20:13:51 +0100
committerlookshe <github@lookshe.org>2016-03-25 20:13:51 +0100
commit711ab9f2b1b625373a7046774c7b78e59f826589 (patch)
treeadbfec9c7f9cac33351b1b09c4f5057c6ef674b5 /src/main/java/de/thedevstack/conversationsplus/utils/UIHelper.java
parentd25ab854dae2be0d5286d46b5038494d503dd367 (diff)
parent27c16b4b9acaad33b36145d63f6bfd7e04a3b3f1 (diff)
Merge branch 'trz/rebase' into trz/rename
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/utils/UIHelper.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/utils/UIHelper.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/utils/UIHelper.java b/src/main/java/de/thedevstack/conversationsplus/utils/UIHelper.java
index 2c43e86f..1c142dad 100644
--- a/src/main/java/de/thedevstack/conversationsplus/utils/UIHelper.java
+++ b/src/main/java/de/thedevstack/conversationsplus/utils/UIHelper.java
@@ -220,9 +220,10 @@ public class UIHelper {
}
public static String getMessageDisplayName(final Message message) {
+ final Conversation conversation = message.getConversation();
if (message.getStatus() == Message.STATUS_RECEIVED) {
final Contact contact = message.getContact();
- if (message.getConversation().getMode() == Conversation.MODE_MULTI) {
+ if (conversation.getMode() == Conversation.MODE_MULTI) {
if (contact != null) {
return contact.getDisplayName();
} else {
@@ -232,10 +233,10 @@ public class UIHelper {
return contact != null ? contact.getDisplayName() : "";
}
} else {
- if (message.getConversation().getMode() == Conversation.MODE_MULTI) {
- return getDisplayedMucCounterpart(message.getConversation().getJid());
+ if (conversation.getMode() == Conversation.MODE_MULTI) {
+ return conversation.getMucOptions().getSelf().getName();
} else {
- final Jid jid = message.getConversation().getAccount().getJid();
+ final Jid jid = conversation.getAccount().getJid();
return jid.hasLocalpart() ? jid.getLocalpart() : jid.toDomainJid().toString();
}
}