From 62e806c8c32db325052f78953a6374c6924235cb Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 18 May 2021 14:16:35 +0300 Subject: [PATCH] Add option to disable backfill read receipt bridging --- config/bridge.go | 1 + user.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/bridge.go b/config/bridge.go index ffcb74c..4fc7c02 100644 --- a/config/bridge.go +++ b/config/bridge.go @@ -74,6 +74,7 @@ type BridgeConfig struct { ArchiveTag string `yaml:"archive_tag"` PinnedTag string `yaml:"pinned_tag"` TagOnlyOnCreate bool `yaml:"tag_only_on_create"` + MarkReadOnlyOnCreate bool `yaml:"mark_read_only_on_create"` WhatsappThumbnail bool `yaml:"whatsapp_thumbnail"` diff --git a/user.go b/user.go index 389bbb7..5da6e6c 100644 --- a/user.go +++ b/user.go @@ -749,7 +749,7 @@ func (user *User) syncChatDoublePuppetDetails(doublePuppet *Puppet, chat Chat, j return } intent := doublePuppet.CustomIntent() - if chat.UnreadCount == 0 { + if chat.UnreadCount == 0 && (justCreated || !user.bridge.Config.Bridge.MarkReadOnlyOnCreate) { lastMessage := user.bridge.DB.Message.GetLastInChat(chat.Portal.Key) if lastMessage != nil { err := intent.MarkRead(chat.Portal.MXID, lastMessage.MXID)