2017-03-13 15:40:21 +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-03-13 15:40:21 +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-03-13 15:40:21 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "boxes/peer_list_box.h"
|
2017-03-16 15:14:01 +00:00
|
|
|
#include "boxes/edit_privacy_box.h"
|
2017-03-22 15:38:40 +00:00
|
|
|
#include "mtproto/sender.h"
|
2017-03-13 15:40:21 +00:00
|
|
|
|
|
|
|
namespace Settings {
|
|
|
|
|
2017-06-13 21:08:47 +00:00
|
|
|
class BlockedBoxController : public PeerListController, private base::Subscriber, private MTP::Sender {
|
2017-03-13 15:40:21 +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-03-13 15:40:21 +00:00
|
|
|
|
2017-06-13 21:08:47 +00:00
|
|
|
static void BlockNewUser();
|
|
|
|
|
2017-03-13 15:40:21 +00:00
|
|
|
private:
|
|
|
|
void receivedUsers(const QVector<MTPContactBlocked> &result);
|
|
|
|
void handleBlockedEvent(UserData *user);
|
2017-03-14 14:16:03 +00:00
|
|
|
|
2017-03-13 15:40:21 +00:00
|
|
|
bool appendRow(UserData *user);
|
|
|
|
bool prependRow(UserData *user);
|
2017-06-13 21:08:47 +00:00
|
|
|
std::unique_ptr<PeerListRow> createRow(UserData *user) const;
|
2017-03-13 15:40:21 +00:00
|
|
|
|
|
|
|
int _offset = 0;
|
|
|
|
mtpRequestId _loadRequestId = 0;
|
|
|
|
bool _allLoaded = false;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2017-03-16 15:15:07 +00:00
|
|
|
class LastSeenPrivacyController : public EditPrivacyBox::Controller, private base::Subscriber {
|
|
|
|
public:
|
|
|
|
using Option = EditPrivacyBox::Option;
|
2017-03-17 12:05:50 +00:00
|
|
|
using Exception = EditPrivacyBox::Exception;
|
2017-03-16 15:15:07 +00:00
|
|
|
|
|
|
|
MTPInputPrivacyKey key() override;
|
|
|
|
|
|
|
|
QString title() override;
|
|
|
|
QString description() override;
|
2017-03-19 08:29:05 +00:00
|
|
|
QString warning() override;
|
2017-03-17 12:05:50 +00:00
|
|
|
QString exceptionLinkText(Exception exception, int count) override;
|
|
|
|
QString exceptionBoxTitle(Exception exception) override;
|
2017-03-16 15:15:07 +00:00
|
|
|
QString exceptionsDescription() override;
|
|
|
|
|
2017-03-17 18:44:55 +00:00
|
|
|
void confirmSave(bool someAreDisallowed, base::lambda_once<void()> saveCallback) override;
|
|
|
|
|
2017-03-16 15:15:07 +00:00
|
|
|
};
|
|
|
|
|
2017-03-17 16:19:57 +00:00
|
|
|
class GroupsInvitePrivacyController : public EditPrivacyBox::Controller, private base::Subscriber {
|
|
|
|
public:
|
|
|
|
using Option = EditPrivacyBox::Option;
|
|
|
|
using Exception = EditPrivacyBox::Exception;
|
|
|
|
|
|
|
|
MTPInputPrivacyKey key() override;
|
|
|
|
|
|
|
|
QString title() override;
|
2017-03-19 08:29:05 +00:00
|
|
|
bool hasOption(Option option) override;
|
2017-03-17 16:19:57 +00:00
|
|
|
QString description() override;
|
|
|
|
QString exceptionLinkText(Exception exception, int count) override;
|
|
|
|
QString exceptionBoxTitle(Exception exception) override;
|
|
|
|
QString exceptionsDescription() override;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2017-04-29 15:32:01 +00:00
|
|
|
class CallsPrivacyController : public EditPrivacyBox::Controller, private base::Subscriber {
|
|
|
|
public:
|
|
|
|
using Option = EditPrivacyBox::Option;
|
|
|
|
using Exception = EditPrivacyBox::Exception;
|
|
|
|
|
|
|
|
MTPInputPrivacyKey key() override;
|
|
|
|
|
|
|
|
QString title() override;
|
|
|
|
QString description() override;
|
|
|
|
QString exceptionLinkText(Exception exception, int count) override;
|
|
|
|
QString exceptionBoxTitle(Exception exception) override;
|
|
|
|
QString exceptionsDescription() override;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2017-03-13 15:40:21 +00:00
|
|
|
} // namespace Settings
|