Filter.LimitZero

This commit is contained in:
fiatjaf
2024-03-29 08:06:29 -03:00
parent a6e208ad49
commit 907cfd7846
3 changed files with 53 additions and 9 deletions
+4 -1
View File
@@ -129,6 +129,9 @@ func easyjson4d398eaaDecodeGithubComNbdWtfGoNostr(in *jlexer.Lexer, out *Filter)
}
case "limit":
out.Limit = int(in.Int())
if out.Limit == 0 {
out.LimitZero = true
}
case "search":
out.Search = string(in.String())
default:
@@ -243,7 +246,7 @@ func easyjson4d398eaaEncodeGithubComNbdWtfGoNostr(out *jwriter.Writer, in Filter
}
out.Int64(int64(*in.Until))
}
if in.Limit != 0 {
if in.Limit != 0 || in.LimitZero {
const prefix string = ",\"limit\":"
if first {
first = false