aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Schink <xmpp-dev@marcschink.de>2017-12-07 22:23:47 +0100
committerAndroid Development <you@example.com>2017-12-09 12:32:19 +0100
commit26f85d73c9aa472207a9b19b9e08f27d2014f229 (patch)
tree4864e45304f146cb65bd66b29b94f0c3ef65f7bf
parent6c25b64561aec6f213eccb99ce482f535cb1d825 (diff)
Handle 'message action' xmpp URI with JID
-rw-r--r--src/main/java/eu/siacs/conversations/ui/XmppUriHandlerActivity.java20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/XmppUriHandlerActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppUriHandlerActivity.java
index e496bb1..6494756 100644
--- a/src/main/java/eu/siacs/conversations/ui/XmppUriHandlerActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/XmppUriHandlerActivity.java
@@ -5,6 +5,7 @@ import android.content.Intent;
import android.net.Uri;
import eu.siacs.conversations.utils.XmppUri;
+import eu.siacs.conversations.xmpp.jid.Jid;
public class XmppUriHandlerActivity extends Activity {
@@ -28,11 +29,20 @@ public class XmppUriHandlerActivity extends Activity {
final Intent intent;
final XmppUri xmppUri = new XmppUri(data.getData());
- if (xmppUri.getJid() == null && xmppUri.isMessage()) {
- intent = new Intent(getApplicationContext(), ShareWithActivity.class);
- intent.setAction(Intent.ACTION_SEND);
- intent.setType("text/plain");
- intent.putExtra(Intent.EXTRA_TEXT, xmppUri.getBody());
+ if (xmppUri.isMessage()) {
+ final Jid jid = xmppUri.getJid();
+ final String body = xmppUri.getBody();
+
+ if (jid != null) {
+ intent = new Intent(getApplicationContext(), ShareViaAccountActivity.class);
+ intent.putExtra(ShareViaAccountActivity.EXTRA_CONTACT, jid.toString());
+ intent.putExtra(ShareViaAccountActivity.EXTRA_BODY, body);
+ } else {
+ intent = new Intent(getApplicationContext(), ShareWithActivity.class);
+ intent.setAction(Intent.ACTION_SEND);
+ intent.setType("text/plain");
+ intent.putExtra(Intent.EXTRA_TEXT, body);
+ }
} else {
intent = new Intent(getApplicationContext(), StartConversationActivity.class);
intent.setAction(data.getAction());