mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-26 07:22:12 +00:00
Allow sending videos with covers.
This commit is contained in:
@@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "data/data_streaming.h"
|
||||
#include "data/data_document_media.h"
|
||||
#include "data/data_reply_preview.h"
|
||||
#include "data/data_web_page.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "inline_bots/inline_bot_layout_item.h"
|
||||
#include "main/main_session.h"
|
||||
@@ -1881,3 +1882,18 @@ void DocumentData::collectLocalData(not_null<DocumentData*> local) {
|
||||
session().local().writeFileLocation(mediaKey(), _location);
|
||||
}
|
||||
}
|
||||
|
||||
PhotoData *LookupVideoCover(
|
||||
not_null<DocumentData*> document,
|
||||
HistoryItem *item) {
|
||||
const auto media = item ? item->media() : nullptr;
|
||||
if (const auto webpage = media ? media->webpage() : nullptr) {
|
||||
if (webpage->document == document && webpage->photoIsVideoCover) {
|
||||
return webpage->photo;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
return (media && media->document() == document)
|
||||
? media->videoCover()
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user