mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Added support of level of boosts for restriction of sponsored messages.
This commit is contained in:
parent
b5a7a351f6
commit
f28f498467
3 changed files with 9 additions and 2 deletions
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue