From 2501a92dcec63ac00d03cbfc4ce155e3bf087b45 Mon Sep 17 00:00:00 2001 From: Nick Mills-Barrett Date: Mon, 18 Nov 2024 12:52:01 +0000 Subject: [PATCH] Add `DUMMY_MARK_READ` env to control marking backfills as read Annoying this is an env var but not really any other way to do it except config which would be equally annoying. --- pkg/connector/backfill.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/connector/backfill.go b/pkg/connector/backfill.go index 273aefd..afcd9d5 100644 --- a/pkg/connector/backfill.go +++ b/pkg/connector/backfill.go @@ -5,6 +5,7 @@ import ( "fmt" "math" "math/rand" + "os" "time" "maunium.net/go/mautrix/bridgev2" @@ -65,5 +66,10 @@ func (dc *DummyClient) FetchMessages(ctx context.Context, fetchParams bridgev2.F // always claim we have more until timelimit is hit resp.HasMore = true + + if os.Getenv("DUMMY_MARK_READ") != "" { + resp.MarkRead = true + } + return }