Provided instance of Ui::Show to AddPermanentLinkBlock.

This commit is contained in:
23rd 2022-03-06 08:14:34 +03:00
parent c56c0e3232
commit f48cf2e27a
4 changed files with 6 additions and 1 deletions

View File

@ -896,6 +896,7 @@ void AddSinglePeerRow(
} }
void AddPermanentLinkBlock( void AddPermanentLinkBlock(
std::shared_ptr<Ui::Show> show,
not_null<Ui::VerticalLayout*> container, not_null<Ui::VerticalLayout*> container,
not_null<PeerData*> peer, not_null<PeerData*> peer,
not_null<UserData*> admin, not_null<UserData*> admin,
@ -961,7 +962,7 @@ void AddPermanentLinkBlock(
value->current().link, value->current().link,
std::move(close)); std::move(close));
}); });
Ui::show( show->showBox(
Ui::MakeConfirmBox({ Ui::MakeConfirmBox({
tr::lng_group_invite_about_new(tr::now), tr::lng_group_invite_about_new(tr::now),
done done

View File

@ -17,6 +17,7 @@ struct InviteLink;
namespace Ui { namespace Ui {
class VerticalLayout; class VerticalLayout;
class Show;
} // namespace Ui } // namespace Ui
[[nodiscard]] bool IsExpiredLink(const Api::InviteLink &data, TimeId now); [[nodiscard]] bool IsExpiredLink(const Api::InviteLink &data, TimeId now);
@ -27,6 +28,7 @@ void AddSinglePeerRow(
rpl::producer<QString> status); rpl::producer<QString> status);
void AddPermanentLinkBlock( void AddPermanentLinkBlock(
std::shared_ptr<Ui::Show> show,
not_null<Ui::VerticalLayout*> container, not_null<Ui::VerticalLayout*> container,
not_null<PeerData*> peer, not_null<PeerData*> peer,
not_null<UserData*> admin, not_null<UserData*> admin,

View File

@ -899,6 +899,7 @@ void ManageInviteLinksBox(
AddSubsectionTitle(container, tr::lng_create_permanent_link_title()); AddSubsectionTitle(container, tr::lng_create_permanent_link_title());
AddPermanentLinkBlock( AddPermanentLinkBlock(
std::make_shared<Ui::BoxShow>(box),
container, container,
peer, peer,
admin, admin,

View File

@ -587,6 +587,7 @@ object_ptr<Ui::RpWidget> Controller::createInviteLinkBlock() {
AddSubsectionTitle(container, tr::lng_create_permanent_link_title()); AddSubsectionTitle(container, tr::lng_create_permanent_link_title());
} }
AddPermanentLinkBlock( AddPermanentLinkBlock(
_show,
container, container,
_peer, _peer,
_peer->session().user(), _peer->session().user(),