From b5b0dbe331ace0e4513d0ae01065aaae452f4b64 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 4 May 2023 14:59:09 +0300 Subject: [PATCH] Reuse get_auth_key_state. --- td/telegram/net/SessionProxy.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/td/telegram/net/SessionProxy.cpp b/td/telegram/net/SessionProxy.cpp index 5dff1d4a0..47971550b 100644 --- a/td/telegram/net/SessionProxy.cpp +++ b/td/telegram/net/SessionProxy.cpp @@ -239,15 +239,7 @@ void SessionProxy::update_auth_key_state() { } void SessionProxy::on_tmp_auth_key_updated(mtproto::AuthKey auth_key) { - Slice state; - if (auth_key.empty()) { - state = Slice("Empty"); - } else if (auth_key.auth_flag()) { - state = Slice("OK"); - } else { - state = Slice("NoAuth"); - } - LOG(WARNING) << "Have tmp_auth_key " << auth_key.id() << ": " << state; + LOG(WARNING) << "Have tmp_auth_key " << auth_key.id() << ": " << get_auth_key_state(auth_key); tmp_auth_key_ = std::move(auth_key); }