aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-04-08 13:58:10 +0200
committerChristian Schneppe <christian@pix-art.de>2018-04-08 13:58:10 +0200
commitc06987e4a0cca0469bdf0e55ff9e2c2a06f317b4 (patch)
tree68087736d93c3bf2758cda2c6d08c292db6ea571 /src/main
parent03b5ebfd7c9749d5a49f799e64742740e6dba7ad (diff)
scanned results are always a trusted source
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/de/pixart/messenger/ui/StartConversationActivity.java2
-rw-r--r--src/main/java/de/pixart/messenger/ui/UriHandlerActivity.java7
2 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
index deff3b11c..1e58f88e5 100644
--- a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
@@ -832,7 +832,7 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
case Intent.ACTION_VIEW:
Uri uri = intent.getData();
if (uri != null) {
- Invite invite = new Invite(intent.getData(), false);
+ Invite invite = new Invite(intent.getData(), intent.getBooleanExtra("scanned", false));
invite.account = intent.getStringExtra("account");
return invite.invite();
} else {
diff --git a/src/main/java/de/pixart/messenger/ui/UriHandlerActivity.java b/src/main/java/de/pixart/messenger/ui/UriHandlerActivity.java
index dea4f3194..b2d7e1064 100644
--- a/src/main/java/de/pixart/messenger/ui/UriHandlerActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/UriHandlerActivity.java
@@ -74,6 +74,10 @@ public class UriHandlerActivity extends AppCompatActivity {
}
private void handleUri(Uri uri) {
+ handleUri(uri, false);
+ }
+
+ private void handleUri(Uri uri, final boolean scanned) {
final Intent intent;
final XmppUri xmppUri = new XmppUri(uri);
final List<Jid> accounts = DatabaseBackend.getInstance(this).getAccountJids(); //TODO only look at enabled accounts
@@ -108,6 +112,7 @@ public class UriHandlerActivity extends AppCompatActivity {
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();
@@ -149,7 +154,7 @@ public class UriHandlerActivity extends AppCompatActivity {
String result = intent.getStringExtra(ScanActivity.INTENT_EXTRA_RESULT);
if (result != null) {
Uri uri = Uri.parse(result);
- handleUri(uri);
+ handleUri(uri, true);
}
}
finish();