From 455ec79e58219196a4b410272bc1a7273b8e99c5 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 8 Oct 2023 15:49:11 -0300 Subject: [PATCH] NIP-50 search filter on req. --- req.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/req.go b/req.go index dec8c8b..674243b 100644 --- a/req.go +++ b/req.go @@ -73,6 +73,11 @@ standalone: Usage: "only accept up to this number of events", Category: CATEGORY_FILTER_ATTRIBUTES, }, + &cli.StringFlag{ + Name: "search", + Usage: "a NIP-50 search query, use it only with relays that explicitly support it", + Category: CATEGORY_FILTER_ATTRIBUTES, + }, &cli.BoolFlag{ Name: "bare", Usage: "when printing the filter, print just the filter, not enveloped in a [\"REQ\", ...] array", @@ -96,7 +101,9 @@ standalone: if kinds := c.IntSlice("kind"); len(kinds) > 0 { filter.Kinds = kinds } - + if search := c.String("search"); search != "" { + filter.Search = search + } tags := make([][]string, 0, 5) for _, tagFlag := range c.StringSlice("tag") { spl := strings.Split(tagFlag, "=")