From b563f7285bebf06775cffeafbf6b7d9ec606c001 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Tue, 18 Aug 2026 13:32:52 +0900 Subject: [PATCH] fetch: don't rewrite a web address's server-provided filter to kind 0 when it has authors but no kinds. --- fetch.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fetch.go b/fetch.go index 1344028..c27ccc3 100644 --- a/fetch.go +++ b/fetch.go @@ -46,6 +46,7 @@ var fetch = &cli.Command{ filter := nostr.Filter{} var authorHint nostr.PubKey relays := c.StringSlice("relay") + authoritativeFilter := false if strings.HasPrefix(code, "http://") || strings.HasPrefix(code, "https://") || isWebAddress(code) { @@ -59,6 +60,7 @@ var fetch = &cli.Command{ continue } filter = webPath.Filter + authoritativeFilter = true if len(webPath.Filter.Authors) > 0 { authorHint = webPath.Filter.Authors[0] } @@ -130,7 +132,9 @@ var fetch = &cli.Command{ return err } - if len(filter.Authors) > 0 && len(filter.Kinds) == 0 { + // default to fetching just the profile when given only an author, + // but not when the filter came ready-made from a web address + if !authoritativeFilter && len(filter.Authors) > 0 && len(filter.Kinds) == 0 { filter.Kinds = append(filter.Kinds, 0) }