diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-03-20 17:33:42 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-03-20 17:33:42 +0100 |
commit | 135c8567a566e2c12f98a578dcd606dfdf2b06bb (patch) | |
tree | 4ea6a42fe48a6248d5ee29208a06ce13179d104d | |
parent | ac09011690e2edacb2a0b2bfeb2b33b5943d2e68 (diff) |
show room nick for /me command in sent muc messages. fixes #1773
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/utils/UIHelper.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/UIHelper.java b/src/main/java/eu/siacs/conversations/utils/UIHelper.java index 8cae8117..add3d80c 100644 --- a/src/main/java/eu/siacs/conversations/utils/UIHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/UIHelper.java @@ -225,9 +225,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 { @@ -237,10 +238,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(); } } |