2017-04-27 19:04:45 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop version of Telegram messaging app, see https://telegram.org
|
|
|
|
|
|
|
|
Telegram Desktop is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
It is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
In addition, as a special exception, the copyright holders give permission
|
|
|
|
to link the code of portions of this program with the OpenSSL library.
|
|
|
|
|
|
|
|
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
|
|
|
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "boxes/peer_list_box.h"
|
|
|
|
|
|
|
|
namespace Calls {
|
|
|
|
|
2017-10-05 15:35:52 +00:00
|
|
|
class BoxController
|
|
|
|
: public PeerListController
|
|
|
|
, private base::Subscriber
|
|
|
|
, private MTP::Sender {
|
2017-04-27 19:04:45 +00:00
|
|
|
public:
|
|
|
|
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
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
MsgId _offsetId = 0;
|
|
|
|
mtpRequestId _loadRequestId = 0;
|
|
|
|
bool _allLoaded = false;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Calls
|