aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Schink <xmpp-dev@marcschink.de>2017-12-05 21:47:29 +0100
committerAndroid Development <you@example.com>2017-12-07 17:33:09 +0100
commit9ca0c6372618402383dccbe1297306c7a75ba471 (patch)
tree0e587606994e03c02e389d3dca816536c847dbc3
parent704a32ce965fb0aff11c38e67a06baaaf4e426a5 (diff)
Handle xmpp message action URI without JID
-rw-r--r--src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
index b246130..9a5ec7f 100644
--- a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java
@@ -689,10 +689,8 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
Invite invite = new Invite(data);
if (xmppConnectionServiceBound) {
invite.invite();
- } else if (invite.getJid() != null) {
- this.mPendingInvite = invite;
} else {
- this.mPendingInvite = null;
+ this.mPendingInvite = invite;
}
}
} else if (resultCode == RESULT_OK) {
@@ -865,6 +863,15 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
return false;
}
+ private boolean handleShareMessage(Invite invite) {
+ Intent intent = new Intent(getApplicationContext(), ShareWithActivity.class);
+ intent.setAction(Intent.ACTION_SEND);
+ intent.setType("text/plain");
+ intent.putExtra(Intent.EXTRA_TEXT, invite.getBody());
+ startActivity(intent);
+ return true;
+ }
+
private boolean handleJid(Invite invite) {
Account account = xmppConnectionService.findAccountByJid(invite.getJid());
if (account != null && account.isEnabled()) {
@@ -1199,6 +1206,8 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
}
if (getJid() != null) {
return handleJid(this);
+ } else if (isMessage()) {
+ return handleShareMessage(this);
}
return false;
}
@@ -1206,5 +1215,9 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
public boolean isMuc() {
return muc;
}
+
+ public boolean isMessage() {
+ return message;
+ }
}
}