backfill: fix forward backfill

only skip too new messages if we're actually doing backwards backfill
This commit is contained in:
Adam Van Ymeren
2025-07-03 21:42:33 -07:00
parent 399cd5585a
commit d4239d520a
+1 -1
View File
@@ -282,7 +282,7 @@ func (t *TelegramClient) FetchMessages(ctx context.Context, fetchParams bridgev2
// message, don't convert any more messages.
log.Debug().Msg("stopping at anchor message")
break
} else if msg.GetID() >= stopAt {
} else if !fetchParams.Forward && msg.GetID() >= stopAt {
// If we are doing backwards backfill and we get a message more
// recent than the anchor message, skip it.
log.Debug().Msg("skipping message past anchor message")