Add option to disable backfill read receipt bridging

This commit is contained in:
Tulir Asokan 2021-05-18 14:16:35 +03:00
parent 1bdbf0a22d
commit 62e806c8c3
2 changed files with 2 additions and 1 deletions

View file

@ -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"`

View file

@ -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)