mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-08 08:31:13 +00:00
Fix non-interactive embed preview edge case
This commit is contained in:
parent
2bc324f131
commit
4ecd18e649
@ -89,7 +89,20 @@ public final class ChatMessageWebpageBubbleContentNode: ChatMessageBubbleContent
|
|||||||
case .automaticPlayback:
|
case .automaticPlayback:
|
||||||
openChatMessageMode = .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
|
self.contentNode.activateAction = { [weak self] in
|
||||||
|
@ -17995,8 +17995,11 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
}
|
}
|
||||||
} else if let embedUrl = content.embedUrl, !embedUrl.isEmpty {
|
} else if let embedUrl = content.embedUrl, !embedUrl.isEmpty {
|
||||||
progress?.set(.single(false))
|
progress?.set(.single(false))
|
||||||
let _ = self.controllerInteraction?.openMessage(message, .default)
|
if let controllerInteraction = self.controllerInteraction {
|
||||||
return
|
if controllerInteraction.openMessage(message, .default) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user