api_editing.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. namespace Data {
  10. struct WebPageDraft;
  11. } // namespace Data
  12. namespace MTP {
  13. class Error;
  14. } // namespace MTP
  15. namespace Api {
  16. struct SendOptions;
  17. struct RemoteFileInfo;
  18. const auto kDefaultEditMessagesErrors = {
  19. u"MESSAGE_ID_INVALID"_q,
  20. u"CHAT_ADMIN_REQUIRED"_q,
  21. u"MESSAGE_EDIT_TIME_EXPIRED"_q,
  22. };
  23. void RescheduleMessage(
  24. not_null<HistoryItem*> item,
  25. SendOptions options);
  26. void EditMessageWithUploadedDocument(
  27. HistoryItem *item,
  28. RemoteFileInfo info,
  29. SendOptions options);
  30. void EditMessageWithUploadedPhoto(
  31. HistoryItem *item,
  32. RemoteFileInfo info,
  33. SendOptions options);
  34. mtpRequestId EditCaption(
  35. not_null<HistoryItem*> item,
  36. const TextWithEntities &caption,
  37. SendOptions options,
  38. Fn<void()> done,
  39. Fn<void(const QString &)> fail);
  40. mtpRequestId EditTextMessage(
  41. not_null<HistoryItem*> item,
  42. const TextWithEntities &caption,
  43. Data::WebPageDraft webpage,
  44. SendOptions options,
  45. Fn<void(mtpRequestId requestId)> done,
  46. Fn<void(const QString &error, mtpRequestId requestId)> fail,
  47. bool spoilered);
  48. } // namespace Api