Allow revealing spoilers in media viewer captions.

This commit is contained in:
John Preston 2022-09-23 23:38:47 +04:00
parent c67c53bcdf
commit bcfe4ac4a3
1 changed files with 6 additions and 0 deletions

View File

@ -2284,6 +2284,12 @@ void OverlayWidget::refreshCaption() {
: AddTimestampLinks(caption, duration, base)),
Ui::ItemTextOptions(_message),
context);
if (_caption.hasSpoilers()) {
const auto weak = Ui::MakeWeak(widget());
_caption.setSpoilerLinkFilter([=](const ClickContext &context) {
return (weak != nullptr);
});
}
}
void OverlayWidget::refreshGroupThumbs() {