kopia lustrzana https://github.com/ryukoposting/Signal-Android
Ask for profile name on re-register if none present for number.
rodzic
6922886395
commit
4990243a91
|
@ -50,9 +50,9 @@ public final class RegistrationCompleteFragment extends LoggingFragment {
|
||||||
if (SignalStore.storageService().needsAccountRestore()) {
|
if (SignalStore.storageService().needsAccountRestore()) {
|
||||||
Log.i(TAG, "Performing pin restore");
|
Log.i(TAG, "Performing pin restore");
|
||||||
activity.startActivity(new Intent(activity, PinRestoreActivity.class));
|
activity.startActivity(new Intent(activity, PinRestoreActivity.class));
|
||||||
} else if (!viewModel.isReregister()) {
|
} else {
|
||||||
|
boolean needsPin = !SignalStore.kbsValues().hasPin() && !viewModel.isReregister();
|
||||||
boolean needsProfile = Recipient.self().getProfileName().isEmpty() || !AvatarHelper.hasAvatar(activity, Recipient.self().getId());
|
boolean needsProfile = Recipient.self().getProfileName().isEmpty() || !AvatarHelper.hasAvatar(activity, Recipient.self().getId());
|
||||||
boolean needsPin = !SignalStore.kbsValues().hasPin();
|
|
||||||
|
|
||||||
Log.i(TAG, "Pin restore flow not required." +
|
Log.i(TAG, "Pin restore flow not required." +
|
||||||
" profile name: " + Recipient.self().getProfileName().isEmpty() +
|
" profile name: " + Recipient.self().getProfileName().isEmpty() +
|
||||||
|
@ -61,14 +61,6 @@ public final class RegistrationCompleteFragment extends LoggingFragment {
|
||||||
|
|
||||||
Intent startIntent = MainActivity.clearTop(activity);
|
Intent startIntent = MainActivity.clearTop(activity);
|
||||||
|
|
||||||
if (needsPin) {
|
|
||||||
startIntent = chainIntents(CreateKbsPinActivity.getIntentForPinCreate(requireContext()), startIntent);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (needsProfile) {
|
|
||||||
startIntent = chainIntents(EditProfileActivity.getIntentForUserProfile(activity), startIntent);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!needsProfile && !needsPin) {
|
if (!needsProfile && !needsPin) {
|
||||||
ApplicationDependencies.getJobManager()
|
ApplicationDependencies.getJobManager()
|
||||||
.startChain(new ProfileUploadJob())
|
.startChain(new ProfileUploadJob())
|
||||||
|
@ -76,11 +68,18 @@ public final class RegistrationCompleteFragment extends LoggingFragment {
|
||||||
.enqueue();
|
.enqueue();
|
||||||
|
|
||||||
RegistrationUtil.maybeMarkRegistrationComplete(requireContext());
|
RegistrationUtil.maybeMarkRegistrationComplete(requireContext());
|
||||||
|
} else {
|
||||||
|
if (needsPin) {
|
||||||
|
startIntent = chainIntents(CreateKbsPinActivity.getIntentForPinCreate(requireContext()), startIntent);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (needsProfile) {
|
||||||
|
startIntent = chainIntents(EditProfileActivity.getIntentForUserProfile(activity), startIntent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
activity.startActivity(startIntent);
|
activity.startActivity(startIntent);
|
||||||
}
|
}
|
||||||
|
|
||||||
activity.finish();
|
activity.finish();
|
||||||
ActivityNavigator.applyPopAnimationsToPendingTransition(activity);
|
ActivityNavigator.applyPopAnimationsToPendingTransition(activity);
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue