AuthorizationState is not updating from WaitTdlibParameters
I am trying to run the ruby program given in readme. I have api_id and api_hash. But the authorization_state is set to WaitTdlibParameters initially and I am not sure how would it get updated to one of the states mentioned in the case when block.
Here is code snippet from my local file -
p '-----------------------------after config-----------------------------'
TD::Api.set_log_verbosity_level(1)
client = TD::Client.new
p '-----------------------------after client.new-----------------------------'
begin
state = nil
p '-----------------------------before client.on-----------------------------'
client.on(TD::Types::Update::AuthorizationState) do |update|
p '-----------------------------before case-----------------------------'
p "update.authorization_state - #{update.authorization_state}"
state = case update.authorization_state
when TD::Types::AuthorizationState::WaitPhoneNumber
:wait_phone_number
when TD::Types::AuthorizationState::WaitCode
:wait_code
when TD::Types::AuthorizationState::WaitPassword
:wait_password
when TD::Types::AuthorizationState::Ready
:ready
else
nil
end
p '-----------------------------end of case-----------------------------'
end
Output
"-----------------------------before case-----------------------------"
"update.authorization_state - #<TD::Types::AuthorizationState::WaitTdlibParameters:0x00007fb7feb08d18>"
I tried few things like calling client.set_tdlib_parameters, but it is not getting me the correct result. Please let me know if I am missing something.
Hi, I've just faced the same problem, my solution is: https://github.com/m3xq/tdlib-ruby/commit/17f578a6ea866f362bca267c41d5d7894362a1cd
Same for me on the latest version
@m3xq unfortunately your patch does not solve the issue for me :(
Maybe my comment from other issue will help somehow https://github.com/southbridgeio/tdlib-ruby/issues/63#issuecomment-2210922485