api_sending.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 History;
  9. class PhotoData;
  10. class DocumentData;
  11. struct FilePrepareResult;
  12. namespace Data {
  13. struct InputVenue;
  14. } // namespace Data
  15. namespace Main {
  16. class Session;
  17. } // namespace Main
  18. namespace Api {
  19. struct MessageToSend;
  20. struct SendAction;
  21. void SendMessage(
  22. not_null<History*> history,
  23. MessageToSend &&message,
  24. MessageFlags flags,
  25. MsgId replyTo,
  26. bool invertMedia);
  27. void SendExistingDocument(
  28. MessageToSend &&message,
  29. not_null<DocumentData*> document,
  30. std::optional<MsgId> localMessageId = std::nullopt);
  31. void SendExistingPhoto(
  32. MessageToSend &&message,
  33. not_null<PhotoData*> photo,
  34. std::optional<MsgId> localMessageId = std::nullopt);
  35. bool SendDice(MessageToSend &message);
  36. // We can't create Data::LocationPoint() and use it
  37. // for a local sending message, because we can't request
  38. // map thumbnail in messages history without access hash.
  39. void SendLocation(SendAction action, float64 lat, float64 lon);
  40. void SendVenue(SendAction action, Data::InputVenue venue);
  41. void FillMessagePostFlags(
  42. const SendAction &action,
  43. not_null<PeerData*> peer,
  44. MessageFlags &flags);
  45. void SendConfirmedFile(
  46. not_null<Main::Session*> session,
  47. const std::shared_ptr<FilePrepareResult> &file);
  48. } // namespace Api