MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / readImageLocation

Function readImageLocation

Telegram/SourceFiles/storage/serialize_peer.cpp:94–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94std::optional<ImageLocation> readImageLocation(
95 int streamAppVersion,
96 QDataStream &stream) {
97 const auto legacy = readLegacyStorageImageLocationOrTag(
98 streamAppVersion,
99 stream);
100 if (legacy) {
101 return ImageLocation(
102 DownloadLocation{ legacy->file() },
103 legacy->width(),
104 legacy->height());
105 }
106 auto serialized = QByteArray();
107 stream >> serialized;
108 return (stream.status() == QDataStream::Ok)
109 ? ImageLocation::FromSerialized(serialized)
110 : std::nullopt;
111}
112
113uint32 peerSize(not_null<PeerData*> peer) {
114 uint32 result = sizeof(quint64) // id

Callers 4

readStickerSetsMethod · 0.85
readFromStreamHelperMethod · 0.85
readPeerFunction · 0.85
peekUserPhoneFunction · 0.85

Calls 6

ImageLocationClass · 0.85
QByteArrayClass · 0.85
widthMethod · 0.45
heightMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected