mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
[WIP] Quotes and link previews
This commit is contained in:
@@ -382,7 +382,18 @@ func updatedChatEditInterfaceMessageState(state: ChatPresentationInterfaceState,
|
||||
var updated = state
|
||||
for media in message.media {
|
||||
if let webpage = media as? TelegramMediaWebpage, case let .Loaded(content) = webpage.content {
|
||||
updated = updated.updatedEditingUrlPreview((content.url, webpage))
|
||||
let attribute = message.attributes.first(where: { $0 is WebpagePreviewMessageAttribute }) as? WebpagePreviewMessageAttribute
|
||||
var positionBelowText = true
|
||||
if let leadingPreview = attribute?.leadingPreview {
|
||||
positionBelowText = !leadingPreview
|
||||
}
|
||||
let updatedPreview = ChatPresentationInterfaceState.UrlPreview(
|
||||
url: content.url,
|
||||
webPage: webpage,
|
||||
positionBelowText: positionBelowText,
|
||||
largeMedia: attribute?.forceLargeMedia
|
||||
)
|
||||
updated = updated.updatedEditingUrlPreview(updatedPreview)
|
||||
}
|
||||
}
|
||||
var isPlaintext = true
|
||||
|
||||
Reference in New Issue
Block a user