mirror of
https://github.com/aljazceru/khatru.git
synced 2026-01-17 04:04:21 +01:00
wait, we don't need to check if date is recent or anything, just if it is not nil.
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user