2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-01 07:05:13 +00:00

Remove some more Auth() calls.

This commit is contained in:
John Preston
2020-06-08 13:06:50 +04:00
parent bede709f6b
commit 3878a1b212
67 changed files with 380 additions and 299 deletions

View File

@@ -254,7 +254,7 @@ void FieldAutocomplete::updateFiltered(bool resetScroll) {
};
mrows.reserve(mrows.size() + (_chat->participants.empty() ? _chat->lastAuthors.size() : _chat->participants.size()));
if (_chat->noParticipantInfo()) {
Auth().api().requestFullPeer(_chat);
_chat->session().api().requestFullPeer(_chat);
} else if (!_chat->participants.empty()) {
for (const auto user : _chat->participants) {
if (user->isInaccessible()) continue;
@@ -277,7 +277,7 @@ void FieldAutocomplete::updateFiltered(bool resetScroll) {
} else if (_channel && _channel->isMegagroup()) {
QMultiMap<int32, UserData*> ordered;
if (_channel->lastParticipantsRequestNeeded()) {
Auth().api().requestLastParticipants(_channel);
_channel->session().api().requestLastParticipants(_channel);
} else {
mrows.reserve(mrows.size() + _channel->mgInfo->lastParticipants.size());
for (const auto user : _channel->mgInfo->lastParticipants) {
@@ -600,7 +600,9 @@ FieldAutocompleteInner::FieldAutocompleteInner(
, _brows(brows)
, _srows(srows)
, _previewTimer([=] { showPreview(); }) {
subscribe(Auth().downloaderTaskFinished(), [this] { update(); });
subscribe(
controller->session().downloaderTaskFinished(),
[=] { update(); });
}
void FieldAutocompleteInner::paintEvent(QPaintEvent *e) {