Fix WebPage reply preview.

Sometimes HistoryWebPage::hasReplyPreview() was returning true while
the HistoryWebPage::replyPreview() method was not offering anything.
This commit is contained in:
John Preston 2017-03-21 20:59:35 +03:00
parent bd121752f1
commit 743743ca10
2 changed files with 5 additions and 3 deletions

View File

@ -3010,6 +3010,10 @@ TextWithEntities HistoryWebPage::selectedText(TextSelection selection) const {
return titleResult;
}
bool HistoryWebPage::hasReplyPreview() const {
return _attach ? _attach->hasReplyPreview() : (_data->photo ? true : false);
}
ImagePtr HistoryWebPage::replyPreview() {
return _attach ? _attach->replyPreview() : (_data->photo ? _data->photo->makeReplyPreview() : ImagePtr());
}

View File

@ -726,9 +726,7 @@ public:
void attachToParent() override;
void detachFromParent() override;
bool hasReplyPreview() const override {
return (_data->photo && !_data->photo->thumb->isNull()) || (_data->document && !_data->document->thumb->isNull());
}
bool hasReplyPreview() const override;
ImagePtr replyPreview() override;
WebPageData *webpage() {