diff options
author | Christian Schneppe <christian.schneppe@pix-art.de> | 2020-01-24 17:21:33 +0100 |
---|---|---|
committer | Christian Schneppe <christian.schneppe@pix-art.de> | 2020-01-24 17:21:33 +0100 |
commit | 99e21438c0ad268c08f09656ebc3d271c4e4031a (patch) | |
tree | 6a8d4960236a4373c60b70e32e3fe5c9ea3fe52e /src/main/java/de/pixart | |
parent | e71bfaa48d03ad97ab678e25707beec009b794bf (diff) |
preselect proper account in create contact dialog after following invite
Diffstat (limited to 'src/main/java/de/pixart')
3 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java index 4758f59bc..b54959316 100644 --- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java @@ -450,6 +450,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat if (wasFirstAccount) { intent.putExtra("init", true); } + intent.putExtra(EXTRA_ACCOUNT, mAccount.getJid().asBareJid().toEscapedString()); } else { intent = new Intent(getApplicationContext(), PublishProfilePictureActivity.class); intent.putExtra(EXTRA_ACCOUNT, mAccount.getJid().asBareJid().toString()); diff --git a/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java b/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java index 725a74762..27f20d712 100644 --- a/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java +++ b/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java @@ -55,6 +55,7 @@ public class PublishProfilePictureActivity extends XmppActivity implements XmppC if (mInitialAccountSetup) { Intent intent = new Intent(getApplicationContext(), StartConversationActivity.class); StartConversationActivity.addInviteUri(intent, getIntent()); + intent.putExtra(EXTRA_ACCOUNT, account.getJid().asBareJid().toEscapedString()); intent.putExtra("init", true); startActivity(intent); } @@ -101,6 +102,7 @@ public class PublishProfilePictureActivity extends XmppActivity implements XmppC intent.putExtra("init", true); } StartConversationActivity.addInviteUri(intent, getIntent()); + intent.putExtra(EXTRA_ACCOUNT, account.getJid().asBareJid().toEscapedString()); startActivity(intent); } finish(); diff --git a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java index eb09fe859..a83c7ea11 100644 --- a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java @@ -496,7 +496,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne getString(R.string.add_contact), getString(R.string.add), prefilledJid, - null, + invite == null ? null : invite.account, invite == null || !invite.hasFingerprints(), multiAccount, true @@ -794,7 +794,8 @@ public class StartConversationActivity extends XmppActivity implements XmppConne protected boolean processViewIntent(@NonNull Intent intent) { final String inviteUri = intent.getStringExtra(EXTRA_INVITE_URI); if (inviteUri != null) { - Invite invite = new Invite(inviteUri); + final Invite invite = new Invite(inviteUri); + invite.account = intent.getStringExtra(EXTRA_ACCOUNT); if (invite.isJidValid()) { return invite.invite(); } @@ -809,7 +810,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne Uri uri = intent.getData(); if (uri != null) { Invite invite = new Invite(intent.getData(), intent.getBooleanExtra("scanned", false)); - invite.account = intent.getStringExtra("account"); + invite.account = intent.getStringExtra(EXTRA_ACCOUNT); invite.forceDialog = intent.getBooleanExtra("force_dialog", false); return invite.invite(); } else { @@ -830,8 +831,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne showJoinConferenceDialog(invite.getJid().asBareJid().toString()); return false; } - } else if (contacts.size() == 0) { //TODO or init mode - //TODO if init mode; prefill dialog with account jid + } else if (contacts.size() == 0) { showCreateContactDialog(invite.getJid().toString(), invite); return false; } else if (contacts.size() == 1) { |