aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-04-23 20:15:40 +0200
committerChristian Schneppe <christian@pix-art.de>2018-04-23 20:15:40 +0200
commit7e02920f4550f088dd726501f2c3978e6010b726 (patch)
tree2068ddda76acef02e09f6990b032881aa8205dd7 /src/main/java/de
parentcd31daea233fa69b7322400dad7b3d6404cd889e (diff)
UriHandlerActivity: Always check for XMPP URI validity
Also check for XMPP URI validity if there are no configured accounts and the WelcomeActivity is active.
Diffstat (limited to 'src/main/java/de')
-rw-r--r--src/main/java/de/pixart/messenger/ui/UriHandlerActivity.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/UriHandlerActivity.java b/src/main/java/de/pixart/messenger/ui/UriHandlerActivity.java
index 51f91ab30..39aacd182 100644
--- a/src/main/java/de/pixart/messenger/ui/UriHandlerActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/UriHandlerActivity.java
@@ -84,6 +84,11 @@ public class UriHandlerActivity extends AppCompatActivity {
final XmppUri xmppUri = new XmppUri(uri);
final List<Jid> accounts = DatabaseBackend.getInstance(this).getAccountJids(); //TODO only look at enabled accounts
+ if (!xmppUri.isJidValid()) {
+ Toast.makeText(this, R.string.invalid_jid, Toast.LENGTH_SHORT).show();
+ return;
+ }
+
if (accounts.size() == 0) {
intent = new Intent(getApplicationContext(), WelcomeActivity.class);
WelcomeActivity.addInviteUri(intent, xmppUri);
@@ -111,15 +116,12 @@ public class UriHandlerActivity extends AppCompatActivity {
intent.putExtra("jid", xmppUri.getJid().asBareJid().toString());
intent.setData(uri);
intent.putExtra("scanned", scanned);
- } else if (xmppUri.isJidValid()) {
+ } else {
intent = new Intent(getApplicationContext(), StartConversationActivity.class);
intent.setAction(Intent.ACTION_VIEW);
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
intent.putExtra("scanned", scanned);
intent.setData(uri);
- } else {
- Toast.makeText(this, R.string.invalid_jid, Toast.LENGTH_SHORT).show();
- return;
}
startActivity(intent);