|
@@ -169,18 +169,10 @@ extension DocumentGalleryController {
|
|
|
|
|
|
func redirectToMessage(of indexPath: IndexPath) {
|
|
func redirectToMessage(of indexPath: IndexPath) {
|
|
let msgId = fileMessageIds[indexPath.row]
|
|
let msgId = fileMessageIds[indexPath.row]
|
|
|
|
+ let chatId = dcContext.getMessage(id: msgId).chatId
|
|
|
|
|
|
- guard
|
|
|
|
- let chatViewController = navigationController?.viewControllers.filter({ $0 is ChatViewController}).first as? ChatViewController,
|
|
|
|
- let chatListController = navigationController?.viewControllers.filter({ $0 is ChatListController}).first as? ChatListController
|
|
|
|
- else {
|
|
|
|
- safe_fatalError("failed to retrieve chatViewController, chatListController in navigation stack")
|
|
|
|
- return
|
|
|
|
|
|
+ if let appDelegate = UIApplication.shared.delegate as? AppDelegate {
|
|
|
|
+ appDelegate.appCoordinator.showChat(chatId: chatId, msgId: msgId, animated: false, clearViewControllerStack: true)
|
|
}
|
|
}
|
|
- self.navigationController?.viewControllers.remove(at: 1)
|
|
|
|
-
|
|
|
|
- chatViewController.highlightedMsg = msgId
|
|
|
|
- self.navigationController?.pushViewController(chatViewController, animated: true)
|
|
|
|
- self.navigationController?.setViewControllers([chatListController, chatViewController], animated: false)
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|