This commit is contained in:
Ali
2023-08-29 20:38:55 +04:00
parent fe3f5a4f54
commit 8130d9e937
35 changed files with 1326 additions and 245 deletions

View File

@@ -865,56 +865,6 @@ final class AuthorizedApplicationContext {
self.rootController.setViewControllers(controllers, animated: false)
self.rootController.chatListController?.openStoriesFromNotification(peerId: storyId.peerId, storyId: storyId.id)
/*if let chatListController = self.rootController.chatListController as? ChatListControllerImpl {
let _ = (chatListController.context.account.postbox.transaction { transaction -> Bool in
if let peer = transaction.getPeer(storyId.peerId) as? TelegramUser, let storiesHidden = peer.storiesHidden, storiesHidden {
return true
} else {
return false
}
}
|> deliverOnMainQueue).start(next: { [weak self] isArchived in
guard let self, let chatListController = self.rootController.chatListController as? ChatListControllerImpl else {
return
}
if isArchived {
if let navigationController = (chatListController.navigationController as? NavigationController) {
var viewControllers = navigationController.viewControllers
if let index = viewControllers.firstIndex(where: { c in
if let c = c as? ChatListControllerImpl {
if case .chatList(groupId: .archive) = c.location {
return true
}
}
return false
}) {
(viewControllers[index] as? ChatListControllerImpl)?.scrollToStories()
viewControllers.removeSubrange((index + 1) ..< viewControllers.count)
navigationController.setViewControllers(viewControllers, animated: false)
} else {
let archive = ChatListControllerImpl(context: chatListController.context, location: .chatList(groupId: .archive), controlsHistoryPreload: false, hideNetworkActivityStatus: false, previewing: false, enableDebugActions: false)
archive.onDidAppear = { [weak archive] in
Queue.mainQueue().after(0.1, {
guard let archive else {
return
}
if archive.hasStorySubscriptions {
archive.scrollToStoriesAnimated()
}
})
}
navigationController.pushViewController(archive, animated: false, completion: {})
}
}
} else {
chatListController.scrollToStories()
if let navigationController = (chatListController.navigationController as? NavigationController) {
navigationController.popToRoot(animated: true)
}
}
})
}*/
} else {
var visiblePeerId: PeerId?
if let controller = self.rootController.topViewController as? ChatControllerImpl, controller.chatLocation.peerId == peerId, controller.chatLocation.threadId == threadId {