2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Keep alternative video qualities list.

This commit is contained in:
John Preston
2024-10-25 10:01:26 +04:00
parent 19afb49fce
commit 7ba78540ac
9 changed files with 129 additions and 16 deletions

View File

@@ -3139,17 +3139,24 @@ not_null<DocumentData*> Session::document(DocumentId id) {
return i->second.get();
}
not_null<DocumentData*> Session::processDocument(const MTPDocument &data) {
not_null<DocumentData*> Session::processDocument(
const MTPDocument &data,
const MTPVector<MTPDocument> *qualities) {
return data.match([&](const MTPDdocument &data) {
return processDocument(data);
return processDocument(data, qualities);
}, [&](const MTPDdocumentEmpty &data) {
return document(data.vid().v);
});
}
not_null<DocumentData*> Session::processDocument(const MTPDdocument &data) {
not_null<DocumentData*> Session::processDocument(
const MTPDdocument &data,
const MTPVector<MTPDocument> *qualities) {
const auto result = document(data.vid().v);
documentApplyFields(result, data);
if (qualities) {
result->setVideoQualities(qualities->v);
}
return result;
}