mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fixed possible crash from voice messages with ttl.
This commit is contained in:
parent
2a8a74b5b1
commit
f53397e26a
1 changed files with 4 additions and 4 deletions
|
@ -326,13 +326,13 @@ Document::Document(
|
||||||
return (type == AudioMsgId::Type::Voice);
|
return (type == AudioMsgId::Type::Voice);
|
||||||
}) | rpl::to_empty
|
}) | rpl::to_empty
|
||||||
) | rpl::start_with_next([=]() mutable {
|
) | rpl::start_with_next([=]() mutable {
|
||||||
|
_drawTtl = nullptr;
|
||||||
const auto item = _parent->data();
|
const auto item = _parent->data();
|
||||||
// Destroys this.
|
|
||||||
ClearMediaAsExpired(_parent->data());
|
|
||||||
if (lifetime) {
|
if (lifetime) {
|
||||||
_drawTtl = nullptr;
|
|
||||||
base::take(lifetime)->destroy();
|
base::take(lifetime)->destroy();
|
||||||
}
|
}
|
||||||
|
// Destroys this.
|
||||||
|
ClearMediaAsExpired(item);
|
||||||
}, *lifetime);
|
}, *lifetime);
|
||||||
_drawTtl = CreateTtlPaintCallback(lifetime, [=] { repaint(); });
|
_drawTtl = CreateTtlPaintCallback(lifetime, [=] { repaint(); });
|
||||||
|
|
||||||
|
@ -437,7 +437,7 @@ QSize Document::countOptimalSize() {
|
||||||
const auto voice = Get<HistoryDocumentVoice>();
|
const auto voice = Get<HistoryDocumentVoice>();
|
||||||
if (voice) {
|
if (voice) {
|
||||||
const auto session = &_realParent->history()->session();
|
const auto session = &_realParent->history()->session();
|
||||||
if (IsVoiceOncePlayable(_parent->data())
|
if (_parent->data()->media()->ttlSeconds()
|
||||||
|| (!session->premium()
|
|| (!session->premium()
|
||||||
&& !session->api().transcribes().trialsSupport())) {
|
&& !session->api().transcribes().trialsSupport())) {
|
||||||
voice->transcribe = nullptr;
|
voice->transcribe = nullptr;
|
||||||
|
|
Loading…
Add table
Reference in a new issue