diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index c11995f288..367dadc515 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -2913,7 +2913,26 @@ void HistoryWidget::historyDownClicked() { } void HistoryWidget::showNextUnreadMention() { - showHistory(_peer->id, _history->getMinLoadedUnreadMention()); + const auto msgId = _history->getMinLoadedUnreadMention(); + const auto already = (_showAtMsgId == msgId); + + // Mark mention voice/video message as read. + // See https://github.com/telegramdesktop/tdesktop/issues/5623 + if (msgId && already) { + const auto item = _history->owner().message( + _history->channelId(), + msgId); + if (const auto media = item ? item->media() : nullptr) { + if (const auto document = media->document()) { + if (!media->webpage() + && (document->isVoiceMessage() + || document->isVideoMessage())) { + document->owner().markMediaRead(document); + } + } + } + } + showHistory(_peer->id, msgId); } void HistoryWidget::saveEditMsg() {