Skip to content

Commit

Permalink
Add log when unread hours threshold applies
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jan 29, 2024
1 parent aa16a8d commit b48fea0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions backfill.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,11 @@ func (portal *Portal) convertAndSendBackfill(ctx context.Context, source *User,
}
if unreadHoursThreshold := portal.bridge.Config.Bridge.Backfill.UnreadHoursThreshold; unreadHoursThreshold > 0 && !markRead && len(messages) > 0 {
markRead = messages[len(messages)-1].TimestampMs < time.Now().Add(-time.Duration(unreadHoursThreshold)*time.Hour).UnixMilli()
if markRead {
log.Debug().
Int64("newest_timestamp_ms", messages[len(messages)-1].TimestampMs).
Msg("Marking chat as read in backfill as it's older than the unread hours threshold")
}
}
if portal.bridge.SpecVersions.Supports(mautrix.BeeperFeatureBatchSending) {
log.Info().Int("event_count", len(events)).Msg("Sending events to Matrix using Beeper batch sending")
Expand Down

0 comments on commit b48fea0

Please sign in to comment.