api_report.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. class HistoryItem;
  9. class PeerData;
  10. class PhotoData;
  11. namespace Ui {
  12. class Show;
  13. enum class ReportReason;
  14. } // namespace Ui
  15. namespace Data {
  16. struct ReportInput;
  17. } // namespace Data
  18. namespace Api {
  19. struct ReportResult final {
  20. using Id = QByteArray;
  21. struct Option final {
  22. Id id = 0;
  23. QString text;
  24. };
  25. using Options = std::vector<Option>;
  26. Options options;
  27. QString title;
  28. QString error;
  29. QString comment;
  30. struct CommentOption {
  31. bool optional = false;
  32. Id id = 0;
  33. };
  34. std::optional<CommentOption> commentOption;
  35. bool successful = false;
  36. };
  37. void SendPhotoReport(
  38. std::shared_ptr<Ui::Show> show,
  39. not_null<PeerData*> peer,
  40. Ui::ReportReason reason,
  41. const QString &comment,
  42. not_null<PhotoData*> photo);
  43. [[nodiscard]] auto CreateReportMessagesOrStoriesCallback(
  44. std::shared_ptr<Ui::Show> show,
  45. not_null<PeerData*> peer)
  46. -> Fn<void(Data::ReportInput, Fn<void(ReportResult)>)>;
  47. } // namespace Api