2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 23:45:44 +00:00

Prepared messages sharing from miniapp.

This commit is contained in:
John Preston
2024-11-08 23:19:29 +04:00
parent 3d77bff0c9
commit 2d1fb0562d
20 changed files with 465 additions and 63 deletions

View File

@@ -1881,8 +1881,8 @@ void BlockSenderFromRepliesBox(
Window::ClearReply{ id });
}
QPointer<Ui::BoxContent> ShowChooseRecipientBox(
not_null<Window::SessionNavigation*> navigation,
object_ptr<Ui::BoxContent> PrepareChooseRecipientBox(
not_null<Main::Session*> session,
FnMut<bool(not_null<Data::Thread*>)> &&chosen,
rpl::producer<QString> titleOverride,
FnMut<void()> &&successCallback,
@@ -1927,15 +1927,30 @@ QPointer<Ui::BoxContent> ShowChooseRecipientBox(
box->setTitle(std::move(titleOverride));
}
};
*weak = navigation->parentController()->show(Box<PeerListBox>(
auto result = Box<PeerListBox>(
std::make_unique<ChooseRecipientBoxController>(ChooseRecipientArgs{
.session = &navigation->session(),
.session = session,
.callback = std::move(callback),
.filter = std::move(filter),
.premiumRequiredError = WritePremiumRequiredError,
}),
std::move(initBox)));
return weak->data();
std::move(initBox));
*weak = result.data();
return result;
}
QPointer<Ui::BoxContent> ShowChooseRecipientBox(
not_null<Window::SessionNavigation*> navigation,
FnMut<bool(not_null<Data::Thread*>)> &&chosen,
rpl::producer<QString> titleOverride,
FnMut<void()> &&successCallback,
InlineBots::PeerTypes typesRestriction) {
return navigation->parentController()->show(PrepareChooseRecipientBox(
&navigation->session(),
std::move(chosen),
std::move(titleOverride),
std::move(successCallback),
typesRestriction));
}
QPointer<Ui::BoxContent> ShowForwardMessagesBox(