support fetch npub

This commit is contained in:
fiatjaf 2023-10-20 20:57:38 -03:00
parent 208d909727
commit 757a6eb313
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1

View File

@ -45,8 +45,14 @@ var fetch = &cli.Command{
case "nprofile": case "nprofile":
v := value.(nostr.ProfilePointer) v := value.(nostr.ProfilePointer)
filter.Authors = append(filter.Authors, v.PublicKey) filter.Authors = append(filter.Authors, v.PublicKey)
filter.Kinds = append(filter.Kinds, 0)
authorHint = v.PublicKey authorHint = v.PublicKey
relays = v.Relays relays = v.Relays
case "npub":
v := value.(string)
filter.Authors = append(filter.Authors, v)
filter.Kinds = append(filter.Kinds, 0)
authorHint = v
} }
pool := nostr.NewSimplePool(c.Context) pool := nostr.NewSimplePool(c.Context)