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
1 changed files with 3 additions and 1 deletions

View File

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