khatru/policies: fix tagName usage in PreventNormalDuplicates()
This commit is contained in:
@@ -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) {
|
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 {
|
exists := func(event nostr.Event, tagName string) bool {
|
||||||
hasAll := true
|
hasAll := true
|
||||||
for e := range event.Tags.FindAll("e") {
|
for t := range event.Tags.FindAll(tagName) {
|
||||||
hasThis := false
|
hasThis := false
|
||||||
for range query(nostr.Filter{
|
for range query(nostr.Filter{
|
||||||
Authors: []nostr.PubKey{event.PubKey},
|
Authors: []nostr.PubKey{event.PubKey},
|
||||||
Kinds: []nostr.Kind{event.Kind},
|
Kinds: []nostr.Kind{event.Kind},
|
||||||
Tags: nostr.TagMap{"e": []string{e[1]}},
|
Tags: nostr.TagMap{tagName: []string{t[1]}},
|
||||||
}, 1) {
|
}, 1) {
|
||||||
hasThis = true
|
hasThis = true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user