Silence 401th error for ordinary users.

GitOrigin-RevId: 3a371adef8cfc50609a9320c43a0c8cf5d9dd403
This commit is contained in:
levlam 2018-11-07 21:26:21 +03:00
parent 7801d91d14
commit 95ff033aae
3 changed files with 6 additions and 3 deletions

View File

@ -7083,7 +7083,8 @@ 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.message() == CSlice("SESSION_REVOKED") || status.message() == CSlice("USER_DEACTIVATED")) {
if (status.code() == 401 || status.message() == CSlice("SESSION_REVOKED") ||
status.message() == CSlice("USER_DEACTIVATED")) {
// authorization is lost
return true;
}

View File

@ -17272,7 +17272,8 @@ 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.message() == CSlice("SESSION_REVOKED") || status.message() == CSlice("USER_DEACTIVATED")) {
if (status.code() == 401 || status.message() == CSlice("SESSION_REVOKED") ||
status.message() == CSlice("USER_DEACTIVATED")) {
// authorization is lost
return true;
}

View File

@ -142,7 +142,8 @@ class GetDifferenceQuery : 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 && status.message() != CSlice("SESSION_REVOKED") &&
status.message() != CSlice("USER_DEACTIVATED")) {
LOG(ERROR) << "updates.getDifference error: " << status;
}
td->updates_manager_->on_get_difference(nullptr);