2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-10-25 15:16:15 +00:00

Reduced number of requests for authorizations list in SessionsBox.

This commit is contained in:
23rd
2020-09-18 22:04:18 +03:00
committed by John Preston
parent 41cb37b091
commit 3e6ba53a04
3 changed files with 43 additions and 21 deletions

View File

@@ -103,6 +103,7 @@ void Authorizations::reload() {
_requestId = _api.request(MTPaccount_GetAuthorizations(
)).done([=](const MTPaccount_Authorizations &result) {
_requestId = 0;
_lastReceived = crl::now();
result.match([&](const MTPDaccount_authorizations &auths) {
_list = (
auths.vauthorizations().v
@@ -158,4 +159,8 @@ int Authorizations::total() const {
ranges::not_fn(&Entry::incomplete));
}
crl::time Authorizations::lastReceivedTime() {
return _lastReceived;
}
} // namespace Api