damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 5f450ca9360757e3ba34a56f40e585232225b66f
parent 3651ac67148c49a7fdf6278018db99abff45d1bb
Author: William Casarin <jb55@jb55.com>
Date:   Sun, 30 Oct 2022 23:16:41 -0700

Add some missing code from previous commit

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mdamus/Nostr/Nostr.swift | 15+++++++++++++++
1 file changed, 15 insertions(+), 0 deletions(-)

diff --git 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)