damus

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

commit 66db4c521576dcfcb5470d561d06ec4a88716adb
parent 1e2326cccf7ed51218f8701c521a0b9d3fccc25e
Author: William Casarin <jb55@jb55.com>
Date:   Tue, 27 Jun 2023 05:58:39 +0200

Revert "nozaps: don't show note zaps in notifications"

This reverts commit c5b0e539d8e1fc20c09508cbf4e4a23fd833883a.

Diffstat:
Mdamus/Views/Notifications/EventGroupView.swift | 34+++++++++++++---------------------
1 file changed, 13 insertions(+), 21 deletions(-)

diff --git a/damus/Views/Notifications/EventGroupView.swift b/damus/Views/Notifications/EventGroupView.swift @@ -56,16 +56,11 @@ enum ReactingTo { case your_profile } -func determine_reacting_to(our_pubkey: String, ev: NostrEvent?, group: EventGroupType, nozaps: Bool) -> ReactingTo { +func determine_reacting_to(our_pubkey: String, ev: NostrEvent?) -> ReactingTo { guard let ev else { return .your_profile } - if nozaps && group.is_note_zap { - // ZAPPING NOTES IS NOT ALLOWED!!!! EVIL!!! - return .your_profile - } - if ev.pubkey == our_pubkey { return .your_note } @@ -153,13 +148,13 @@ func event_group_unique_pubkeys(profiles: Profiles, group: EventGroupType) -> [S "zapped_your_profile_2" - returned when 2 zaps occurred to the current user's profile "zapped_your_profile_3" - returned when 3 or more zaps occurred to the current user's profile */ -func reacting_to_text(profiles: Profiles, our_pubkey: String, group: EventGroupType, ev: NostrEvent?, nozaps: Bool, pubkeys: [String], locale: Locale? = nil) -> String { - if pubkeys.count == 0 { +func reacting_to_text(profiles: Profiles, our_pubkey: String, group: EventGroupType, ev: NostrEvent?, locale: Locale? = nil, pubkeys: [String]) -> String { + if group.events.count == 0 { return "??" } let verb = reacting_to_verb(group: group) - let reacting_to = determine_reacting_to(our_pubkey: our_pubkey, ev: ev, group: group, nozaps: nozaps) + let reacting_to = determine_reacting_to(our_pubkey: our_pubkey, ev: ev) let localization_key = "\(verb)_\(reacting_to)_\(min(pubkeys.count, 3))" let format = localizedStringFormat(key: localization_key, locale: locale) @@ -199,7 +194,7 @@ struct EventGroupView: View { let group: EventGroupType func GroupDescription(_ pubkeys: [String]) -> some View { - Text(verbatim: "\(reacting_to_text(profiles: state.profiles, our_pubkey: state.pubkey, group: group, ev: event, nozaps: state.settings.nozaps, pubkeys: pubkeys))") + Text(verbatim: "\(reacting_to_text(profiles: state.profiles, our_pubkey: state.pubkey, group: group, ev: event, pubkeys: pubkeys))") } func ZapIcon(_ zapgrp: ZapGroup) -> some View { @@ -246,20 +241,17 @@ struct EventGroupView: View { if let event { let thread = ThreadModel(event: event, damus_state: state) let dest = ThreadView(state: state, thread: thread) - GroupDescription(unique_pubkeys) - if !state.settings.nozaps || !group.is_note_zap { - NavigationLink(destination: dest) { - VStack(alignment: .leading) { - EventBody(damus_state: state, event: event, size: .normal, options: [.truncate_content]) - .padding([.top], 1) - .padding([.trailing]) - .foregroundColor(.gray) - } + NavigationLink(destination: dest) { + VStack(alignment: .leading) { + GroupDescription(unique_pubkeys) + EventBody(damus_state: state, event: event, size: .normal, options: [.truncate_content]) + .padding([.top], 1) + .padding([.trailing]) + .foregroundColor(.gray) } - .buttonStyle(.plain) } + .buttonStyle(.plain) } else { - GroupDescription(unique_pubkeys) } } }