From 4938e6dda779aa87d091bd572d160c22423d5ca8 Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 14 Mar 2023 21:45:23 +0300 Subject: [PATCH] Fix auth.sentCodeSuccess handling. --- td/telegram/net/Session.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/td/telegram/net/Session.cpp b/td/telegram/net/Session.cpp index 791fdf122..0ad0d5548 100644 --- a/td/telegram/net/Session.cpp +++ b/td/telegram/net/Session.cpp @@ -866,12 +866,12 @@ Status Session::on_message_result_ok(uint64 message_id, BufferSlice packet, size last_success_timestamp_ = Time::now(); TlParser parser(packet.as_slice()); - int32 ID = parser.fetch_int(); + int32 response_id = parser.fetch_int(); auto it = sent_queries_.find(message_id); if (it == sent_queries_.end()) { LOG(DEBUG) << "Drop result to " << tag("message_id", format::as_hex(message_id)) - << tag("original_size", original_size) << tag("tl", format::as_hex(ID)); + << tag("original_size", original_size) << tag("response_id", format::as_hex(response_id)); if (original_size > 16 * 1024) { dropped_size_ += original_size; @@ -892,7 +892,9 @@ Status Session::on_message_result_ok(uint64 message_id, BufferSlice packet, size if (!parser.get_error()) { // Steal authorization information. // It is a dirty hack, yep. - if (ID == telegram_api::auth_authorization::ID || ID == telegram_api::auth_loginTokenSuccess::ID) { + if (response_id == telegram_api::auth_authorization::ID || + response_id == telegram_api::auth_loginTokenSuccess::ID || + response_id == telegram_api::auth_sentCodeSuccess::ID) { if (query_ptr->query->tl_constructor() != telegram_api::auth_importAuthorization::ID) { G()->net_query_dispatcher().set_main_dc_id(raw_dc_id_); }