2022-06-15 22:24:10 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Main {
|
|
|
|
class Session;
|
|
|
|
} // namespace Main
|
|
|
|
|
|
|
|
namespace Data {
|
|
|
|
|
|
|
|
class PremiumLimits final {
|
|
|
|
public:
|
|
|
|
PremiumLimits(not_null<Main::Session*> session);
|
|
|
|
|
|
|
|
[[nodiscard]] int channelsDefault() const;
|
|
|
|
[[nodiscard]] int channelsPremium() const;
|
|
|
|
[[nodiscard]] int channelsCurrent() const;
|
|
|
|
|
2023-11-28 08:54:17 +00:00
|
|
|
[[nodiscard]] int similarChannelsDefault() const;
|
|
|
|
[[nodiscard]] int similarChannelsPremium() const;
|
|
|
|
[[nodiscard]] int similarChannelsCurrent() const;
|
|
|
|
|
2022-06-15 22:24:10 +00:00
|
|
|
[[nodiscard]] int gifsDefault() const;
|
|
|
|
[[nodiscard]] int gifsPremium() const;
|
|
|
|
[[nodiscard]] int gifsCurrent() const;
|
|
|
|
|
|
|
|
[[nodiscard]] int stickersFavedDefault() const;
|
|
|
|
[[nodiscard]] int stickersFavedPremium() const;
|
|
|
|
[[nodiscard]] int stickersFavedCurrent() const;
|
|
|
|
|
|
|
|
[[nodiscard]] int dialogFiltersDefault() const;
|
|
|
|
[[nodiscard]] int dialogFiltersPremium() const;
|
|
|
|
[[nodiscard]] int dialogFiltersCurrent() const;
|
|
|
|
|
2023-04-03 13:42:01 +00:00
|
|
|
[[nodiscard]] int dialogShareableFiltersDefault() const;
|
|
|
|
[[nodiscard]] int dialogShareableFiltersPremium() const;
|
|
|
|
[[nodiscard]] int dialogShareableFiltersCurrent() const;
|
|
|
|
|
2022-06-15 22:24:10 +00:00
|
|
|
[[nodiscard]] int dialogFiltersChatsDefault() const;
|
|
|
|
[[nodiscard]] int dialogFiltersChatsPremium() const;
|
|
|
|
[[nodiscard]] int dialogFiltersChatsCurrent() const;
|
|
|
|
|
2023-04-03 13:42:01 +00:00
|
|
|
[[nodiscard]] int dialogFiltersLinksDefault() const;
|
|
|
|
[[nodiscard]] int dialogFiltersLinksPremium() const;
|
|
|
|
[[nodiscard]] int dialogFiltersLinksCurrent() const;
|
|
|
|
|
2022-06-15 22:24:10 +00:00
|
|
|
[[nodiscard]] int dialogsPinnedDefault() const;
|
|
|
|
[[nodiscard]] int dialogsPinnedPremium() const;
|
|
|
|
[[nodiscard]] int dialogsPinnedCurrent() const;
|
|
|
|
|
|
|
|
[[nodiscard]] int dialogsFolderPinnedDefault() const;
|
|
|
|
[[nodiscard]] int dialogsFolderPinnedPremium() const;
|
|
|
|
[[nodiscard]] int dialogsFolderPinnedCurrent() const;
|
|
|
|
|
2022-12-01 17:44:32 +00:00
|
|
|
[[nodiscard]] int topicsPinnedCurrent() const;
|
|
|
|
|
2023-12-27 01:09:20 +00:00
|
|
|
[[nodiscard]] int savedSublistsPinnedDefault() const;
|
|
|
|
[[nodiscard]] int savedSublistsPinnedPremium() const;
|
|
|
|
[[nodiscard]] int savedSublistsPinnedCurrent() const;
|
|
|
|
|
2022-06-15 22:24:10 +00:00
|
|
|
[[nodiscard]] int channelsPublicDefault() const;
|
|
|
|
[[nodiscard]] int channelsPublicPremium() const;
|
|
|
|
[[nodiscard]] int channelsPublicCurrent() const;
|
|
|
|
|
|
|
|
[[nodiscard]] int captionLengthDefault() const;
|
|
|
|
[[nodiscard]] int captionLengthPremium() const;
|
|
|
|
[[nodiscard]] int captionLengthCurrent() const;
|
|
|
|
|
|
|
|
[[nodiscard]] int uploadMaxDefault() const;
|
|
|
|
[[nodiscard]] int uploadMaxPremium() const;
|
|
|
|
[[nodiscard]] int uploadMaxCurrent() const;
|
|
|
|
|
|
|
|
[[nodiscard]] int aboutLengthDefault() const;
|
|
|
|
[[nodiscard]] int aboutLengthPremium() const;
|
|
|
|
[[nodiscard]] int aboutLengthCurrent() const;
|
|
|
|
|
2023-11-29 14:25:27 +00:00
|
|
|
[[nodiscard]] int maxBoostLevel() const;
|
|
|
|
|
2022-06-15 22:24:10 +00:00
|
|
|
private:
|
|
|
|
[[nodiscard]] int appConfigLimit(
|
|
|
|
const QString &key,
|
2022-08-02 09:40:55 +00:00
|
|
|
int fallback) const;
|
2022-06-15 22:24:10 +00:00
|
|
|
[[nodiscard]] bool isPremium() const;
|
|
|
|
|
|
|
|
const not_null<Main::Session*> _session;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2024-03-06 23:27:15 +00:00
|
|
|
class LevelLimits final {
|
|
|
|
public:
|
|
|
|
LevelLimits(not_null<Main::Session*> session);
|
|
|
|
|
|
|
|
[[nodiscard]] int channelColorLevelMin() const;
|
|
|
|
[[nodiscard]] int channelBgIconLevelMin() const;
|
|
|
|
[[nodiscard]] int channelProfileBgIconLevelMin() const;
|
|
|
|
[[nodiscard]] int channelEmojiStatusLevelMin() const;
|
|
|
|
[[nodiscard]] int channelWallpaperLevelMin() const;
|
|
|
|
[[nodiscard]] int channelCustomWallpaperLevelMin() const;
|
2024-03-24 21:19:55 +00:00
|
|
|
[[nodiscard]] int channelRestrictSponsoredLevelMin() const;
|
2024-03-06 23:27:15 +00:00
|
|
|
[[nodiscard]] int groupTranscribeLevelMin() const;
|
|
|
|
[[nodiscard]] int groupEmojiStickersLevelMin() const;
|
|
|
|
[[nodiscard]] int groupProfileBgIconLevelMin() const;
|
|
|
|
[[nodiscard]] int groupEmojiStatusLevelMin() const;
|
|
|
|
[[nodiscard]] int groupWallpaperLevelMin() const;
|
|
|
|
[[nodiscard]] int groupCustomWallpaperLevelMin() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
const not_null<Main::Session*> _session;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2022-06-15 22:24:10 +00:00
|
|
|
} // namespace Data
|