diff --git a/submodules/TelegramUI/Components/Chat/ChatMessageWebpageBubbleContentNode/Sources/ChatMessageWebpageBubbleContentNode.swift b/submodules/TelegramUI/Components/Chat/ChatMessageWebpageBubbleContentNode/Sources/ChatMessageWebpageBubbleContentNode.swift index e241f9d3bd..b90e86da91 100644 --- a/submodules/TelegramUI/Components/Chat/ChatMessageWebpageBubbleContentNode/Sources/ChatMessageWebpageBubbleContentNode.swift +++ b/submodules/TelegramUI/Components/Chat/ChatMessageWebpageBubbleContentNode/Sources/ChatMessageWebpageBubbleContentNode.swift @@ -89,7 +89,20 @@ public final class ChatMessageWebpageBubbleContentNode: ChatMessageBubbleContent case .automaticPlayback: openChatMessageMode = .automaticPlayback } - let _ = item.controllerInteraction.openMessage(item.message, openChatMessageMode) + if !item.controllerInteraction.openMessage(item.message, openChatMessageMode) { + if let webPage = strongSelf.webPage, case let .Loaded(content) = webPage.content { + var isConcealed = true + if item.message.text.contains(content.url) { + isConcealed = false + } + if let attribute = item.message.webpagePreviewAttribute { + if attribute.isSafe { + isConcealed = false + } + } + item.controllerInteraction.openUrl(ChatControllerInteraction.OpenUrl(url: content.url, concealed: isConcealed, progress: strongSelf.contentNode.makeProgress())) + } + } } } self.contentNode.activateAction = { [weak self] in diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index 3cc192ba82..7a8e039b3d 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -17995,8 +17995,11 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G } } else if let embedUrl = content.embedUrl, !embedUrl.isEmpty { progress?.set(.single(false)) - let _ = self.controllerInteraction?.openMessage(message, .default) - return + if let controllerInteraction = self.controllerInteraction { + if controllerInteraction.openMessage(message, .default) { + return + } + } } }