2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Use DocumentData::getDuration for all types.

This commit is contained in:
John Preston
2019-03-06 12:21:42 +04:00
parent 41c60419f1
commit 01d763eed1
11 changed files with 27 additions and 41 deletions

View File

@@ -400,7 +400,7 @@ Video::Video(
not_null<DocumentData*> video)
: RadialProgressItem(parent)
, _data(video)
, _duration(formatDurationText(_data->duration())) {
, _duration(formatDurationText(_data->getDuration())) {
setDocumentLinks(_data);
_data->loadThumbnail(parent->fullId());
}
@@ -837,9 +837,7 @@ void Voice::updateName() {
}
int Voice::duration() const {
return _data->voice()
? _data->voice()->duration
: std::max(_data->duration(), 0);
return std::max(_data->getDuration(), 0);
}
bool Voice::updateStatusText() {