1
0
mirror of https://github.com/ErnyTech-Archive/JTDLib synced 2024-06-11 15:48:01 +02:00

Implemented the choice of the first name/last name during registration to prevent the user from blocking telegram with the use of UserClient

This commit is contained in:
Andrea Cavalli 2019-01-22 16:47:52 +01:00 committed by Ernesto Castellotti
parent 339ca80745
commit 830a11c9cc

View File

@ -306,7 +306,17 @@ public class EasyClient {
case TdApi.AuthorizationStateWaitCode.CONSTRUCTOR: {
var scanner = new Scanner(System.in);
System.out.print("Insert your code: ");
sendRaw(new TdApi.CheckAuthenticationCode(scanner.nextLine(), "", ""));
TdApi.AuthorizationStateWaitCode authorizationStateWaitCode = (TdApi.AuthorizationStateWaitCode) authorizationState;
TdApi.CheckAuthenticationCode authCodeReply = new TdApi.CheckAuthenticationCode();
System.out.print("Insert your code: ");
authCodeReply.code = scanner.nextLine();
if (!authorizationStateWaitCode.isRegistered) {
System.out.print("Insert your first name: ");
authCodeReply.firstName = scanner.nextLine();
System.out.print("Insert your last name: ");
authCodeReply.lastName = scanner.nextLine();
}
sendRaw(authCodeReply);
System.out.println();
break;
}