api_sending.h 1.3 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 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 SendExistingDocument(
  22. MessageToSend &&message,
  23. not_null<DocumentData*> document,
  24. std::optional<MsgId> localMessageId = std::nullopt);
  25. void SendExistingPhoto(
  26. MessageToSend &&message,
  27. not_null<PhotoData*> photo,
  28. std::optional<MsgId> localMessageId = std::nullopt);
  29. bool SendDice(MessageToSend &message);
  30. // We can't create Data::LocationPoint() and use it
  31. // for a local sending message, because we can't request
  32. // map thumbnail in messages history without access hash.
  33. void SendLocation(SendAction action, float64 lat, float64 lon);
  34. void SendVenue(SendAction action, Data::InputVenue venue);
  35. void FillMessagePostFlags(
  36. const SendAction &action,
  37. not_null<PeerData*> peer,
  38. MessageFlags &flags);
  39. void SendConfirmedFile(
  40. not_null<Main::Session*> session,
  41. const std::shared_ptr<FilePrepareResult> &file);
  42. } // namespace Api