aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/utils/GeoHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/utils/GeoHelper.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/utils/GeoHelper.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/utils/GeoHelper.java b/src/main/java/de/thedevstack/conversationsplus/utils/GeoHelper.java
index 87c16f8c..662f797a 100644
--- a/src/main/java/de/thedevstack/conversationsplus/utils/GeoHelper.java
+++ b/src/main/java/de/thedevstack/conversationsplus/utils/GeoHelper.java
@@ -20,7 +20,7 @@ public class GeoHelper {
}
public static ArrayList<Intent> createGeoIntentsFromMessage(Message message) {
- final ArrayList<Intent> intents = new ArrayList();
+ final ArrayList<Intent> intents = new ArrayList<>();
Matcher matcher = GEO_URI.matcher(message.getBody());
if (!matcher.matches()) {
return intents;
@@ -54,8 +54,14 @@ public class GeoHelper {
Intent locationPluginIntent = new Intent("eu.siacs.conversations.location.show");
locationPluginIntent.putExtra("latitude",latitude);
locationPluginIntent.putExtra("longitude",longitude);
- if (conversation.getMode() == Conversation.MODE_SINGLE && message.getStatus() == Message.STATUS_RECEIVED) {
- locationPluginIntent.putExtra("name",conversation.getName());
+ if (conversation.getMode() == Conversation.MODE_SINGLE) {
+ if (message.getStatus() == Message.STATUS_RECEIVED) {
+ locationPluginIntent.putExtra("name",conversation.getName());
+ locationPluginIntent.putExtra("jid",message.getCounterpart().toString());
+ }
+ else {
+ locationPluginIntent.putExtra("jid",conversation.getAccount().getJid().toString());
+ }
}
intents.add(locationPluginIntent);