/* 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/abstract_box.h" #include "ui/layers/generic_box.h" #include "mtproto/sender.h" namespace Window { class SessionController; } // namespace Window namespace Ui { template class RadioenumGroup; template class Radioenum; class InputField; } // namespace Ui class ReportBox final : public Ui::BoxContent { public: ReportBox(QWidget*, not_null peer); ReportBox(QWidget*, not_null peer, MessageIdsList ids); protected: void prepare() override; void setInnerFocus() override; void resizeEvent(QResizeEvent *e) override; private: enum class Reason { Spam, Fake, Violence, ChildAbuse, Pornography, Other, }; void reasonChanged(Reason reason); void reasonResized(); void updateMaxHeight(); void report(); void reportDone(const MTPBool &result); void reportFail(const RPCError &error); const not_null _peer; MTP::Sender _api; std::optional _ids; std::shared_ptr> _reasonGroup; object_ptr> _reasonSpam = { nullptr }; object_ptr> _reasonFake = { nullptr }; object_ptr> _reasonViolence = { nullptr }; object_ptr> _reasonChildAbuse = { nullptr }; object_ptr> _reasonPornography = { nullptr }; object_ptr> _reasonOther = { nullptr }; object_ptr _reasonOtherText = { nullptr }; mtpRequestId _requestId = 0; }; void BlockSenderFromRepliesBox( not_null box, not_null controller, FullMsgId id);