mirror of
https://github.com/fiatjaf/nak.git
synced 2024-10-30 09:09:08 -04:00
NIP-50 search filter on req.
This commit is contained in:
parent
8d111e556e
commit
455ec79e58
9
req.go
9
req.go
|
@ -73,6 +73,11 @@ standalone:
|
||||||
Usage: "only accept up to this number of events",
|
Usage: "only accept up to this number of events",
|
||||||
Category: CATEGORY_FILTER_ATTRIBUTES,
|
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{
|
&cli.BoolFlag{
|
||||||
Name: "bare",
|
Name: "bare",
|
||||||
Usage: "when printing the filter, print just the filter, not enveloped in a [\"REQ\", ...] array",
|
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 {
|
if kinds := c.IntSlice("kind"); len(kinds) > 0 {
|
||||||
filter.Kinds = kinds
|
filter.Kinds = kinds
|
||||||
}
|
}
|
||||||
|
if search := c.String("search"); search != "" {
|
||||||
|
filter.Search = search
|
||||||
|
}
|
||||||
tags := make([][]string, 0, 5)
|
tags := make([][]string, 0, 5)
|
||||||
for _, tagFlag := range c.StringSlice("tag") {
|
for _, tagFlag := range c.StringSlice("tag") {
|
||||||
spl := strings.Split(tagFlag, "=")
|
spl := strings.Split(tagFlag, "=")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user