serialize_peer.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. namespace Main {
  9. class Session;
  10. } // namespace Main
  11. namespace Serialize {
  12. int storageImageLocationSize(const StorageImageLocation &location);
  13. void writeStorageImageLocation(
  14. QDataStream &stream,
  15. const StorageImageLocation &location);
  16. // NB! This method can return StorageFileLocation with Type::Generic!
  17. // The reader should discard it or convert to one of the valid modern types.
  18. std::optional<StorageImageLocation> readStorageImageLocation(
  19. int streamAppVersion,
  20. QDataStream &stream);
  21. int imageLocationSize(const ImageLocation &location);
  22. void writeImageLocation(QDataStream &stream, const ImageLocation &location);
  23. // NB! This method can return StorageFileLocation with Type::Generic!
  24. // The reader should discard it or convert to one of the valid modern types.
  25. std::optional<ImageLocation> readImageLocation(
  26. int streamAppVersion,
  27. QDataStream &stream);
  28. uint32 peerSize(not_null<PeerData*> peer);
  29. void writePeer(QDataStream &stream, not_null<PeerData*> peer);
  30. PeerData *readPeer(
  31. not_null<Main::Session*> session,
  32. int streamAppVersion,
  33. QDataStream &stream);
  34. QString peekUserPhone(int streamAppVersion, QDataStream &stream);
  35. } // namespace Serialize