fetch: handle note1 case.

This commit is contained in:
fiatjaf 2024-08-25 17:09:42 -03:00
parent 29b6ecbafe
commit 6d23509d8c

View File

@ -2,6 +2,7 @@ package main
import ( import (
"context" "context"
"fmt"
"github.com/fiatjaf/cli/v3" "github.com/fiatjaf/cli/v3"
"github.com/nbd-wtf/go-nostr" "github.com/nbd-wtf/go-nostr"
@ -68,6 +69,8 @@ var fetch = &cli.Command{
authorHint = v.Author authorHint = v.Author
} }
relays = append(relays, v.Relays...) relays = append(relays, v.Relays...)
case "note":
filter.IDs = append(filter.IDs, value.(string))
case "naddr": case "naddr":
v := value.(nostr.EntityPointer) v := value.(nostr.EntityPointer)
filter.Tags = nostr.TagMap{"d": []string{v.Identifier}} filter.Tags = nostr.TagMap{"d": []string{v.Identifier}}
@ -83,6 +86,8 @@ var fetch = &cli.Command{
v := value.(string) v := value.(string)
filter.Authors = append(filter.Authors, v) filter.Authors = append(filter.Authors, v)
authorHint = v authorHint = v
default:
return fmt.Errorf("unexpected prefix %s", prefix)
} }
} }