mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-27 19:22:15 -05:00
include name in locations received in MUCs
This commit is contained in:
parent
a25912c32c
commit
c9e9dc2ef2
@ -9,6 +9,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import eu.siacs.conversations.entities.Contact;
|
||||||
import eu.siacs.conversations.entities.Conversation;
|
import eu.siacs.conversations.entities.Conversation;
|
||||||
import eu.siacs.conversations.entities.Message;
|
import eu.siacs.conversations.entities.Message;
|
||||||
|
|
||||||
@ -54,13 +55,16 @@ public class GeoHelper {
|
|||||||
Intent locationPluginIntent = new Intent("eu.siacs.conversations.location.show");
|
Intent locationPluginIntent = new Intent("eu.siacs.conversations.location.show");
|
||||||
locationPluginIntent.putExtra("latitude",latitude);
|
locationPluginIntent.putExtra("latitude",latitude);
|
||||||
locationPluginIntent.putExtra("longitude",longitude);
|
locationPluginIntent.putExtra("longitude",longitude);
|
||||||
if (conversation.getMode() == Conversation.MODE_SINGLE) {
|
if (message.getStatus() != Message.STATUS_RECEIVED) {
|
||||||
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());
|
locationPluginIntent.putExtra("jid",conversation.getAccount().getJid().toString());
|
||||||
|
locationPluginIntent.putExtra("name",conversation.getAccount().getJid().getLocalpart());
|
||||||
|
} else {
|
||||||
|
Contact contact = message.getContact();
|
||||||
|
if (contact != null) {
|
||||||
|
locationPluginIntent.putExtra("name", contact.getDisplayName());
|
||||||
|
locationPluginIntent.putExtra("jid", contact.getJid().toString());
|
||||||
|
} else {
|
||||||
|
locationPluginIntent.putExtra("name", UIHelper.getDisplayedMucCounterpart(message.getCounterpart()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
intents.add(locationPluginIntent);
|
intents.add(locationPluginIntent);
|
||||||
|
@ -249,7 +249,7 @@ public class UIHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getDisplayedMucCounterpart(final Jid counterpart) {
|
public static String getDisplayedMucCounterpart(final Jid counterpart) {
|
||||||
if (counterpart==null) {
|
if (counterpart==null) {
|
||||||
return "";
|
return "";
|
||||||
} else if (!counterpart.isBareJid()) {
|
} else if (!counterpart.isBareJid()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user