This commit is contained in:
Simon Ser 2023-10-24 16:54:19 +02:00
parent d85424fe01
commit 8a2a9706f7

View File

@ -89,7 +89,7 @@ func (ms *dbMessageStore) Append(network *database.Network, entity string, msg *
}
func (ms *dbMessageStore) ListTargets(ctx context.Context, network *database.Network, start, end time.Time, limit int, events bool) ([]ChatHistoryTarget, error) {
var opts *database.MessageOptions
var opts *database.MessageOptions
if start.Before(end) {
opts = &database.MessageOptions{
AfterTime: start,
@ -103,10 +103,10 @@ func (ms *dbMessageStore) ListTargets(ctx context.Context, network *database.Net
BeforeTime: start,
Limit: limit,
Events: events,
TakeLast: true,
TakeLast: true,
}
}
l, err := ms.db.ListMessageLastPerTarget(ctx, network.ID, opts);
l, err := ms.db.ListMessageLastPerTarget(ctx, network.ID, opts)
if err != nil {
return nil, err
}