From 951db83ab613d4b10e8856781926e7484b7cfacd Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 8 Dec 2017 19:50:35 +0400 Subject: [PATCH] Index bad audio files to Shared Files Overview. Fixes #4120. --- .../history/history_media_types.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/Telegram/SourceFiles/history/history_media_types.cpp b/Telegram/SourceFiles/history/history_media_types.cpp index 7221feb04..7c994b1e6 100644 --- a/Telegram/SourceFiles/history/history_media_types.cpp +++ b/Telegram/SourceFiles/history/history_media_types.cpp @@ -1590,10 +1590,8 @@ int32 HistoryDocument::addToOverview(AddToOverviewMethod method) { if (_data->voice()) { result |= addToOneOverview(OverviewVoiceFiles, method); result |= addToOneOverview(OverviewRoundVoiceFiles, method); - } else if (_data->song()) { - if (_data->isMusic()) { - result |= addToOneOverview(OverviewMusicFiles, method); - } + } else if (_data->isMusic()) { + result |= addToOneOverview(OverviewMusicFiles, method); } else { result |= addToOneOverview(OverviewFiles, method); } @@ -1604,10 +1602,8 @@ void HistoryDocument::eraseFromOverview() { if (_data->voice()) { eraseFromOneOverview(OverviewVoiceFiles); eraseFromOneOverview(OverviewRoundVoiceFiles); - } else if (_data->song()) { - if (_data->isMusic()) { - eraseFromOneOverview(OverviewMusicFiles); - } + } else if (_data->isMusic()) { + eraseFromOneOverview(OverviewMusicFiles); } else { eraseFromOneOverview(OverviewFiles); } @@ -1619,11 +1615,8 @@ Storage::SharedMediaTypesMask HistoryDocument::sharedMediaTypes() const { return Storage::SharedMediaTypesMask{} .added(Type::VoiceFile) .added(Type::RoundVoiceFile); - } else if (_data->song()) { - if (_data->isMusic()) { - return Type::MusicFile; - } - return {}; + } else if (_data->isMusic()) { + return Type::MusicFile; } return Type::File; }