2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Added initial ability to transcribe video messages.

This commit is contained in:
23rd
2022-10-23 22:02:19 +03:00
committed by John Preston
parent b4a9705564
commit 579b20fff7
13 changed files with 134 additions and 21 deletions

View File

@@ -381,6 +381,10 @@ void DocumentData::setattributes(
type = data.is_round_message()
? RoundVideoDocument
: VideoDocument;
if (data.is_round_message()) {
_additional = std::make_unique<RoundData>();
round()->duration = data.vduration().v;
}
} else if (const auto info = sticker()) {
info->type = StickerType::Webm;
}
@@ -397,7 +401,7 @@ void DocumentData::setattributes(
_additional = std::make_unique<SongData>();
}
}
if (const auto voiceData = voice()) {
if (const auto voiceData = voice() ? voice() : round()) {
voiceData->duration = data.vduration().v;
voiceData->waveform = documentWaveformDecode(
data.vwaveform().value_or_empty());
@@ -1252,6 +1256,16 @@ const VoiceData *DocumentData::voice() const {
return const_cast<DocumentData*>(this)->voice();
}
RoundData *DocumentData::round() {
return isVideoMessage()
? static_cast<RoundData*>(_additional.get())
: nullptr;
}
const RoundData *DocumentData::round() const {
return const_cast<DocumentData*>(this)->round();
}
bool DocumentData::hasRemoteLocation() const {
return (_dc != 0 && _access != 0);
}