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.java16
1 files changed, 15 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..aa9b2e50f 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 {
@@ -60,6 +62,18 @@ public class GeoHelper {
locationPluginIntent.putExtra("jid",message.getCounterpart().toString());
}
else {
+ locationPluginIntent.putExtra("name", conversation.getAccount().getUsername());
+ 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("name", conversation.getAccount().getUsername());
locationPluginIntent.putExtra("jid",conversation.getAccount().getJid().toString());
}
}
@@ -74,4 +88,4 @@ public class GeoHelper {
intents.add(httpIntent);
return intents;
}
-}
+} \ No newline at end of file