diff --git a/td/telegram/AuthManager.cpp b/td/telegram/AuthManager.cpp index 56f49ffeb..8415c0851 100644 --- a/td/telegram/AuthManager.cpp +++ b/td/telegram/AuthManager.cpp @@ -327,13 +327,6 @@ void AuthManager::tear_down() { parent_.reset(); } -bool AuthManager::is_bot() const { - if (net_query_id_ != 0 && net_query_type_ == NetQueryType::BotAuthentication) { - return true; - } - return is_bot_ && was_authorized(); -} - bool AuthManager::was_authorized() const { return state_ == State::Ok || state_ == State::LoggingOut || state_ == State::DestroyingKeys || state_ == State::Closing; diff --git a/td/telegram/AuthManager.h b/td/telegram/AuthManager.h index 7c8a39d0a..428515ecf 100644 --- a/td/telegram/AuthManager.h +++ b/td/telegram/AuthManager.h @@ -28,7 +28,9 @@ class AuthManager final : public NetActor { public: AuthManager(int32 api_id, const string &api_hash, ActorShared<> parent); - bool is_bot() const; + bool is_bot() const { + return is_bot_ || net_query_type_ == NetQueryType::BotAuthentication; + } bool is_authorized() const; bool was_authorized() const;