1
0
mirror of git://jb55.com/damus synced 2024-09-18 19:23:49 +00:00

Handle percent encoding of colon for some hashtags

This commit is contained in:
cr0bar 2023-07-10 21:29:11 +01:00 committed by William Casarin
parent 2353f97114
commit c1220f50af

View File

@ -116,8 +116,12 @@ func decode_nostr_uri(_ s: String) -> NostrLink? {
return decode_universal_link(s)
}
var uri = s.replacingOccurrences(of: "nostr://", with: "")
var uri = s
uri = uri.replacingOccurrences(of: "nostr://", with: "")
uri = uri.replacingOccurrences(of: "nostr:", with: "")
// Fix for non-latin characters resulting in second colon being encoded
uri = uri.replacingOccurrences(of: "damus:t%3A", with: "t:")
uri = uri.replacingOccurrences(of: "damus://", with: "")
uri = uri.replacingOccurrences(of: "damus:", with: "")