mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Moved PeerId parameter to SearchCalendarController constructor.
This commit is contained in:
@@ -23,18 +23,19 @@ namespace Api {
|
||||
|
||||
SearchCalendarController::SearchCalendarController(
|
||||
not_null<Main::Session*> session,
|
||||
PeerId peerId,
|
||||
Storage::SharedMediaType type)
|
||||
: _session(session)
|
||||
, _peerId(peerId)
|
||||
, _type(type) {
|
||||
}
|
||||
|
||||
void SearchCalendarController::monthThumbnails(
|
||||
PeerId peerId,
|
||||
TimeId date,
|
||||
Fn<void(std::vector<DayThumbnail>)> onFinish) {
|
||||
const auto parsed = base::unixtime::parse(date).date();
|
||||
const auto key = MonthKey{
|
||||
.peerId = peerId,
|
||||
.peerId = _peerId,
|
||||
.year = parsed.year(),
|
||||
.month = parsed.month(),
|
||||
};
|
||||
|
||||
@@ -42,10 +42,10 @@ class SearchCalendarController final {
|
||||
public:
|
||||
SearchCalendarController(
|
||||
not_null<Main::Session*> session,
|
||||
PeerId peerId,
|
||||
Storage::SharedMediaType type);
|
||||
|
||||
void monthThumbnails(
|
||||
PeerId peerId,
|
||||
TimeId date,
|
||||
Fn<void(std::vector<DayThumbnail>)> onFinish);
|
||||
|
||||
@@ -81,6 +81,7 @@ private:
|
||||
bool noMoreData);
|
||||
|
||||
const not_null<Main::Session*> _session;
|
||||
const PeerId _peerId;
|
||||
const Storage::SharedMediaType _type;
|
||||
|
||||
base::flat_map<MonthKey, MonthData> _months;
|
||||
|
||||
@@ -2818,6 +2818,7 @@ void SessionController::showCalendar(ShowCalendarDescriptor &&descriptor) {
|
||||
}
|
||||
const auto search = std::make_shared<Api::SearchCalendarController>(
|
||||
&session(),
|
||||
history->peer->id,
|
||||
(descriptor.mediaPhoto && descriptor.mediaVideo)
|
||||
? Storage::SharedMediaType::PhotoVideo
|
||||
: descriptor.mediaPhoto
|
||||
@@ -2825,7 +2826,6 @@ void SessionController::showCalendar(ShowCalendarDescriptor &&descriptor) {
|
||||
: Storage::SharedMediaType::Video);
|
||||
return (ReturnType)[=](QDate date, Ui::CalendarImageSetter set) {
|
||||
search->monthThumbnails(
|
||||
peerId,
|
||||
base::unixtime::serialize(QDateTime(date, QTime())),
|
||||
[=](const std::vector<Api::DayThumbnail> &thumbnails) {
|
||||
for (const auto &thumb : thumbnails) {
|
||||
|
||||
Reference in New Issue
Block a user