Fix parent link refresh for GIF webpage preview.

Fixes #4534.
This commit is contained in:
John Preston 2018-03-26 00:09:45 +04:00
parent efdd3df129
commit d9306e3e30
2 changed files with 12 additions and 1 deletions

View File

@ -2563,6 +2563,15 @@ void HistoryGif::updateStatusText() const {
}
}
void HistoryGif::refreshParentId(not_null<HistoryItem*> realParent) {
HistoryFileMedia::refreshParentId(realParent);
const auto fullId = realParent->fullId();
if (_openInMediaviewLink) {
_openInMediaviewLink->setMessageId(fullId);
}
}
QString HistoryGif::additionalInfoString() const {
if (_data->isVideoMessage()) {
updateStatusText();

View File

@ -389,6 +389,8 @@ public:
return MediaTypeGif;
}
void refreshParentId(not_null<HistoryItem*> 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<DocumentData*> _data;
ClickHandlerPtr _openInMediaviewLink;
FileClickHandlerPtr _openInMediaviewLink;
int _thumbw = 1;
int _thumbh = 1;
Text _caption;