mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-29 11:25:38 +00:00
Story premium metadata
This commit is contained in:
parent
2b254b508d
commit
a46c372d68
@ -947,6 +947,11 @@ public enum PremiumIntroSource {
|
|||||||
case fasterDownload
|
case fasterDownload
|
||||||
case translation
|
case translation
|
||||||
case stories
|
case stories
|
||||||
|
case storiesDownload
|
||||||
|
case storiesStealthMode
|
||||||
|
case storiesPermanentViews
|
||||||
|
case storiesFormatting
|
||||||
|
case storiesExpirationDurations
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum PremiumDemoSubject {
|
public enum PremiumDemoSubject {
|
||||||
|
|||||||
@ -190,6 +190,36 @@ public enum PremiumSource: Equatable {
|
|||||||
} else {
|
} else {
|
||||||
return false
|
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 linksPerSharedFolder
|
||||||
case membershipInSharedFolders
|
case membershipInSharedFolders
|
||||||
case stories
|
case stories
|
||||||
|
case storiesDownload
|
||||||
|
case storiesStealthMode
|
||||||
|
case storiesPermanentViews
|
||||||
|
case storiesFormatting
|
||||||
|
case storiesExpirationDurations
|
||||||
|
|
||||||
var identifier: String? {
|
var identifier: String? {
|
||||||
switch self {
|
switch self {
|
||||||
@ -279,6 +314,16 @@ public enum PremiumSource: Equatable {
|
|||||||
return "double_limits__communities_joined"
|
return "double_limits__communities_joined"
|
||||||
case .stories:
|
case .stories:
|
||||||
return "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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3047,7 +3047,7 @@ public final class StoryItemSetContainerComponent: Component {
|
|||||||
guard let self else {
|
guard let self else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
self.presentStoriesUpgradeScreen()
|
self.presentStoriesUpgradeScreen(source: .storiesPermanentViews)
|
||||||
},
|
},
|
||||||
setIsSearchActive: { [weak self] value in
|
setIsSearchActive: { [weak self] value in
|
||||||
guard let self else {
|
guard let self else {
|
||||||
@ -4728,7 +4728,7 @@ public final class StoryItemSetContainerComponent: Component {
|
|||||||
}
|
}
|
||||||
switch action {
|
switch action {
|
||||||
case .info:
|
case .info:
|
||||||
self.presentStoriesUpgradeScreen()
|
self.presentStoriesUpgradeScreen(source: .storiesDownload)
|
||||||
return true
|
return true
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
@ -4743,11 +4743,11 @@ public final class StoryItemSetContainerComponent: Component {
|
|||||||
guard let self else {
|
guard let self else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
self.presentStoriesUpgradeScreen()
|
self.presentStoriesUpgradeScreen(source: .storiesStealthMode)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private func presentStoriesUpgradeScreen() {
|
private func presentStoriesUpgradeScreen(source: PremiumSource) {
|
||||||
guard let component = self.component else {
|
guard let component = self.component else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -4761,7 +4761,7 @@ public final class StoryItemSetContainerComponent: Component {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let controller = PremiumIntroScreen(context: context, source: .stories, forceDark: true)
|
let controller = PremiumIntroScreen(context: context, source: source, forceDark: true)
|
||||||
self.sendMessageContext.actionSheet = controller
|
self.sendMessageContext.actionSheet = controller
|
||||||
controller.wasDismissed = { [weak self, weak controller]in
|
controller.wasDismissed = { [weak self, weak controller]in
|
||||||
guard let self else {
|
guard let self else {
|
||||||
|
|||||||
@ -1779,6 +1779,16 @@ public final class SharedAccountContextImpl: SharedAccountContext {
|
|||||||
mappedSource = .translation
|
mappedSource = .translation
|
||||||
case .stories:
|
case .stories:
|
||||||
mappedSource = .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)
|
return PremiumIntroScreen(context: context, source: mappedSource, forceDark: forceDark)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user