Fix internal links opening in other nostr clients

This prevents internal links from opening in other nostr apps

Changelog-Fixed: Fixed internal links opening in other nostr clients
This commit is contained in:
William Casarin
2023-03-20 08:52:16 -06:00
parent 44a59e8d57
commit c582755246
3 changed files with 16 additions and 3 deletions

View File

@@ -127,6 +127,9 @@ func decode_nostr_uri(_ s: String) -> NostrLink? {
var uri = s.replacingOccurrences(of: "nostr://", with: "")
uri = uri.replacingOccurrences(of: "nostr:", with: "")
uri = s.replacingOccurrences(of: "damus://", with: "")
uri = uri.replacingOccurrences(of: "damus:", with: "")
let parts = uri.split(separator: ":")
.reduce(into: Array<String>()) { acc, str in
guard let decoded = str.removingPercentEncoding else {