Simplify AuthManager::is_bot.
This commit is contained in:
parent
2a50068d7e
commit
70828853e8
@ -327,13 +327,6 @@ void AuthManager::tear_down() {
|
|||||||
parent_.reset();
|
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 {
|
bool AuthManager::was_authorized() const {
|
||||||
return state_ == State::Ok || state_ == State::LoggingOut || state_ == State::DestroyingKeys ||
|
return state_ == State::Ok || state_ == State::LoggingOut || state_ == State::DestroyingKeys ||
|
||||||
state_ == State::Closing;
|
state_ == State::Closing;
|
||||||
|
@ -28,7 +28,9 @@ class AuthManager final : public NetActor {
|
|||||||
public:
|
public:
|
||||||
AuthManager(int32 api_id, const string &api_hash, ActorShared<> parent);
|
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 is_authorized() const;
|
||||||
bool was_authorized() const;
|
bool was_authorized() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user