From 793ec840984583d28893db985ef23600dd94f253 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 29 Oct 2020 14:55:15 +0300 Subject: [PATCH] Fix pinned message of self-destruct media. --- Telegram/SourceFiles/history/history_service.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Telegram/SourceFiles/history/history_service.cpp b/Telegram/SourceFiles/history/history_service.cpp index b21206af7..25a733922 100644 --- a/Telegram/SourceFiles/history/history_service.cpp +++ b/Telegram/SourceFiles/history/history_service.cpp @@ -424,8 +424,15 @@ HistoryService::PreparedText HistoryService::preparePinnedText() { auto pinned = Get(); if (pinned && pinned->msg) { const auto mediaText = [&] { + using TTL = HistoryServiceSelfDestruct; if (const auto media = pinned->msg->media()) { return media->pinnedTextSubstring(); + } else if (const auto selfdestruct = pinned->msg->Get()) { + if (selfdestruct->type == TTL::Type::Photo) { + return tr::lng_action_pinned_media_photo(tr::now); + } else if (selfdestruct->type == TTL::Type::Video) { + return tr::lng_action_pinned_media_video(tr::now); + } } return QString(); }();