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"`
|
RecoverChatSync int `yaml:"recovery_chat_sync_count"`
|
||||||
RecoverHistory bool `yaml:"recovery_history_backfill"`
|
RecoverHistory bool `yaml:"recovery_history_backfill"`
|
||||||
SyncChatMaxAge uint64 `yaml:"sync_max_chat_age"`
|
SyncChatMaxAge uint64 `yaml:"sync_max_chat_age"`
|
||||||
|
SyncContact bool `yaml:"sync_contact"`
|
||||||
|
|
||||||
SyncWithCustomPuppets bool `yaml:"sync_with_custom_puppets"`
|
SyncWithCustomPuppets bool `yaml:"sync_with_custom_puppets"`
|
||||||
|
|
||||||
|
@ -101,6 +102,7 @@ func (bc *BridgeConfig) setDefaults() {
|
||||||
bc.RecoverChatSync = -1
|
bc.RecoverChatSync = -1
|
||||||
bc.RecoverHistory = true
|
bc.RecoverHistory = true
|
||||||
bc.SyncChatMaxAge = 259200
|
bc.SyncChatMaxAge = 259200
|
||||||
|
bc.SyncContact = false
|
||||||
|
|
||||||
bc.SyncWithCustomPuppets = true
|
bc.SyncWithCustomPuppets = true
|
||||||
|
|
||||||
|
|
|
@ -126,6 +126,9 @@ bridge:
|
||||||
# Default is 3 days = 259200 seconds
|
# Default is 3 days = 259200 seconds
|
||||||
sync_max_chat_age: 259200
|
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
|
# Whether or not to sync with custom puppets to receive EDUs that
|
||||||
# are not normally sent to appservices.
|
# are not normally sent to appservices.
|
||||||
sync_with_custom_puppets: true
|
sync_with_custom_puppets: true
|
||||||
|
|
8
user.go
8
user.go
|
@ -630,9 +630,11 @@ func (user *User) syncPuppets(contacts map[string]skype.Contact, toHomeserver bo
|
||||||
matrixContacts = append(matrixContacts, string(puppet.MXID))
|
matrixContacts = append(matrixContacts, string(puppet.MXID))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
customPuppet := user.bridge.GetPuppetByCustomMXID(user.MXID)
|
if user.bridge.Config.Bridge.SyncContact {
|
||||||
if customPuppet != nil && customPuppet.CustomIntent() != nil {
|
customPuppet := user.bridge.GetPuppetByCustomMXID(user.MXID)
|
||||||
customPuppet.SetMatrixContacts(matrixContacts)
|
if customPuppet != nil && customPuppet.CustomIntent() != nil {
|
||||||
|
customPuppet.SetMatrixContacts(matrixContacts)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
user.log.Infoln("Finished syncing puppet info from contacts")
|
user.log.Infoln("Finished syncing puppet info from contacts")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue