2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Update API scheme on layer 135.

This commit is contained in:
John Preston
2021-11-19 23:04:40 +04:00
parent 7d89952541
commit 4f7c728632
19 changed files with 141 additions and 104 deletions

View File

@@ -220,11 +220,8 @@ PeerId Session::userPeerId() const {
return _user->id;
}
bool Session::validateSelf(const MTPUser &user) {
if (user.type() != mtpc_user || !user.c_user().is_self()) {
LOG(("API Error: bad self user received."));
return false;
} else if (UserId(user.c_user().vid()) != userId()) {
bool Session::validateSelf(UserId id) {
if (id != userId()) {
LOG(("Auth Error: wrong self user received."));
crl::on_main(this, [=] { _account->logOut(); });
return false;