2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Move some calls from App namespace.

This commit is contained in:
John Preston
2019-01-18 16:27:37 +04:00
parent e7804d014d
commit 4111da1dd0
74 changed files with 896 additions and 852 deletions

View File

@@ -19,6 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "info/profile/info_profile_button.h"
#include "info/profile/info_profile_cover.h"
#include "data/data_user.h"
#include "data/data_session.h"
#include "lang/lang_keys.h"
#include "storage/localstorage.h"
#include "auth_session.h"
@@ -224,8 +225,7 @@ void SetupHelp(not_null<Ui::VerticalLayout*> container) {
st::settingsSectionButton);
button->addClickHandler([=] {
const auto ready = crl::guard(button, [](const MTPUser &data) {
const auto users = MTP_vector<MTPUser>(1, data);
if (const auto user = App::feedUsers(users)) {
if (const auto user = Auth().data().processUser(data)) {
Ui::showPeerHistory(user, ShowAtUnreadMsgId);
}
});

View File

@@ -15,6 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "auth_session.h"
#include "storage/localstorage.h"
#include "data/data_user.h"
#include "data/data_session.h"
#include "history/history.h"
#include "calls/calls_instance.h"
#include "ui/widgets/checkbox.h"
@@ -111,7 +112,10 @@ void BlockedBoxController::loadMoreRows() {
return;
}
_loadRequestId = request(MTPcontacts_GetBlocked(MTP_int(_offset), MTP_int(kBlockedPerPage))).done([this](const MTPcontacts_Blocked &result) {
_loadRequestId = request(MTPcontacts_GetBlocked(
MTP_int(_offset),
MTP_int(kBlockedPerPage)
)).done([=](const MTPcontacts_Blocked &result) {
_loadRequestId = 0;
if (!_offset) {
@@ -119,7 +123,7 @@ void BlockedBoxController::loadMoreRows() {
}
auto handleContactsBlocked = [](auto &list) {
App::feedUsers(list.vusers);
Auth().data().processUsers(list.vusers);
return list.vblocked.v;
};
switch (result.type()) {
@@ -162,7 +166,7 @@ void BlockedBoxController::receivedUsers(const QVector<MTPContactBlocked> &resul
}
auto &contactBlocked = item.c_contactBlocked();
auto userId = contactBlocked.vuser_id.v;
if (auto user = App::userLoaded(userId)) {
if (auto user = Auth().data().userLoaded(userId)) {
appendRow(user);
user->setBlockStatus(UserData::BlockStatus::Blocked);
}