2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Extract sticker-specific HistoryView code.

This commit is contained in:
John Preston
2019-08-02 16:06:44 +01:00
parent 850940116d
commit 1d52ba7a42
11 changed files with 531 additions and 362 deletions

View File

@@ -769,7 +769,11 @@ std::unique_ptr<HistoryView::Media> MediaFile::createView(
not_null<HistoryView::Element*> message,
not_null<HistoryItem*> realParent) {
if (_document->sticker()) {
return std::make_unique<HistoryView::Sticker>(message, _document);
return std::make_unique<HistoryView::UnwrappedMedia>(
message,
std::make_unique<HistoryView::StickerContent>(
message,
_document));
} else if (_document->isAnimation()) {
return std::make_unique<HistoryView::Gif>(message, _document);
} else if (_document->isVideoFile()) {