2017-04-27 19:04:45 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2017-04-27 19:04:45 +00:00
|
|
|
|
2018-01-03 10:23:14 +00:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2017-04-27 19:04:45 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "boxes/peer_list_box.h"
|
2021-01-21 15:57:12 +00:00
|
|
|
#include "ui/layers/generic_box.h"
|
2017-04-27 19:04:45 +00:00
|
|
|
|
2019-07-25 18:55:11 +00:00
|
|
|
namespace Window {
|
|
|
|
class SessionController;
|
|
|
|
} // namespace Window
|
|
|
|
|
2017-04-27 19:04:45 +00:00
|
|
|
namespace Calls {
|
|
|
|
|
2019-11-27 08:02:56 +00:00
|
|
|
class BoxController : public PeerListController, private base::Subscriber {
|
2017-04-27 19:04:45 +00:00
|
|
|
public:
|
2019-07-25 18:55:11 +00:00
|
|
|
explicit BoxController(not_null<Window::SessionController*> window);
|
|
|
|
|
|
|
|
Main::Session &session() const override;
|
2017-04-27 19:04:45 +00:00
|
|
|
void prepare() override;
|
2017-08-17 08:31:24 +00:00
|
|
|
void rowClicked(not_null<PeerListRow*> row) override;
|
|
|
|
void rowActionClicked(not_null<PeerListRow*> row) override;
|
2017-06-14 10:46:06 +00:00
|
|
|
void loadMoreRows() override;
|
2017-04-27 19:04:45 +00:00
|
|
|
|
2021-01-21 15:57:12 +00:00
|
|
|
base::unique_qptr<Ui::PopupMenu> rowContextMenu(
|
|
|
|
QWidget *parent,
|
|
|
|
not_null<PeerListRow*> row) override;
|
|
|
|
|
2017-04-27 19:04:45 +00:00
|
|
|
private:
|
|
|
|
void receivedCalls(const QVector<MTPMessage> &result);
|
|
|
|
void refreshAbout();
|
|
|
|
|
|
|
|
class Row;
|
2017-10-05 15:35:52 +00:00
|
|
|
Row *rowForItem(not_null<const HistoryItem*> item);
|
2017-04-27 19:04:45 +00:00
|
|
|
|
2017-04-27 21:17:00 +00:00
|
|
|
enum class InsertWay {
|
|
|
|
Append,
|
|
|
|
Prepend,
|
|
|
|
};
|
2017-10-05 15:35:52 +00:00
|
|
|
bool insertRow(not_null<HistoryItem*> item, InsertWay way);
|
|
|
|
std::unique_ptr<PeerListRow> createRow(
|
|
|
|
not_null<HistoryItem*> item) const;
|
2017-04-27 19:04:45 +00:00
|
|
|
|
2019-07-25 18:55:11 +00:00
|
|
|
const not_null<Window::SessionController*> _window;
|
2019-11-27 08:02:56 +00:00
|
|
|
MTP::Sender _api;
|
2019-07-25 18:55:11 +00:00
|
|
|
|
2017-04-27 19:04:45 +00:00
|
|
|
MsgId _offsetId = 0;
|
2020-02-21 11:51:37 +00:00
|
|
|
int _loadRequestId = 0; // Not a real mtpRequestId.
|
2017-04-27 19:04:45 +00:00
|
|
|
bool _allLoaded = false;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2021-01-21 15:57:12 +00:00
|
|
|
void ClearCallsBox(
|
|
|
|
not_null<Ui::GenericBox*> box,
|
|
|
|
not_null<Window::SessionController*> window);
|
|
|
|
|
2017-04-27 19:04:45 +00:00
|
|
|
} // namespace Calls
|