/* This file is part of Telegram Desktop, the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once #include "boxes/peers/edit_participants_box.h" #include "boxes/peers/add_participants_box.h" namespace Calls { class GroupCall; } // namespace Calls namespace Calls::Group { class InviteController final : public ParticipantsBoxController { public: InviteController( not_null peer, base::flat_set> alreadyIn); void prepare() override; void rowClicked(not_null row) override; base::unique_qptr rowContextMenu( QWidget *parent, not_null row) override; void itemDeselectedHook(not_null peer) override; [[nodiscard]] auto peersWithRows() const -> not_null>*>; [[nodiscard]] rpl::producer> rowAdded() const; [[nodiscard]] bool hasRowFor(not_null peer) const; private: [[nodiscard]] bool isAlreadyIn(not_null user) const; std::unique_ptr createRow( not_null participant) const override; not_null _peer; const base::flat_set> _alreadyIn; mutable base::flat_set> _inGroup; rpl::event_stream> _rowAdded; }; class InviteContactsController final : public AddParticipantsBoxController { public: InviteContactsController( not_null peer, base::flat_set> alreadyIn, not_null>*> inGroup, rpl::producer> discoveredInGroup); private: void prepareViewHook() override; std::unique_ptr createRow( not_null user) override; bool needsInviteLinkButton() override { return false; } const not_null>*> _inGroup; rpl::producer> _discoveredInGroup; rpl::lifetime _lifetime; }; [[nodiscard]] object_ptr PrepareInviteBox( not_null call, Fn showToast); } // namespace Calls::Group