2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Don't logout on some server-side problems.

This commit is contained in:
John Preston
2018-05-13 11:42:25 +03:00
parent 7d8ba15252
commit 8764da787b
3 changed files with 36 additions and 17 deletions

View File

@@ -304,7 +304,10 @@ base::Observable<void> &AuthSession::downloaderTaskFinished() {
}
bool AuthSession::validateSelf(const MTPUser &user) {
if (user.type() != mtpc_user || !user.c_user().is_self() || user.c_user().vid.v != userId()) {
if (user.type() != mtpc_user || !user.c_user().is_self()) {
LOG(("API Error: bad self user received."));
return false;
} else if (user.c_user().vid.v != userId()) {
LOG(("Auth Error: wrong self user received."));
App::logOutDelayed();
return false;
@@ -314,6 +317,7 @@ bool AuthSession::validateSelf(const MTPUser &user) {
void AuthSession::saveSettingsDelayed(TimeMs delay) {
Expects(this == &Auth());
_saveDataTimer.callOnce(delay);
}