Various fixes

This commit is contained in:
Ilya Laktyushin
2024-08-01 22:08:52 +02:00
parent 4c697dcbfa
commit 90bba2d84a
15 changed files with 62 additions and 37 deletions

View File

@@ -381,13 +381,16 @@ func openChatMessageImpl(_ params: OpenChatMessageParams) -> Bool {
return false
}
func openChatInstantPageImpl(context: AccountContext, message: Message, sourcePeerType: MediaAutoDownloadPeerType?, navigationController: NavigationController) {
if let (webpage, anchor) = instantPageAndAnchor(message: message) {
let sourceLocation = InstantPageSourceLocation(userLocation: .peer(message.id.peerId), peerType: sourcePeerType ?? .channel)
let pageController = InstantPageController(context: context, webPage: webpage, sourceLocation: sourceLocation, anchor: anchor)
navigationController.pushViewController(pageController)
func makeInstantPageControllerImpl(context: AccountContext, message: Message, sourcePeerType: MediaAutoDownloadPeerType?, navigationController: NavigationController) -> ViewController? {
guard let (webpage, anchor) = instantPageAndAnchor(message: message) else {
return nil
}
let sourceLocation = InstantPageSourceLocation(userLocation: .peer(message.id.peerId), peerType: sourcePeerType ?? .channel)
return makeInstantPageControllerImpl(context: context, webPage: webpage, anchor: anchor, sourceLocation: sourceLocation, navigationController: navigationController)
}
func makeInstantPageControllerImpl(context: AccountContext, webPage: TelegramMediaWebpage, anchor: String?, sourceLocation: InstantPageSourceLocation, navigationController: NavigationController) -> ViewController {
return BrowserScreen(context: context, subject: .instantPage(webPage: webPage, anchor: anchor, sourceLocation: sourceLocation))
}
func openChatWallpaperImpl(context: AccountContext, message: Message, present: @escaping (ViewController, Any?) -> Void) {