Guarded api requests in search calendar controller.

This commit is contained in:
23rd
2026-02-12 07:43:10 +03:00
parent cb13636622
commit 0543491bab
2 changed files with 6 additions and 2 deletions
@@ -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;
};