2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Added initial support for voice messages with TTL.

This commit is contained in:
23rd
2023-12-29 04:07:04 +03:00
committed by John Preston
parent c2712b0104
commit 85286684e3
10 changed files with 144 additions and 37 deletions

View File

@@ -752,13 +752,20 @@ void MainWidget::searchMessages(const QString &query, Dialogs::Key inChat) {
void MainWidget::handleAudioUpdate(const Media::Player::TrackState &state) {
using State = Media::Player::State;
const auto document = state.id.audio();
const auto item = session().data().message(state.id.contextId());
if (!Media::Player::IsStoppedOrStopping(state.state)) {
createPlayer();
const auto ttlSeconds = item
&& !item->out()
&& item->media()
&& item->media()->ttlSeconds();
if (!ttlSeconds) {
createPlayer();
}
} else if (state.state == State::StoppedAtStart) {
Media::Player::instance()->stopAndClose();
}
if (const auto item = session().data().message(state.id.contextId())) {
if (item) {
session().data().requestItemRepaint(item);
}
if (document) {