From 438e60ac662e445e658f7dad8b0d3435836c05d0 Mon Sep 17 00:00:00 2001 From: adbenitez Date: Sun, 2 Jun 2024 00:19:33 +0200 Subject: [PATCH] switch to new account when opening DCACCOUNT:// URIs --- .../thoughtcrime/securesms/InstantOnboardingActivity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/org/thoughtcrime/securesms/InstantOnboardingActivity.java b/src/org/thoughtcrime/securesms/InstantOnboardingActivity.java index 53d8fc0b3..3b897d96f 100644 --- a/src/org/thoughtcrime/securesms/InstantOnboardingActivity.java +++ b/src/org/thoughtcrime/securesms/InstantOnboardingActivity.java @@ -95,6 +95,11 @@ public class InstantOnboardingActivity extends BaseActionBarActivity implements getSupportActionBar().setDisplayHomeAsUpEnabled(true); boolean fromWelcome = getIntent().getBooleanExtra(FROM_WELCOME, false); + if (DcHelper.getContext(this).isConfigured() == 1) { + // if account is configured it means we didn't come from Welcome screen nor from QR scanner, + // instead, user clicked a dcaccount:// URI directly, so we need to switch to a new account: + AccountManager.getInstance().beginAccountCreation(this); + } getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(!fromWelcome) { @Override public void handleOnBackPressed() {