aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/utils/GeoHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/eu/siacs/conversations/utils/GeoHelper.java')
-rw-r--r--src/main/java/eu/siacs/conversations/utils/GeoHelper.java14
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