damus

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

commit 9e5209b48d0b38cdb9e6c593e544f0759e8bb3cf
parent 6bcea13d5a81864711d996b38934b52014635e2c
Author: Joel Klabo <joelklabo@gmail.com>
Date:   Thu,  5 Jan 2023 19:23:07 -0800

Hide the NIP-05 Domain in Follow List

Changelog-Chaged: Hide the NIP-05 Domain in Follow List
Closes: #267

Diffstat:
Mdamus/Views/FollowingView.swift | 2+-
Mdamus/Views/ProfileName.swift | 24+++++++++++++++---------
2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/damus/Views/FollowingView.swift b/damus/Views/FollowingView.swift @@ -24,7 +24,7 @@ struct FollowUserView: View { VStack(alignment: .leading) { let profile = damus_state.profiles.lookup(id: target.pubkey) - ProfileName(pubkey: target.pubkey, profile: profile, damus: damus_state, show_friend_confirmed: false) + ProfileName(pubkey: target.pubkey, profile: profile, damus: damus_state, show_friend_confirmed: false, show_nip5_domain: false) if let about = profile?.about { Text(FollowUserView.markdown.process(about)) .lineLimit(3) diff --git a/damus/Views/ProfileName.swift b/damus/Views/ProfileName.swift @@ -30,26 +30,29 @@ struct ProfileName: View { let prefix: String let show_friend_confirmed: Bool + let show_nip5_domain: Bool @State var display_name: String? @State var nip05: NIP05? @Environment(\.openURL) var openURL - - init(pubkey: String, profile: Profile?, damus: DamusState, show_friend_confirmed: Bool) { + + init(pubkey: String, profile: Profile?, damus: DamusState, show_friend_confirmed: Bool, show_nip5_domain: Bool = true) { self.pubkey = pubkey self.profile = profile self.prefix = "" self.show_friend_confirmed = show_friend_confirmed + self.show_nip5_domain = show_nip5_domain self.damus_state = damus } - init(pubkey: String, profile: Profile?, prefix: String, damus: DamusState, show_friend_confirmed: Bool) { + init(pubkey: String, profile: Profile?, prefix: String, damus: DamusState, show_friend_confirmed: Bool, show_nip5_domain: Bool = true) { self.pubkey = pubkey self.profile = profile self.prefix = prefix self.damus_state = damus self.show_friend_confirmed = show_friend_confirmed + self.show_nip5_domain = show_nip5_domain } var friend_icon: String? { @@ -72,13 +75,16 @@ struct ProfileName: View { if let nip05 = current_nip05 { Image(systemName: "checkmark.seal.fill") .foregroundColor(nip05_color) - Text(nip05.host) - .foregroundColor(nip05_color) - .onTapGesture { - if let nip5url = nip05.siteUrl { - openURL(nip5url) + + if show_nip5_domain { + Text(nip05.host) + .foregroundColor(nip05_color) + .onTapGesture { + if let nip5url = nip05.siteUrl { + openURL(nip5url) + } } - } + } } if let friend = friend_icon, current_nip05 == nil { Image(systemName: friend)