Fix missing serialized data

This commit is contained in:
Andrea Cavalli 2022-10-13 12:40:30 +02:00
parent 677ceb70a1
commit dd70f2492c
2 changed files with 4 additions and 0 deletions

View File

@ -134,6 +134,7 @@ abstract class BaseAtomixReactiveApiClient implements ReactiveApiMultiClient {
case 0x04 -> new OnBotLoginCodeRequested(userId, is.readUTF());
case 0x05 -> new OnOtherDeviceLoginRequested(userId, is.readUTF());
case 0x06 -> new OnPasswordRequested(userId, is.readUTF(), is.readBoolean(), is.readUTF());
case 0x07 -> new Ignored(userId);
default -> throw new IllegalStateException("Unexpected value: " + is.readByte());
};
}

View File

@ -25,6 +25,7 @@ import it.tdlight.jni.TdApi.SetAuthenticationPhoneNumber;
import it.tdlight.jni.TdApi.SetTdlibParameters;
import it.tdlight.jni.TdApi.TdlibParameters;
import it.tdlight.reactiveapi.Event.ClientBoundEvent;
import it.tdlight.reactiveapi.Event.Ignored;
import it.tdlight.reactiveapi.Event.OnBotLoginCodeRequested;
import it.tdlight.reactiveapi.Event.OnOtherDeviceLoginRequested;
import it.tdlight.reactiveapi.Event.OnPasswordRequested;
@ -481,6 +482,8 @@ public abstract class ReactiveApiPublisher {
dataOutputStream.writeUTF(onPasswordRequested.passwordHint());
dataOutputStream.writeBoolean(onPasswordRequested.hasRecoveryEmail());
dataOutputStream.writeUTF(onPasswordRequested.recoveryEmailPattern());
} else if (clientBoundEvent instanceof Ignored) {
dataOutputStream.writeByte(0x7);
} else {
throw new UnsupportedOperationException("Unexpected value: " + clientBoundEvent);
}