aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-11-12 17:47:55 +0100
committerChristian Schneppe <christian@pix-art.de>2016-11-12 17:47:55 +0100
commitacc88b085cd3acd532af2c88475562bb03059308 (patch)
treeaaafa78895c9a7881da5009605b859ca44f6e141 /src/main/java/de/pixart/messenger
parent5edfff79f21c4003b08dc0d1a436c830303f4d91 (diff)
treat XmppUri not as text
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index 66e42060b..251e189c9 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -66,6 +66,7 @@ import de.pixart.messenger.ui.adapter.MessageAdapter.OnContactPictureLongClicked
import de.pixart.messenger.ui.widget.ListSelectionManager;
import de.pixart.messenger.utils.GeoHelper;
import de.pixart.messenger.utils.UIHelper;
+import de.pixart.messenger.utils.XmppUri;
import de.pixart.messenger.xmpp.XmppConnection;
import de.pixart.messenger.xmpp.chatstate.ChatState;
import de.pixart.messenger.xmpp.jid.Jid;
@@ -561,6 +562,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
MenuItem showErrorMessage = menu.findItem(R.id.show_error_message);
if (!treatAsFile
&& !GeoHelper.isGeoUri(m.getBody())
+ && !XmppUri.isXmppUri(m.getBody())
&& m.treatAsDownloadable() != Message.Decision.MUST) {
copyText.setVisible(true);
selectText.setVisible(ListSelectionManager.isSupported());
@@ -577,7 +579,9 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
&& m.getConversation().getMucOptions().nonanonymous())) {
correctMessage.setVisible(true);
}
- if (treatAsFile || (GeoHelper.isGeoUri(m.getBody()))) {
+ if (treatAsFile
+ || GeoHelper.isGeoUri(m.getBody())
+ || XmppUri.isXmppUri(m.getBody())) {
shareWith.setVisible(true);
}
if (m.getStatus() == Message.STATUS_SEND_FAILED) {
@@ -585,6 +589,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
}
if (m.hasFileOnRemoteHost()
|| GeoHelper.isGeoUri(m.getBody())
+ || XmppUri.isXmppUri(m.getBody())
|| m.treatAsDownloadable() == Message.Decision.MUST
|| (t != null && t instanceof HttpDownloadConnection)) {
copyUrl.setVisible(true);
@@ -740,8 +745,11 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
final String url;
final int resId;
if (GeoHelper.isGeoUri(message.getBody())) {
- resId = R.string.location;
- url = message.getBody();
+ resId = R.string.location;
+ url = message.getBody();
+ } else if (XmppUri.isXmppUri(message.getBody())) {
+ resId = R.string.contact;
+ url = message.getBody();
} else if (message.hasFileOnRemoteHost()) {
resId = R.string.file_url;
url = message.getFileParams().url.toString();