2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Added timestamp highlighting in voice captions.

This commit is contained in:
23rd
2021-02-25 16:20:32 +03:00
parent 092b6e7c18
commit 658671089e
3 changed files with 7 additions and 3 deletions

View File

@@ -428,7 +428,7 @@ bool OpenMediaTimestamp(
Core::App().showDocument(
document,
session->data().message(itemId));
} else if (document->isSong()) {
} else if (document->isSong() || document->isVoiceMessage()) {
Media::Player::instance()->play({ document, itemId });
}
return true;

View File

@@ -1498,7 +1498,10 @@ TextWithEntities HistoryMessage::withLocalEntities(
const auto document = reply->replyToDocumentId
? history()->owner().document(reply->replyToDocumentId).get()
: nullptr;
if (document && (document->isVideoFile() || document->isSong())) {
if (document
&& (document->isVideoFile()
|| document->isSong()
|| document->isVoiceMessage())) {
using namespace HistoryView;
const auto duration = document->getDuration();
const auto base = (duration > 0)

View File

@@ -1095,7 +1095,8 @@ TextWithEntities Document::getCaption() const {
}
Ui::Text::String Document::createCaption() {
const auto timestampLinksDuration = _data->isSong()
const auto timestampLinksDuration = (_data->isSong()
|| _data->isVoiceMessage())
? _data->getDuration()
: 0;
const auto timestampLinkBase = timestampLinksDuration