Story premium metadata

This commit is contained in:
Ali 2023-08-10 22:57:19 +04:00
parent 2b254b508d
commit a46c372d68
4 changed files with 65 additions and 5 deletions

View File

@ -947,6 +947,11 @@ public enum PremiumIntroSource {
case fasterDownload
case translation
case stories
case storiesDownload
case storiesStealthMode
case storiesPermanentViews
case storiesFormatting
case storiesExpirationDurations
}
public enum PremiumDemoSubject {

View File

@ -190,6 +190,36 @@ public enum PremiumSource: Equatable {
} else {
return false
}
case .storiesDownload:
if case .storiesDownload = rhs {
return true
} else {
return false
}
case .storiesStealthMode:
if case .storiesStealthMode = rhs {
return true
} else {
return false
}
case .storiesPermanentViews:
if case .storiesPermanentViews = rhs {
return true
} else {
return false
}
case .storiesFormatting:
if case .storiesFormatting = rhs {
return true
} else {
return false
}
case .storiesExpirationDurations:
if case .storiesExpirationDurations = rhs {
return true
} else {
return false
}
}
}
@ -220,6 +250,11 @@ public enum PremiumSource: Equatable {
case linksPerSharedFolder
case membershipInSharedFolders
case stories
case storiesDownload
case storiesStealthMode
case storiesPermanentViews
case storiesFormatting
case storiesExpirationDurations
var identifier: String? {
switch self {
@ -279,6 +314,16 @@ public enum PremiumSource: Equatable {
return "double_limits__communities_joined"
case .stories:
return "stories"
case .storiesDownload:
return "stories__save_stories_to_gallery"
case .storiesStealthMode:
return "stories__stealth_mode"
case .storiesPermanentViews:
return "stories__permanent_views_history"
case .storiesFormatting:
return "stories__links_and_formatting"
case .storiesExpirationDurations:
return "stories__expiration_durations"
}
}
}

View File

@ -3047,7 +3047,7 @@ public final class StoryItemSetContainerComponent: Component {
guard let self else {
return
}
self.presentStoriesUpgradeScreen()
self.presentStoriesUpgradeScreen(source: .storiesPermanentViews)
},
setIsSearchActive: { [weak self] value in
guard let self else {
@ -4728,7 +4728,7 @@ public final class StoryItemSetContainerComponent: Component {
}
switch action {
case .info:
self.presentStoriesUpgradeScreen()
self.presentStoriesUpgradeScreen(source: .storiesDownload)
return true
default:
break
@ -4743,11 +4743,11 @@ public final class StoryItemSetContainerComponent: Component {
guard let self else {
return
}
self.presentStoriesUpgradeScreen()
self.presentStoriesUpgradeScreen(source: .storiesStealthMode)
})
}
private func presentStoriesUpgradeScreen() {
private func presentStoriesUpgradeScreen(source: PremiumSource) {
guard let component = self.component else {
return
}
@ -4761,7 +4761,7 @@ public final class StoryItemSetContainerComponent: Component {
return
}
let controller = PremiumIntroScreen(context: context, source: .stories, forceDark: true)
let controller = PremiumIntroScreen(context: context, source: source, forceDark: true)
self.sendMessageContext.actionSheet = controller
controller.wasDismissed = { [weak self, weak controller]in
guard let self else {

View File

@ -1779,6 +1779,16 @@ public final class SharedAccountContextImpl: SharedAccountContext {
mappedSource = .translation
case .stories:
mappedSource = .stories
case .storiesDownload:
mappedSource = .storiesDownload
case .storiesStealthMode:
mappedSource = .storiesStealthMode
case .storiesPermanentViews:
mappedSource = .storiesPermanentViews
case .storiesFormatting:
mappedSource = .storiesFormatting
case .storiesExpirationDurations:
mappedSource = .storiesExpirationDurations
}
return PremiumIntroScreen(context: context, source: mappedSource, forceDark: forceDark)
}