Explorar o código

Add option to disable backfill read receipt bridging

Tulir Asokan %!s(int64=4) %!d(string=hai) anos
pai
achega
62e806c8c3
Modificáronse 2 ficheiros con 2 adicións e 1 borrados
  1. 1 0
      config/bridge.go
  2. 1 1
      user.go

+ 1 - 0
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"`
 

+ 1 - 1
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)