diff options
author | Christian S <christian@pix-art.de> | 2015-07-17 22:01:24 +0200 |
---|---|---|
committer | Christian S <christian@pix-art.de> | 2015-07-17 22:01:24 +0200 |
commit | 71c40c81b0fb02c31bc13b8b4ec35ecff30747f3 (patch) | |
tree | f6a81bdb50c8661385476ebbf2c6c581bc7ad00f /src/main/java/eu/siacs/conversations | |
parent | b1d01686f01b7a90aacd765e63df42e5ff962002 (diff) |
show contact name also in locations shared in MUCs
Diffstat (limited to 'src/main/java/eu/siacs/conversations')
-rw-r--r-- | src/main/java/eu/siacs/conversations/utils/GeoHelper.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/GeoHelper.java b/src/main/java/eu/siacs/conversations/utils/GeoHelper.java index 74f91a98b..cd97e1105 100644 --- a/src/main/java/eu/siacs/conversations/utils/GeoHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/GeoHelper.java @@ -9,6 +9,7 @@ import java.util.ArrayList; import java.util.regex.Matcher; import java.util.regex.Pattern; +import eu.siacs.conversations.entities.Contact; import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.entities.Message; @@ -40,6 +41,7 @@ public class GeoHelper { return intents; } final Conversation conversation = message.getConversation(); + final Contact contact = message.getContact(); String label; if (conversation.getMode() == Conversation.MODE_SINGLE && message.getStatus() == Message.STATUS_RECEIVED) { try { @@ -62,6 +64,16 @@ public class GeoHelper { else { locationPluginIntent.putExtra("jid",conversation.getAccount().getJid().toString()); } + } else { + if (message.getStatus() == Message.STATUS_RECEIVED) { + if (contact != null) { + locationPluginIntent.putExtra("name",contact.getDisplayName()); + } + locationPluginIntent.putExtra("jid",message.getCounterpart().toString()); + } + else { + locationPluginIntent.putExtra("jid",conversation.getAccount().getJid().toString()); + } } intents.add(locationPluginIntent); @@ -74,4 +86,4 @@ public class GeoHelper { intents.add(httpIntent); return intents; } -} +}
\ No newline at end of file |