mirror of
https://github.com/aljazceru/khatru.git
synced 2026-02-09 15:04:22 +01:00
keep up with the latest specs for since/until filter
This commit is contained in:
@@ -74,12 +74,12 @@ func buildDsl(filter *nostr.Filter) ([]byte, error) {
|
||||
|
||||
// since
|
||||
if filter.Since != nil {
|
||||
dsl.Must(esquery.Range("event.created_at").Gt(filter.Since))
|
||||
dsl.Must(esquery.Range("event.created_at").Gte(filter.Since))
|
||||
}
|
||||
|
||||
// until
|
||||
if filter.Until != nil {
|
||||
dsl.Must(esquery.Range("event.created_at").Lt(filter.Until))
|
||||
dsl.Must(esquery.Range("event.created_at").Lte(filter.Until))
|
||||
}
|
||||
|
||||
// search
|
||||
|
||||
@@ -159,11 +159,11 @@ func (b PostgresBackend) queryEventsSql(filter *nostr.Filter, doCount bool) (str
|
||||
}
|
||||
|
||||
if filter.Since != nil {
|
||||
conditions = append(conditions, "created_at > ?")
|
||||
conditions = append(conditions, "created_at >= ?")
|
||||
params = append(params, filter.Since)
|
||||
}
|
||||
if filter.Until != nil {
|
||||
conditions = append(conditions, "created_at < ?")
|
||||
conditions = append(conditions, "created_at <= ?")
|
||||
params = append(params, filter.Until)
|
||||
}
|
||||
|
||||
|
||||
@@ -154,11 +154,11 @@ func queryEventsSql(filter *nostr.Filter, doCount bool) (string, []any, error) {
|
||||
}
|
||||
|
||||
if filter.Since != nil {
|
||||
conditions = append(conditions, "created_at > ?")
|
||||
conditions = append(conditions, "created_at >= ?")
|
||||
params = append(params, filter.Since)
|
||||
}
|
||||
if filter.Until != nil {
|
||||
conditions = append(conditions, "created_at < ?")
|
||||
conditions = append(conditions, "created_at <= ?")
|
||||
params = append(params, filter.Until)
|
||||
}
|
||||
if filter.Search != "" {
|
||||
|
||||
Reference in New Issue
Block a user