diff --git a/Telegram/SourceFiles/history/history_media_types.cpp b/Telegram/SourceFiles/history/history_media_types.cpp index 83d8c8fa2..f33a7205c 100644 --- a/Telegram/SourceFiles/history/history_media_types.cpp +++ b/Telegram/SourceFiles/history/history_media_types.cpp @@ -2563,6 +2563,15 @@ void HistoryGif::updateStatusText() const { } } +void HistoryGif::refreshParentId(not_null realParent) { + HistoryFileMedia::refreshParentId(realParent); + + const auto fullId = realParent->fullId(); + if (_openInMediaviewLink) { + _openInMediaviewLink->setMessageId(fullId); + } +} + QString HistoryGif::additionalInfoString() const { if (_data->isVideoMessage()) { updateStatusText(); diff --git a/Telegram/SourceFiles/history/history_media_types.h b/Telegram/SourceFiles/history/history_media_types.h index ea967e8bf..269291f6d 100644 --- a/Telegram/SourceFiles/history/history_media_types.h +++ b/Telegram/SourceFiles/history/history_media_types.h @@ -389,6 +389,8 @@ public: return MediaTypeGif; } + void refreshParentId(not_null realParent) override; + void draw(Painter &p, const QRect &r, TextSelection selection, TimeMs ms) const override; TextState textState(QPoint point, StateRequest request) const override; @@ -466,7 +468,7 @@ private: bool isSeparateRoundVideo() const; not_null _data; - ClickHandlerPtr _openInMediaviewLink; + FileClickHandlerPtr _openInMediaviewLink; int _thumbw = 1; int _thumbh = 1; Text _caption;