Merge pull request #24 from mattn/fix-d
Some checks failed
build cli / make-release (push) Has been cancelled
build cli / build-linux (push) Has been cancelled

fix checking d tag
This commit is contained in:
mattn
2024-07-16 09:57:04 +09:00
committed by GitHub

View File

@@ -44,7 +44,7 @@ func (w RelayWrapper) Publish(ctx context.Context, evt nostr.Event) error {
} else if 30000 <= evt.Kind && evt.Kind < 40000 {
// parameterized replaceable event, delete before storing
d := evt.Tags.GetFirst([]string{"d", ""})
if d != nil {
if d == nil {
return fmt.Errorf("failed to add event missing d tag for parameterized replacing")
}
ch, err := w.Store.QueryEvents(ctx, nostr.Filter{Authors: []string{evt.PubKey}, Kinds: []int{evt.Kind}, Tags: nostr.TagMap{"d": []string{d.Value()}}})