mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Add story stealth mode shortcut in chat list
This commit is contained in:
@@ -210,6 +210,8 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
|
||||
|
||||
private var sharedOpenStoryProgressDisposable = MetaDisposable()
|
||||
|
||||
var currentTooltipUpdateTimer: Foundation.Timer?
|
||||
|
||||
private var fullScreenEffectView: RippleEffectView?
|
||||
|
||||
public override func updateNavigationCustomData(_ data: Any?, progress: CGFloat, transition: ContainedViewLayoutTransition) {
|
||||
@@ -3082,20 +3084,29 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
|
||||
}
|
||||
})))
|
||||
|
||||
// items.append(.action(ContextMenuActionItem(text: presentationData.strings.StoryFeed_ViewAnonymously, icon: { theme in
|
||||
// return generateTintedImage(image: UIImage(bundleImageName: self.context.isPremium ? "Chat/Context Menu/Eye" : "Chat/Context Menu/EyeLocked"), color: theme.contextMenu.primaryColor)
|
||||
// }, action: { [weak self] _, a in
|
||||
// a(.default)
|
||||
//
|
||||
// guard let self else {
|
||||
// return
|
||||
// }
|
||||
// if self.context.isPremium {
|
||||
//// self.sendMessageContext.requestStealthMode(view: self)
|
||||
// } else {
|
||||
//// self.presentStealthModeUpgradeScreen()
|
||||
// }
|
||||
// })))
|
||||
items.append(.action(ContextMenuActionItem(text: presentationData.strings.StoryFeed_ViewAnonymously, icon: { theme in
|
||||
return generateTintedImage(image: UIImage(bundleImageName: self.context.isPremium ? "Chat/Context Menu/Eye" : "Chat/Context Menu/EyeLocked"), color: theme.contextMenu.primaryColor)
|
||||
}, action: { [weak self] _, a in
|
||||
a(.default)
|
||||
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
if self.context.isPremium {
|
||||
self.requestStealthMode(openStory: { [weak self] presentTooltip in
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
self.openStories(peerId: peer.id, completion: { storyController in
|
||||
presentTooltip(storyController)
|
||||
})
|
||||
})
|
||||
} else {
|
||||
self.presentStealthModeUpgrade(action: { [weak self] in
|
||||
self?.presentUpgradeStoriesScreen()
|
||||
})
|
||||
}
|
||||
})))
|
||||
|
||||
let hideText: String
|
||||
if self.location == .chatList(groupId: .archive) {
|
||||
@@ -3985,6 +3996,10 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
|
||||
}
|
||||
|
||||
public func openStories(peerId: EnginePeer.Id) {
|
||||
self.openStories(peerId: peerId, completion: { _ in })
|
||||
}
|
||||
|
||||
public func openStories(peerId: EnginePeer.Id, completion: @escaping (StoryContainerScreen) -> Void = { _ in }) {
|
||||
if let navigationBarView = self.chatListDisplayNode.navigationBarView.view as? ChatListNavigationBar.View {
|
||||
if navigationBarView.storiesUnlocked {
|
||||
self.shouldFixStorySubscriptionOrder = true
|
||||
@@ -4087,7 +4102,8 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
|
||||
self.sharedOpenStoryProgressDisposable.set(nil)
|
||||
componentView.storyPeerListView()?.setLoadingItem(peerId: peerId, signal: signal)
|
||||
}
|
||||
}
|
||||
},
|
||||
completion: completion
|
||||
)
|
||||
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user