mirror of
https://github.com/lux-tel/session-ios.git
synced 2026-10-30 20:38:32 +00:00
• Linked up quote clearing • Removed the duplicate link preview loading and UI from the MediaMessageView (just use the input UI now) • Cleaned up how the InputView input types is handled a bit • Fixed an issue where link previews weren't rendering in the share extension
27 lines
958 B
Swift
27 lines
958 B
Swift
// Copyright © 2025 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
import Foundation
|
|
|
|
// MARK: - LinkPreviewManagerType
|
|
|
|
public protocol LinkPreviewManagerType {
|
|
var areLinkPreviewsEnabled: Bool { get async }
|
|
var hasSeenLinkPreviewSuggestion: Bool { get async }
|
|
|
|
func setHasSeenLinkPreviewSuggestion(_ value: Bool) async
|
|
func allPreviewUrls(forMessageBodyText body: String) async -> [String]
|
|
func previewUrl(for text: String?, selectedRange: NSRange?) async -> String?
|
|
func ensureLinkPreviewsEnabled() async throws
|
|
func tryToBuildPreviewInfo(previewUrl: String, skipImageDownload: Bool) async throws -> LinkPreviewViewModel
|
|
}
|
|
|
|
public extension LinkPreviewManagerType {
|
|
nonisolated static func isValidLinkUrl(_ urlString: String) -> Bool {
|
|
return (URL(string: urlString) != nil)
|
|
}
|
|
|
|
func previewUrl(for text: String?) async -> String? {
|
|
return await previewUrl(for: text, selectedRange: nil)
|
|
}
|
|
}
|