mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Guarded api requests in search calendar controller.
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -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<MonthKey, MonthData> _months;
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user