mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-01 06:55:58 +00:00
Move some calls from App namespace.
This commit is contained in:
@@ -310,7 +310,7 @@ void DialogsWidget::createDialog(Dialogs::Key key) {
|
||||
_inner->createDialog(key);
|
||||
const auto history = key.history();
|
||||
if (creating && history && history->peer->migrateFrom()) {
|
||||
if (const auto migrated = App::historyLoaded(
|
||||
if (const auto migrated = history->owner().historyLoaded(
|
||||
history->peer->migrateFrom())) {
|
||||
if (migrated->inChatList(Dialogs::Mode::All)) {
|
||||
_inner->removeDialog(migrated);
|
||||
@@ -445,8 +445,8 @@ void DialogsWidget::dialogsReceived(
|
||||
|
||||
const auto [dialogsList, messagesList] = [&] {
|
||||
const auto process = [&](const auto &data) {
|
||||
App::feedUsers(data.vusers);
|
||||
App::feedChats(data.vchats);
|
||||
Auth().data().processUsers(data.vusers);
|
||||
Auth().data().processChats(data.vchats);
|
||||
return std::make_tuple(&data.vdialogs.v, &data.vmessages.v);
|
||||
};
|
||||
switch (dialogs.type()) {
|
||||
@@ -514,7 +514,7 @@ void DialogsWidget::updateDialogsOffset(
|
||||
if (lastDate) {
|
||||
_dialogsOffsetDate = lastDate;
|
||||
_dialogsOffsetId = lastMsgId;
|
||||
_dialogsOffsetPeer = App::peer(lastPeer);
|
||||
_dialogsOffsetPeer = Auth().data().peer(lastPeer);
|
||||
} else {
|
||||
_dialogsFull = true;
|
||||
}
|
||||
@@ -564,8 +564,8 @@ void DialogsWidget::pinnedDialogsReceived(
|
||||
if (_pinnedDialogsRequestId != requestId) return;
|
||||
|
||||
auto &data = result.c_messages_peerDialogs();
|
||||
App::feedUsers(data.vusers);
|
||||
App::feedChats(data.vchats);
|
||||
Auth().data().processUsers(data.vusers);
|
||||
Auth().data().processChats(data.vchats);
|
||||
|
||||
Auth().data().applyPinnedDialogs(data.vdialogs.v);
|
||||
applyReceivedDialogs(data.vdialogs.v, data.vmessages.v);
|
||||
@@ -932,8 +932,8 @@ void DialogsWidget::searchReceived(
|
||||
auto &d = result.c_messages_messages();
|
||||
if (_searchRequest != 0) {
|
||||
// Don't apply cached data!
|
||||
App::feedUsers(d.vusers);
|
||||
App::feedChats(d.vchats);
|
||||
Auth().data().processUsers(d.vusers);
|
||||
Auth().data().processChats(d.vchats);
|
||||
}
|
||||
auto &msgs = d.vmessages.v;
|
||||
if (!_inner->searchReceived(msgs, type, msgs.size())) {
|
||||
@@ -949,8 +949,8 @@ void DialogsWidget::searchReceived(
|
||||
auto &d = result.c_messages_messagesSlice();
|
||||
if (_searchRequest != 0) {
|
||||
// Don't apply cached data!
|
||||
App::feedUsers(d.vusers);
|
||||
App::feedChats(d.vchats);
|
||||
Auth().data().processUsers(d.vusers);
|
||||
Auth().data().processChats(d.vchats);
|
||||
}
|
||||
auto &msgs = d.vmessages.v;
|
||||
if (!_inner->searchReceived(msgs, type, d.vcount.v)) {
|
||||
@@ -979,8 +979,8 @@ void DialogsWidget::searchReceived(
|
||||
}
|
||||
if (_searchRequest != 0) {
|
||||
// Don't apply cached data!
|
||||
App::feedUsers(d.vusers);
|
||||
App::feedChats(d.vchats);
|
||||
Auth().data().processUsers(d.vusers);
|
||||
Auth().data().processChats(d.vchats);
|
||||
}
|
||||
auto &msgs = d.vmessages.v;
|
||||
if (!_inner->searchReceived(msgs, type, d.vcount.v)) {
|
||||
@@ -1026,8 +1026,8 @@ void DialogsWidget::peerSearchReceived(
|
||||
switch (result.type()) {
|
||||
case mtpc_contacts_found: {
|
||||
auto &d = result.c_contacts_found();
|
||||
App::feedUsers(d.vusers);
|
||||
App::feedChats(d.vchats);
|
||||
Auth().data().processUsers(d.vusers);
|
||||
Auth().data().processChats(d.vchats);
|
||||
_inner->peerSearchReceived(q, d.vmy_results.v, d.vresults.v);
|
||||
} break;
|
||||
}
|
||||
@@ -1186,9 +1186,9 @@ void DialogsWidget::setSearchInChat(Dialogs::Key chat, UserData *from) {
|
||||
_searchInMigrated = nullptr;
|
||||
if (const auto peer = chat.peer()) {
|
||||
if (const auto migrateTo = peer->migrateTo()) {
|
||||
return setSearchInChat(App::history(migrateTo), from);
|
||||
return setSearchInChat(peer->owner().history(migrateTo), from);
|
||||
} else if (const auto migrateFrom = peer->migrateFrom()) {
|
||||
_searchInMigrated = App::history(migrateFrom);
|
||||
_searchInMigrated = peer->owner().history(migrateFrom);
|
||||
}
|
||||
}
|
||||
const auto searchInPeerUpdated = (_searchInChat != chat);
|
||||
|
Reference in New Issue
Block a user