This commit is contained in:
Andrea Cavalli 2023-08-30 13:05:29 +02:00
parent 5037157ba4
commit c3596f9ae4
2 changed files with 8 additions and 4 deletions

View File

@ -26,7 +26,7 @@
<dependency>
<groupId>it.tdlight</groupId>
<artifactId>tdlight-java-bom</artifactId>
<version>3.1.1+td.1.8.16</version>
<version>3.1.2+td.1.8.16</version>
<type>pom</type>
<scope>import</scope>
</dependency>

View File

@ -34,10 +34,14 @@ final class AuthorizationStateReadyGetMe implements GenericUpdateHandler<UpdateA
public void onUpdate(UpdateAuthorizationState update) {
if (update.authorizationState.getConstructor() == AuthorizationStateReady.CONSTRUCTOR) {
client.send(new GetMe(), me -> {
if (me.getConstructor() == Error.CONSTRUCTOR) {
throw new TelegramError((Error) me);
try {
if (me.getConstructor() == Error.CONSTRUCTOR) {
throw new TelegramError((Error) me);
}
this.me.set((User) me);
} finally {
this.meReceived.complete(null);
}
this.me.set((User) me);
if (((User) me).type.getConstructor() == UserTypeRegular.CONSTRUCTOR) {
mainChatsLoader.onUpdate(update);
archivedChatsLoader.onUpdate(update);