| 92 | } |
| 93 | |
| 94 | std::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 | |
| 113 | uint32 peerSize(not_null<PeerData*> peer) { |
| 114 | uint32 result = sizeof(quint64) // id |
no test coverage detected