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

Added Api::SendOptions passing from TabbedSelector for inline results.

This commit is contained in:
23rd
2020-08-07 19:13:47 +03:00
committed by John Preston
parent 5b95585725
commit d1d153e886
9 changed files with 43 additions and 24 deletions

View File

@@ -189,7 +189,8 @@ rpl::producer<TabbedSelector::FileChosen> GifsListWidget::fileChosen() const {
return _fileChosen.events();
}
rpl::producer<not_null<PhotoData*>> GifsListWidget::photoChosen() const {
auto GifsListWidget::photoChosen() const
-> rpl::producer<TabbedSelector::PhotoChosen> {
return _photoChosen.events();
}
@@ -457,7 +458,9 @@ void GifsListWidget::selectInlineResult(
if (forceSend
|| (media && media->image(PhotoSize::Thumbnail))
|| (media && media->image(PhotoSize::Large))) {
_photoChosen.fire_copy(photo);
_photoChosen.fire_copy({
.photo = photo,
.options = options });
} else if (!photo->loading(PhotoSize::Thumbnail)) {
photo->load(PhotoSize::Thumbnail, Data::FileOrigin());
}
@@ -479,7 +482,7 @@ void GifsListWidget::selectInlineResult(
}
} else if (const auto inlineResult = item->getResult()) {
if (inlineResult->onChoose(item)) {
_inlineResultChosen.fire({ inlineResult, _searchBot });
_inlineResultChosen.fire({ inlineResult, _searchBot, options });
}
}
}