Fix error logging.
GitOrigin-RevId: d734897ab870154d47a3e576ba3cba8eb4d3156e
This commit is contained in:
parent
9ea1bc824f
commit
fcd09d5c25
@ -84,8 +84,12 @@ bool AuthManager::is_bot() const {
|
||||
if (net_query_id_ != 0 && net_query_type_ == NetQueryType::BotAuthentication) {
|
||||
return true;
|
||||
}
|
||||
return is_bot_ && (state_ == State::Ok || state_ == State::LoggingOut || state_ == State::DestroyingKeys ||
|
||||
state_ == State::Closing);
|
||||
return is_bot_ && was_authorized();
|
||||
}
|
||||
|
||||
bool AuthManager::was_authorized() const {
|
||||
return state_ == State::Ok || state_ == State::LoggingOut || state_ == State::DestroyingKeys ||
|
||||
state_ == State::Closing;
|
||||
}
|
||||
|
||||
bool AuthManager::is_authorized() const {
|
||||
|
@ -30,6 +30,7 @@ class AuthManager : public NetActor {
|
||||
bool is_bot() const;
|
||||
|
||||
bool is_authorized() const;
|
||||
bool was_authorized() const;
|
||||
void get_state(uint64 query_id);
|
||||
|
||||
void set_phone_number(uint64 query_id, string phone_number,
|
||||
|
@ -62,7 +62,7 @@ NetQueryPtr NetQueryCreator::create(uint64 id, const telegram_api::Function &fun
|
||||
if (auth_manager != nullptr && auth_manager->is_bot()) {
|
||||
total_timeout_limit = 8;
|
||||
}
|
||||
if ((auth_manager == nullptr || !auth_manager->is_authorized()) && auth_flag == NetQuery::AuthFlag::On) {
|
||||
if ((auth_manager == nullptr || !auth_manager->was_authorized()) && auth_flag == NetQuery::AuthFlag::On) {
|
||||
LOG(ERROR) << "Send query before authorization: " << to_string(function);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user