diff --git a/config/bridge.go b/config/bridge.go index 06e0029..1ae7842 100644 --- a/config/bridge.go +++ b/config/bridge.go @@ -40,6 +40,7 @@ type BridgeConfig struct { RecoverChatSync int `yaml:"recovery_chat_sync_count"` RecoverHistory bool `yaml:"recovery_history_backfill"` SyncChatMaxAge uint64 `yaml:"sync_max_chat_age"` + SyncContact bool `yaml:"sync_contact"` SyncWithCustomPuppets bool `yaml:"sync_with_custom_puppets"` @@ -101,6 +102,7 @@ func (bc *BridgeConfig) setDefaults() { bc.RecoverChatSync = -1 bc.RecoverHistory = true bc.SyncChatMaxAge = 259200 + bc.SyncContact = false bc.SyncWithCustomPuppets = true diff --git a/example-config.yaml b/example-config.yaml index 47efdff..432eb78 100644 --- a/example-config.yaml +++ b/example-config.yaml @@ -126,6 +126,9 @@ bridge: # Default is 3 days = 259200 seconds sync_max_chat_age: 259200 + # sync contact, Non-martix-standard parameter, defaults to false + sync_contact: false + # Whether or not to sync with custom puppets to receive EDUs that # are not normally sent to appservices. sync_with_custom_puppets: true diff --git a/user.go b/user.go index bce9f16..3eb7650 100644 --- a/user.go +++ b/user.go @@ -630,9 +630,11 @@ func (user *User) syncPuppets(contacts map[string]skype.Contact, toHomeserver bo matrixContacts = append(matrixContacts, string(puppet.MXID)) } } - customPuppet := user.bridge.GetPuppetByCustomMXID(user.MXID) - if customPuppet != nil && customPuppet.CustomIntent() != nil { - customPuppet.SetMatrixContacts(matrixContacts) + if user.bridge.Config.Bridge.SyncContact { + customPuppet := user.bridge.GetPuppetByCustomMXID(user.MXID) + if customPuppet != nil && customPuppet.CustomIntent() != nil { + customPuppet.SetMatrixContacts(matrixContacts) + } } user.log.Infoln("Finished syncing puppet info from contacts") }