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

Update API scheme, pass privacy info to viewer.

This commit is contained in:
John Preston
2023-07-19 12:30:34 +04:00
parent 585bbd45f4
commit ffd691e556
7 changed files with 61 additions and 19 deletions

View File

@@ -330,6 +330,7 @@ void DocumentData::setattributes(
_flags &= ~(Flag::ImageType
| Flag::HasAttachedStickers
| Flag::UseTextColor
| Flag::SilentVideo
| kStreamingSupportedMask);
_flags |= kStreamingSupportedUnknown;
@@ -402,6 +403,9 @@ void DocumentData::setattributes(
_duration = crl::time(
base::SafeRound(data.vduration().v * 1000));
setMaybeSupportsStreaming(data.is_supports_streaming());
if (data.is_nosound()) {
_flags |= Flag::SilentVideo;
}
dimensions = QSize(data.vw().v, data.vh().v);
}, [&](const MTPDdocumentAttributeAudio &data) {
if (type == FileDocument) {
@@ -1542,6 +1546,10 @@ bool DocumentData::isVideoFile() const {
return (type == VideoDocument);
}
bool DocumentData::isSilentVideo() const {
return _flags & Flag::SilentVideo;
}
crl::time DocumentData::duration() const {
return std::max(_duration, crl::time());
}