add config item for sync contact
This commit is contained in:
parent
bb9f424d44
commit
0e52308a25
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
2
user.go
2
user.go
|
@ -630,10 +630,12 @@ func (user *User) syncPuppets(contacts map[string]skype.Contact, toHomeserver bo
|
|||
matrixContacts = append(matrixContacts, string(puppet.MXID))
|
||||
}
|
||||
}
|
||||
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")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue