From 638b9262eca00e4a3c700808f3f0a6e2deaced54 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 13 Feb 2022 08:42:09 -0300 Subject: [PATCH] wait, we don't need to check if date is recent or anything, just if it is not nil. --- basic/query.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/basic/query.go b/basic/query.go index 1eeaca9..ebdc0dc 100644 --- a/basic/query.go +++ b/basic/query.go @@ -7,7 +7,6 @@ import ( "fmt" "strconv" "strings" - "time" "github.com/fiatjaf/go-nostr" "github.com/rs/zerolog/log" @@ -115,12 +114,11 @@ func (b *BasicRelay) QueryEvents(filter *nostr.Filter) (events []nostr.Event, er "tagvalues && ARRAY["+strings.Join(arrayBuild, ",")+"]") } - aLongTimeAgo := time.Date(2022, 1, 1, 0, 0, 0, 0, time.UTC) - if filter.Since.Before(aLongTimeAgo) { + if filter.Since != nil { conditions = append(conditions, "created_at > ?") params = append(params, filter.Since.Unix()) } - if filter.Until.Before(aLongTimeAgo) { + if filter.Until != nil { conditions = append(conditions, "created_at < ?") params = append(params, filter.Until.Unix()) }