2016-06-06 10:29:51 +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.
|
2016-06-06 10:29:51 +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
|
2016-06-06 10:29:51 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2017-04-06 14:38:10 +00:00
|
|
|
#include "boxes/abstract_box.h"
|
2020-09-17 13:26:53 +00:00
|
|
|
#include "ui/layers/generic_box.h"
|
2020-06-11 16:09:46 +00:00
|
|
|
#include "mtproto/sender.h"
|
2016-06-06 10:29:51 +00:00
|
|
|
|
2020-09-17 13:26:53 +00:00
|
|
|
namespace Window {
|
|
|
|
class SessionController;
|
|
|
|
} // namespace Window
|
|
|
|
|
2016-10-28 09:20:24 +00:00
|
|
|
namespace Ui {
|
2017-03-18 21:06:10 +00:00
|
|
|
template <typename Enum>
|
|
|
|
class RadioenumGroup;
|
|
|
|
template <typename Enum>
|
|
|
|
class Radioenum;
|
2018-05-20 17:42:30 +00:00
|
|
|
class InputField;
|
2016-10-28 09:20:24 +00:00
|
|
|
} // namespace Ui
|
|
|
|
|
2020-06-11 16:09:46 +00:00
|
|
|
class ReportBox final : public Ui::BoxContent {
|
2016-06-06 10:29:51 +00:00
|
|
|
public:
|
2018-05-10 14:15:16 +00:00
|
|
|
ReportBox(QWidget*, not_null<PeerData*> peer);
|
|
|
|
ReportBox(QWidget*, not_null<PeerData*> peer, MessageIdsList ids);
|
2016-06-06 10:29:51 +00:00
|
|
|
|
|
|
|
protected:
|
2016-12-13 17:07:56 +00:00
|
|
|
void prepare() override;
|
|
|
|
void setInnerFocus() override;
|
2016-06-06 10:29:51 +00:00
|
|
|
|
2016-12-13 17:07:56 +00:00
|
|
|
void resizeEvent(QResizeEvent *e) override;
|
2016-06-06 10:29:51 +00:00
|
|
|
|
|
|
|
private:
|
2017-03-18 21:06:10 +00:00
|
|
|
enum class Reason {
|
|
|
|
Spam,
|
2021-01-26 08:15:00 +00:00
|
|
|
Fake,
|
2017-03-18 21:06:10 +00:00
|
|
|
Violence,
|
2019-03-25 12:07:31 +00:00
|
|
|
ChildAbuse,
|
2017-03-18 21:06:10 +00:00
|
|
|
Pornography,
|
|
|
|
Other,
|
|
|
|
};
|
|
|
|
void reasonChanged(Reason reason);
|
2018-05-31 12:20:28 +00:00
|
|
|
void reasonResized();
|
2016-06-06 10:29:51 +00:00
|
|
|
void updateMaxHeight();
|
2018-05-31 12:20:28 +00:00
|
|
|
void report();
|
2016-06-06 10:29:51 +00:00
|
|
|
|
|
|
|
void reportDone(const MTPBool &result);
|
2020-06-11 16:09:46 +00:00
|
|
|
void reportFail(const RPCError &error);
|
2016-06-06 10:29:51 +00:00
|
|
|
|
2020-06-11 16:09:46 +00:00
|
|
|
const not_null<PeerData*> _peer;
|
|
|
|
MTP::Sender _api;
|
2018-09-21 16:28:46 +00:00
|
|
|
std::optional<MessageIdsList> _ids;
|
2016-06-06 10:29:51 +00:00
|
|
|
|
2017-03-18 21:06:10 +00:00
|
|
|
std::shared_ptr<Ui::RadioenumGroup<Reason>> _reasonGroup;
|
2018-05-10 14:15:16 +00:00
|
|
|
object_ptr<Ui::Radioenum<Reason>> _reasonSpam = { nullptr };
|
2021-01-26 08:15:00 +00:00
|
|
|
object_ptr<Ui::Radioenum<Reason>> _reasonFake = { nullptr };
|
2018-05-10 14:15:16 +00:00
|
|
|
object_ptr<Ui::Radioenum<Reason>> _reasonViolence = { nullptr };
|
2019-03-25 12:07:31 +00:00
|
|
|
object_ptr<Ui::Radioenum<Reason>> _reasonChildAbuse = { nullptr };
|
2018-05-10 14:15:16 +00:00
|
|
|
object_ptr<Ui::Radioenum<Reason>> _reasonPornography = { nullptr };
|
|
|
|
object_ptr<Ui::Radioenum<Reason>> _reasonOther = { nullptr };
|
2018-05-20 17:42:30 +00:00
|
|
|
object_ptr<Ui::InputField> _reasonOtherText = { nullptr };
|
2016-06-06 10:29:51 +00:00
|
|
|
|
|
|
|
mtpRequestId _requestId = 0;
|
|
|
|
|
|
|
|
};
|
2020-09-17 13:26:53 +00:00
|
|
|
|
|
|
|
void BlockSenderFromRepliesBox(
|
|
|
|
not_null<Ui::GenericBox*> box,
|
|
|
|
not_null<Window::SessionController*> controller,
|
2020-09-25 12:31:36 +00:00
|
|
|
FullMsgId id);
|