Fix handling of 0 min boost level.
This commit is contained in:
parent
767336fb21
commit
02d1cef461
@ -462,10 +462,11 @@ ThemeManager::DialogBoostAvailableCounts ThemeManager::get_dialog_boost_availabl
|
|||||||
: Slice("channel_wallpaper_level_min"))) {
|
: Slice("channel_wallpaper_level_min"))) {
|
||||||
result.chat_theme_count_ = static_cast<int32>(chat_themes_.themes.size());
|
result.chat_theme_count_ = static_cast<int32>(chat_themes_.themes.size());
|
||||||
}
|
}
|
||||||
|
{
|
||||||
auto &min_boost_levels =
|
auto &min_boost_levels =
|
||||||
for_megagroup ? accent_colors_.min_megagroup_boost_levels_ : accent_colors_.min_broadcast_boost_levels_;
|
for_megagroup ? accent_colors_.min_megagroup_boost_levels_ : accent_colors_.min_broadcast_boost_levels_;
|
||||||
for (size_t i = 0; i < min_boost_levels.size(); i++) {
|
for (size_t i = 0; i < min_boost_levels.size(); i++) {
|
||||||
if (level >= min_boost_levels[i]) {
|
if (level >= min_boost_levels[i] && min_boost_levels[i] != 0) {
|
||||||
result.accent_color_count_++;
|
result.accent_color_count_++;
|
||||||
|
|
||||||
if (accent_colors_.accent_color_ids_[i].is_built_in()) {
|
if (accent_colors_.accent_color_ids_[i].is_built_in()) {
|
||||||
@ -480,13 +481,16 @@ ThemeManager::DialogBoostAvailableCounts ThemeManager::get_dialog_boost_availabl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
auto &min_profile_boost_levels = for_megagroup ? profile_accent_colors_.min_megagroup_boost_levels_
|
auto &min_profile_boost_levels = for_megagroup ? profile_accent_colors_.min_megagroup_boost_levels_
|
||||||
: profile_accent_colors_.min_broadcast_boost_levels_;
|
: profile_accent_colors_.min_broadcast_boost_levels_;
|
||||||
for (size_t i = 0; i < min_profile_boost_levels.size(); i++) {
|
for (size_t i = 0; i < min_profile_boost_levels.size(); i++) {
|
||||||
if (level >= min_profile_boost_levels[i]) {
|
if (level >= min_profile_boost_levels[i] && min_profile_boost_levels[i] != 0) {
|
||||||
result.profile_accent_color_count_++;
|
result.profile_accent_color_count_++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user