/* 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/peer_list_box.h" #include "ui/layers/generic_box.h" #include "mtproto/sender.h" namespace Window { class SessionController; } // namespace Window namespace Calls { namespace GroupCalls { class ListController : public PeerListController { public: explicit ListController(not_null window); [[nodiscard]] rpl::producer shownValue() const; Main::Session &session() const override; void prepare() override; void rowClicked(not_null row) override; void rowRightActionClicked(not_null row) override; private: const not_null _window; base::flat_map> _groupCalls; rpl::variable _fullCount; }; } // namespace GroupCalls class BoxController : public PeerListController { public: explicit BoxController(not_null window); Main::Session &session() const override; void prepare() override; void rowClicked(not_null row) override; void rowRightActionClicked(not_null row) override; void loadMoreRows() override; base::unique_qptr rowContextMenu( QWidget *parent, not_null row) override; private: void receivedCalls(const QVector &result); void refreshAbout(); class GroupCallRow; class Row; Row *rowForItem(not_null item); enum class InsertWay { Append, Prepend, }; bool insertRow(not_null item, InsertWay way); std::unique_ptr createRow( not_null item) const; const not_null _window; MTP::Sender _api; MsgId _offsetId = 0; int _loadRequestId = 0; // Not a real mtpRequestId. bool _allLoaded = false; }; void ClearCallsBox( not_null box, not_null window); } // namespace Calls