More consistent log out checks.

GitOrigin-RevId: df749bf0a8234d5ed537b1a7200d4a3ee037eb7d
This commit is contained in:
levlam 2019-04-11 23:32:19 +03:00
parent c435360799
commit cb856f55a1
3 changed files with 4 additions and 7 deletions

View File

@ -7487,8 +7487,7 @@ tl_object_ptr<td_api::chatMember> ContactsManager::get_chat_member_object(
bool ContactsManager::on_get_channel_error(ChannelId channel_id, const Status &status, const string &source) {
LOG(INFO) << "Receive " << status << " in " << channel_id << " from " << source;
if (status.code() == 401 || status.message() == CSlice("SESSION_REVOKED") ||
status.message() == CSlice("USER_DEACTIVATED")) {
if (status.code() == 401) {
// authorization is lost
return true;
}

View File

@ -18292,8 +18292,7 @@ bool MessagesManager::on_update_message_id(int64 random_id, MessageId new_messag
}
bool MessagesManager::on_get_dialog_error(DialogId dialog_id, const Status &status, const string &source) {
if (status.code() == 401 || status.message() == CSlice("SESSION_REVOKED") ||
status.message() == CSlice("USER_DEACTIVATED")) {
if (status.code() == 401) {
// authorization is lost
return true;
}

View File

@ -91,7 +91,7 @@ class GetUpdatesStateQuery : public Td::ResultHandler {
}
void on_error(uint64 id, Status status) override {
if (status.message() != CSlice("SESSION_REVOKED") && status.message() != CSlice("USER_DEACTIVATED")) {
if (status.code() != 401) {
LOG(ERROR) << "Receive updates.getState error: " << status;
}
status.ignore();
@ -149,8 +149,7 @@ class GetDifferenceQuery : public Td::ResultHandler {
}
void on_error(uint64 id, Status status) override {
if (status.code() != 401 && status.message() != CSlice("SESSION_REVOKED") &&
status.message() != CSlice("USER_DEACTIVATED")) {
if (status.code() != 401) {
LOG(ERROR) << "Receive updates.getDifference error: " << status;
}
td->updates_manager_->on_get_difference(nullptr);