diff --git a/Telegram/SourceFiles/data/data_search_calendar.cpp b/Telegram/SourceFiles/data/data_search_calendar.cpp index 74bcf6ff0e..513683fa00 100644 --- a/Telegram/SourceFiles/data/data_search_calendar.cpp +++ b/Telegram/SourceFiles/data/data_search_calendar.cpp @@ -27,7 +27,8 @@ SearchCalendarController::SearchCalendarController( Storage::SharedMediaType type) : _session(session) , _peerId(peerId) -, _type(type) { +, _type(type) +, _api(&session->mtp()) { } void SearchCalendarController::monthThumbnails( @@ -65,7 +66,7 @@ void SearchCalendarController::performMonthRequest(const MonthKey &key) { auto &state = _months[key].state; - _months[key].requestId = _session->api().request( + _months[key].requestId = _api.request( MTPmessages_GetSearchResultsCalendar( MTP_flags(0), peer->input(), diff --git a/Telegram/SourceFiles/data/data_search_calendar.h b/Telegram/SourceFiles/data/data_search_calendar.h index 7648608213..3fcd4758c8 100644 --- a/Telegram/SourceFiles/data/data_search_calendar.h +++ b/Telegram/SourceFiles/data/data_search_calendar.h @@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once +#include "mtproto/sender.h" #include "storage/storage_shared_media.h" namespace Main { @@ -87,6 +88,8 @@ private: const PeerId _peerId; const Storage::SharedMediaType _type; + MTP::Sender _api; + base::flat_map _months; };