khatru/policies: fix tagName usage in PreventNormalDuplicates()

This commit is contained in:
fiatjaf
2026-02-18 10:43:33 -03:00
parent d445ba9919
commit 137c09369a
+2 -2
View File
@@ -153,12 +153,12 @@ func RejectUnprefixedNostrReferences(ctx context.Context, event nostr.Event) (bo
func PreventNormalDuplicates(query func(nostr.Filter, int) iter.Seq[nostr.Event]) func(ctx context.Context, event nostr.Event) (bool, string) {
exists := func(event nostr.Event, tagName string) bool {
hasAll := true
for e := range event.Tags.FindAll("e") {
for t := range event.Tags.FindAll(tagName) {
hasThis := false
for range query(nostr.Filter{
Authors: []nostr.PubKey{event.PubKey},
Kinds: []nostr.Kind{event.Kind},
Tags: nostr.TagMap{"e": []string{e[1]}},
Tags: nostr.TagMap{tagName: []string{t[1]}},
}, 1) {
hasThis = true
}