Various improvements

This commit is contained in:
Ilya Laktyushin
2024-06-17 21:15:41 +04:00
parent 10275ad968
commit ad3bed0a9f
22 changed files with 267 additions and 138 deletions

View File

@@ -23,6 +23,7 @@ public struct UserLimitsConfiguration: Equatable {
public var maxStoriesWeeklyCount: Int32
public var maxStoriesMonthlyCount: Int32
public var maxStoriesSuggestedReactions: Int32
public var maxStoriesLinksCount: Int32
public var maxGiveawayChannelsCount: Int32
public var maxGiveawayCountriesCount: Int32
public var maxGiveawayPeriodSeconds: Int32
@@ -51,6 +52,7 @@ public struct UserLimitsConfiguration: Equatable {
maxStoriesWeeklyCount: 7,
maxStoriesMonthlyCount: 30,
maxStoriesSuggestedReactions: 1,
maxStoriesLinksCount: 3,
maxGiveawayChannelsCount: 10,
maxGiveawayCountriesCount: 10,
maxGiveawayPeriodSeconds: 86400 * 31,
@@ -80,6 +82,7 @@ public struct UserLimitsConfiguration: Equatable {
maxStoriesWeeklyCount: Int32,
maxStoriesMonthlyCount: Int32,
maxStoriesSuggestedReactions: Int32,
maxStoriesLinksCount: Int32,
maxGiveawayChannelsCount: Int32,
maxGiveawayCountriesCount: Int32,
maxGiveawayPeriodSeconds: Int32,
@@ -106,6 +109,7 @@ public struct UserLimitsConfiguration: Equatable {
self.maxStoriesWeeklyCount = maxStoriesWeeklyCount
self.maxStoriesMonthlyCount = maxStoriesMonthlyCount
self.maxStoriesSuggestedReactions = maxStoriesSuggestedReactions
self.maxStoriesLinksCount = maxStoriesLinksCount
self.maxGiveawayChannelsCount = maxGiveawayChannelsCount
self.maxGiveawayCountriesCount = maxGiveawayCountriesCount
self.maxGiveawayPeriodSeconds = maxGiveawayPeriodSeconds
@@ -158,6 +162,7 @@ extension UserLimitsConfiguration {
self.maxStoriesWeeklyCount = getValue("stories_sent_weekly_limit", orElse: defaultValue.maxStoriesWeeklyCount)
self.maxStoriesMonthlyCount = getValue("stories_sent_monthly_limit", orElse: defaultValue.maxStoriesMonthlyCount)
self.maxStoriesSuggestedReactions = getValue("stories_suggested_reactions_limit", orElse: defaultValue.maxStoriesMonthlyCount)
self.maxStoriesLinksCount = getGeneralValue("stories_area_url_max", orElse: defaultValue.maxStoriesLinksCount)
self.maxGiveawayChannelsCount = getGeneralValue("giveaway_add_peers_max", orElse: defaultValue.maxGiveawayChannelsCount)
self.maxGiveawayCountriesCount = getGeneralValue("giveaway_countries_max", orElse: defaultValue.maxGiveawayCountriesCount)
self.maxGiveawayPeriodSeconds = getGeneralValue("giveaway_period_max", orElse: defaultValue.maxGiveawayPeriodSeconds)