2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Display correct video / music state.

This commit is contained in:
John Preston
2019-03-01 15:16:55 +04:00
parent fde8dd9607
commit 648cd44ddd
17 changed files with 301 additions and 129 deletions

View File

@@ -301,7 +301,7 @@ void DocumentOpenClickHandler::Open(
location.accessDisable();
return;
} else if (data->canBePlayed()) {
if (data->isAudioFile()) {
if (data->isAudioFile() || data->isVoiceMessage()) {
Media::Player::instance()->playPause({ data, msgId });
} else {
Core::App().showDocument(data, context);
@@ -615,7 +615,9 @@ void DocumentData::replaceGoodThumbnail(
_goodThumbnail->replaceSource(std::move(source));
}
void DocumentData::setGoodThumbnail(QImage &&image, QByteArray &&bytes) {
void DocumentData::setGoodThumbnailOnUpload(
QImage &&image,
QByteArray &&bytes) {
Expects(uploadingData != nullptr);
if (image.isNull()) {
@@ -1215,7 +1217,10 @@ bool DocumentData::canBeStreamed() const {
}
bool DocumentData::canBePlayed() const {
return (isAnimation() || isVideoFile() || isAudioFile())
return (isAnimation()
|| isVideoFile()
|| isAudioFile()
|| isVoiceMessage())
&& (loaded() || canBeStreamed());
}