2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Pass MTP::Instance to MTP::Sender.

This commit is contained in:
John Preston
2019-11-27 11:02:56 +03:00
parent a0152557ec
commit e943264823
65 changed files with 406 additions and 275 deletions

View File

@@ -142,7 +142,8 @@ void PeerListRowWithLink::paintAction(
PeerListGlobalSearchController::PeerListGlobalSearchController(
not_null<Window::SessionNavigation*> navigation)
: _navigation(navigation) {
: _navigation(navigation)
, _api(_navigation->session().api().instance()) {
_timer.setCallback([this] { searchOnServer(); });
}
@@ -169,7 +170,7 @@ bool PeerListGlobalSearchController::searchInCache() {
}
void PeerListGlobalSearchController::searchOnServer() {
_requestId = request(MTPcontacts_Search(
_requestId = _api.request(MTPcontacts_Search(
MTP_string(_query),
MTP_int(SearchPeopleLimit)
)).done([=](const MTPcontacts_Found &result, mtpRequestId requestId) {