mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-08 08:04:08 +02:00
Added timestamp highlighting in voice captions.
This commit is contained in:
parent
092b6e7c18
commit
658671089e
3 changed files with 7 additions and 3 deletions
|
@ -428,7 +428,7 @@ bool OpenMediaTimestamp(
|
||||||
Core::App().showDocument(
|
Core::App().showDocument(
|
||||||
document,
|
document,
|
||||||
session->data().message(itemId));
|
session->data().message(itemId));
|
||||||
} else if (document->isSong()) {
|
} else if (document->isSong() || document->isVoiceMessage()) {
|
||||||
Media::Player::instance()->play({ document, itemId });
|
Media::Player::instance()->play({ document, itemId });
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1498,7 +1498,10 @@ TextWithEntities HistoryMessage::withLocalEntities(
|
||||||
const auto document = reply->replyToDocumentId
|
const auto document = reply->replyToDocumentId
|
||||||
? history()->owner().document(reply->replyToDocumentId).get()
|
? history()->owner().document(reply->replyToDocumentId).get()
|
||||||
: nullptr;
|
: nullptr;
|
||||||
if (document && (document->isVideoFile() || document->isSong())) {
|
if (document
|
||||||
|
&& (document->isVideoFile()
|
||||||
|
|| document->isSong()
|
||||||
|
|| document->isVoiceMessage())) {
|
||||||
using namespace HistoryView;
|
using namespace HistoryView;
|
||||||
const auto duration = document->getDuration();
|
const auto duration = document->getDuration();
|
||||||
const auto base = (duration > 0)
|
const auto base = (duration > 0)
|
||||||
|
|
|
@ -1095,7 +1095,8 @@ TextWithEntities Document::getCaption() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
Ui::Text::String Document::createCaption() {
|
Ui::Text::String Document::createCaption() {
|
||||||
const auto timestampLinksDuration = _data->isSong()
|
const auto timestampLinksDuration = (_data->isSong()
|
||||||
|
|| _data->isVoiceMessage())
|
||||||
? _data->getDuration()
|
? _data->getDuration()
|
||||||
: 0;
|
: 0;
|
||||||
const auto timestampLinkBase = timestampLinksDuration
|
const auto timestampLinkBase = timestampLinksDuration
|
||||||
|
|
Loading…
Add table
Reference in a new issue