mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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);
|
10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int LevelLimits::channelRestrictSponsoredLevelMin() const {
|
||||||
|
return _session->appConfig().get<int>(
|
||||||
|
u"channel_restrict_sponsored_level_min"_q,
|
||||||
|
20);
|
||||||
|
}
|
||||||
|
|
||||||
int LevelLimits::groupTranscribeLevelMin() const {
|
int LevelLimits::groupTranscribeLevelMin() const {
|
||||||
return _session->appConfig().get<int>(
|
return _session->appConfig().get<int>(
|
||||||
u"group_transcribe_level_min"_q,
|
u"group_transcribe_level_min"_q,
|
||||||
|
|
|
@ -101,6 +101,7 @@ public:
|
||||||
[[nodiscard]] int channelEmojiStatusLevelMin() const;
|
[[nodiscard]] int channelEmojiStatusLevelMin() const;
|
||||||
[[nodiscard]] int channelWallpaperLevelMin() const;
|
[[nodiscard]] int channelWallpaperLevelMin() const;
|
||||||
[[nodiscard]] int channelCustomWallpaperLevelMin() const;
|
[[nodiscard]] int channelCustomWallpaperLevelMin() const;
|
||||||
|
[[nodiscard]] int channelRestrictSponsoredLevelMin() const;
|
||||||
[[nodiscard]] int groupTranscribeLevelMin() const;
|
[[nodiscard]] int groupTranscribeLevelMin() const;
|
||||||
[[nodiscard]] int groupEmojiStickersLevelMin() const;
|
[[nodiscard]] int groupEmojiStickersLevelMin() const;
|
||||||
[[nodiscard]] int groupProfileBgIconLevelMin() 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 "chat_helpers/stickers_emoji_pack.h"
|
||||||
#include "core/ui_integration.h" // Core::MarkedTextContext.
|
#include "core/ui_integration.h" // Core::MarkedTextContext.
|
||||||
#include "data/data_peer.h"
|
#include "data/data_peer.h"
|
||||||
|
#include "data/data_premium_limits.h"
|
||||||
#include "data/data_session.h"
|
#include "data/data_session.h"
|
||||||
#include "data/stickers/data_custom_emoji.h"
|
#include "data/stickers/data_custom_emoji.h"
|
||||||
#include "info/channel_statistics/earn/info_earn_widget.h"
|
#include "info/channel_statistics/earn/info_earn_widget.h"
|
||||||
|
@ -839,9 +840,8 @@ void InnerWidget::fill() {
|
||||||
phrase(),
|
phrase(),
|
||||||
st::settingsButtonNoIcon));
|
st::settingsButtonNoIcon));
|
||||||
|
|
||||||
constexpr auto kMinLevel = 30; // Debug.
|
|
||||||
AddLevelBadge(
|
AddLevelBadge(
|
||||||
kMinLevel,
|
Data::LevelLimits(session).channelRestrictSponsoredLevelMin(),
|
||||||
button,
|
button,
|
||||||
nullptr,
|
nullptr,
|
||||||
channel,
|
channel,
|
||||||
|
|
Loading…
Add table
Reference in a new issue