From af3d440f5a9efd7a282f8960b7f3ffdf0cd9ca33 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Fri, 2 Aug 2024 12:36:22 +0200 Subject: [PATCH] Fix story link --- .../MediaEditor/Sources/Drawing/CodableDrawingEntity.swift | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/submodules/TelegramUI/Components/MediaEditor/Sources/Drawing/CodableDrawingEntity.swift b/submodules/TelegramUI/Components/MediaEditor/Sources/Drawing/CodableDrawingEntity.swift index b930925be4..811350c9c9 100644 --- a/submodules/TelegramUI/Components/MediaEditor/Sources/Drawing/CodableDrawingEntity.swift +++ b/submodules/TelegramUI/Components/MediaEditor/Sources/Drawing/CodableDrawingEntity.swift @@ -1,5 +1,6 @@ import Foundation import TelegramCore +import UrlEscaping public func decodeCodableDrawingEntities(data: Data) -> [CodableDrawingEntity] { if let codableEntities = try? JSONDecoder().decode([CodableDrawingEntity].self, from: data) { @@ -183,13 +184,9 @@ public enum CodableDrawingEntity: Equatable { return nil } case let .link(entity): - var url = entity.url - if !url.hasPrefix("http://") && !url.hasPrefix("https://") { - url = "https://\(url)" - } return .link( coordinates: coordinates, - url: url + url: explicitUrl(entity.url) ) case let .weather(entity): let color: UInt32