From 5f450ca9360757e3ba34a56f40e585232225b66f Mon Sep 17 00:00:00 2001 From: William Casarin Date: Sun, 30 Oct 2022 23:16:41 -0700 Subject: [PATCH] Add some missing code from previous commit Signed-off-by: William Casarin --- damus/Nostr/Nostr.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/damus/Nostr/Nostr.swift b/damus/Nostr/Nostr.swift index e3369bc..fa95ca1 100644 --- a/damus/Nostr/Nostr.swift +++ b/damus/Nostr/Nostr.swift @@ -13,6 +13,21 @@ struct Profile: Decodable { let display_name: String? let about: String? let picture: String? + let website: String? + let lud06: String? + let lud16: String? + + var lightning_uri: URL? { + if let url = (self.lud06.flatMap { URL(string: "lightning:" + $0) }) { + return url + } + + if let url = (self.lud16.flatMap { URL(string: "lightning:" + $0) }) { + return url + } + + return nil + } static func displayName(profile: Profile?, pubkey: String) -> String { return profile?.name ?? abbrev_pubkey(pubkey)