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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user