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:
parent
89f96a3073
commit
17ba0b9e85
@ -304,11 +304,21 @@ public class EasyClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case TdApi.AuthorizationStateWaitCode.CONSTRUCTOR: {
|
case TdApi.AuthorizationStateWaitCode.CONSTRUCTOR: {
|
||||||
var scanner = new Scanner(System.in);
|
var scanner = new Scanner(System.in);
|
||||||
System.out.print("Insert your code: ");
|
System.out.print("Insert your code: ");
|
||||||
sendRaw(new TdApi.CheckAuthenticationCode(scanner.nextLine(), "", ""));
|
TdApi.AuthorizationStateWaitCode authorizationStateWaitCode = (TdApi.AuthorizationStateWaitCode) authorizationState;
|
||||||
System.out.println();
|
TdApi.CheckAuthenticationCode authCodeReply = new TdApi.CheckAuthenticationCode();
|
||||||
break;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
case TdApi.AuthorizationStateWaitPassword.CONSTRUCTOR: {
|
case TdApi.AuthorizationStateWaitPassword.CONSTRUCTOR: {
|
||||||
|
Loading…
Reference in New Issue
Block a user