downstream: fix inverted range in CHATHISTORY LATEST with a timestamp

This commit is contained in:
Petr Ročkai 2022-08-08 20:27:49 +02:00 committed by Simon Ser
parent 6fa8a1f30a
commit 5e56cc30c5

View file

@ -2913,8 +2913,10 @@ func (dc *downstreamConn) handleMessageRegistered(ctx context.Context, msg *irc.
var history []*irc.Message var history []*irc.Message
switch subcommand { switch subcommand {
case "BEFORE", "LATEST": case "BEFORE":
history, err = store.LoadBeforeTime(ctx, bounds[0], time.Time{}, &options) history, err = store.LoadBeforeTime(ctx, bounds[0], time.Time{}, &options)
case "LATEST":
history, err = store.LoadBeforeTime(ctx, time.Now(), bounds[0], &options)
case "AFTER": case "AFTER":
history, err = store.LoadAfterTime(ctx, bounds[0], time.Now(), &options) history, err = store.LoadAfterTime(ctx, bounds[0], time.Now(), &options)
case "BETWEEN": case "BETWEEN":