From 612afe63feb889e2c791319bba9eecfc47daab67 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 8 Sep 2022 13:47:16 +0300 Subject: [PATCH] Update Java example. --- .../java/org/drinkless/tdlib/example/Example.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/example/java/org/drinkless/tdlib/example/Example.java b/example/java/org/drinkless/tdlib/example/Example.java index 7bda83960..596cee842 100644 --- a/example/java/org/drinkless/tdlib/example/Example.java +++ b/example/java/org/drinkless/tdlib/example/Example.java @@ -112,7 +112,7 @@ public final class Example { request.applicationVersion = "1.0"; request.enableStorageOptimizer = true; - client.send(parameters, new AuthorizationRequestHandler()); + client.send(request, new AuthorizationRequestHandler()); break; case TdApi.AuthorizationStateWaitPhoneNumber.CONSTRUCTOR: { String phoneNumber = promptString("Please enter phone number: "); @@ -124,6 +124,16 @@ public final class Example { System.out.println("Please confirm this login link on another device: " + link); break; } + case TdApi.AuthorizationStateWaitEmailAddress.CONSTRUCTOR: { + String emailAddress = promptString("Please enter email address: "); + client.send(new TdApi.SetAuthenticationEmailAddress(emailAddress), new AuthorizationRequestHandler()); + break; + } + case TdApi.AuthorizationStateWaitEmailCode.CONSTRUCTOR: { + String code = promptString("Please enter email authentication code: "); + client.send(new TdApi.CheckAuthenticationEmailCode(new TdApi.EmailAddressAuthenticationCode(code)), new AuthorizationRequestHandler()); + break; + } case TdApi.AuthorizationStateWaitCode.CONSTRUCTOR: { String code = promptString("Please enter authentication code: "); client.send(new TdApi.CheckAuthenticationCode(code), new AuthorizationRequestHandler());