From 3bd42230f21c2d93b096bde4e433653b2ac9ba09 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 26 Feb 2018 17:12:40 +0100 Subject: [PATCH] do not redirect to StarConversationActivity when scanning invalid jid --- .../java/eu/siacs/conversations/ui/UriHandlerActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/ui/UriHandlerActivity.java b/src/main/java/eu/siacs/conversations/ui/UriHandlerActivity.java index 1bbe7d238..04413a1b5 100644 --- a/src/main/java/eu/siacs/conversations/ui/UriHandlerActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/UriHandlerActivity.java @@ -104,11 +104,14 @@ public class UriHandlerActivity extends AppCompatActivity { intent.setAction(Intent.ACTION_VIEW); intent.putExtra("jid", xmppUri.getJid().toBareJid().toString()); intent.setData(uri); - } else { + } else if (xmppUri.isJidValid()){ intent = new Intent(getApplicationContext(), StartConversationActivity.class); intent.setAction(Intent.ACTION_VIEW); intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); intent.setData(uri); + } else { + Toast.makeText(this,R.string.invalid_jid,Toast.LENGTH_SHORT).show(); + return; } startActivity(intent);