Added support of level of boosts for restriction of sponsored messages.

This commit is contained in:
23rd 2024-03-25 00:19:55 +03:00 committed by John Preston
parent b5a7a351f6
commit f28f498467
3 changed files with 9 additions and 2 deletions

View File

@ -256,6 +256,12 @@ int LevelLimits::channelCustomWallpaperLevelMin() const {
10);
}
int LevelLimits::channelRestrictSponsoredLevelMin() const {
return _session->appConfig().get<int>(
u"channel_restrict_sponsored_level_min"_q,
20);
}
int LevelLimits::groupTranscribeLevelMin() const {
return _session->appConfig().get<int>(
u"group_transcribe_level_min"_q,

View File

@ -101,6 +101,7 @@ public:
[[nodiscard]] int channelEmojiStatusLevelMin() const;
[[nodiscard]] int channelWallpaperLevelMin() const;
[[nodiscard]] int channelCustomWallpaperLevelMin() const;
[[nodiscard]] int channelRestrictSponsoredLevelMin() const;
[[nodiscard]] int groupTranscribeLevelMin() const;
[[nodiscard]] int groupEmojiStickersLevelMin() const;
[[nodiscard]] int groupProfileBgIconLevelMin() const;

View File

@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "chat_helpers/stickers_emoji_pack.h"
#include "core/ui_integration.h" // Core::MarkedTextContext.
#include "data/data_peer.h"
#include "data/data_premium_limits.h"
#include "data/data_session.h"
#include "data/stickers/data_custom_emoji.h"
#include "info/channel_statistics/earn/info_earn_widget.h"
@ -839,9 +840,8 @@ void InnerWidget::fill() {
phrase(),
st::settingsButtonNoIcon));
constexpr auto kMinLevel = 30; // Debug.
AddLevelBadge(
kMinLevel,
Data::LevelLimits(session).channelRestrictSponsoredLevelMin(),
button,
nullptr,
channel,