Various improvements

This commit is contained in:
Ilya Laktyushin
2023-07-15 02:38:57 +02:00
parent 2e6bc7f69d
commit ae60c2be8b
10 changed files with 113 additions and 21 deletions

View File

@@ -18,6 +18,7 @@ public struct UserLimitsConfiguration: Equatable {
public let maxSharedFolderInviteLinks: Int32
public let maxSharedFolderJoin: Int32
public let maxStoryCaptionLength: Int32
public let maxExpiringStoriesCount: Int32
public static var defaultValue: UserLimitsConfiguration {
return UserLimitsConfiguration(
@@ -36,7 +37,8 @@ public struct UserLimitsConfiguration: Equatable {
maxReactionsPerMessage: 1,
maxSharedFolderInviteLinks: 3,
maxSharedFolderJoin: 2,
maxStoryCaptionLength: 1024
maxStoryCaptionLength: 1024,
maxExpiringStoriesCount: 100
)
}
@@ -56,7 +58,8 @@ public struct UserLimitsConfiguration: Equatable {
maxReactionsPerMessage: Int32,
maxSharedFolderInviteLinks: Int32,
maxSharedFolderJoin: Int32,
maxStoryCaptionLength: Int32
maxStoryCaptionLength: Int32,
maxExpiringStoriesCount: Int32
) {
self.maxPinnedChatCount = maxPinnedChatCount
self.maxArchivedPinnedChatCount = maxArchivedPinnedChatCount
@@ -74,6 +77,7 @@ public struct UserLimitsConfiguration: Equatable {
self.maxSharedFolderInviteLinks = maxSharedFolderInviteLinks
self.maxSharedFolderJoin = maxSharedFolderJoin
self.maxStoryCaptionLength = maxStoryCaptionLength
self.maxExpiringStoriesCount = maxExpiringStoriesCount
}
}
@@ -114,5 +118,6 @@ extension UserLimitsConfiguration {
self.maxSharedFolderInviteLinks = getValue("chatlist_invites_limit", orElse: isPremium ? 100 : 3)
self.maxSharedFolderJoin = getValue("chatlists_joined_limit", orElse: isPremium ? 100 : 2)
self.maxStoryCaptionLength = getGeneralValue("story_caption_length_limit", orElse: defaultValue.maxStoryCaptionLength)
self.maxExpiringStoriesCount = getGeneralValue("story_expiring_limit", orElse: defaultValue.maxExpiringStoriesCount)
}
}