Set contact info for puppets on startup (#85)

This commit is contained in:
vurpo
2023-05-08 16:58:30 +03:00
committed by GitHub
parent 87c90d3f12
commit 7655ff1a64
2 changed files with 13 additions and 0 deletions

View File

@@ -102,6 +102,7 @@ func (br *DiscordBridge) Start() {
if br.Config.Bridge.Provisioning.SharedSecret != "disable" {
br.provisioning = newProvisioningAPI(br)
}
go br.updatePuppetsContactInfo()
go br.startUsers()
}

View File

@@ -158,6 +158,18 @@ func (br *DiscordBridge) FormatPuppetMXID(did string) id.UserID {
)
}
func (br *DiscordBridge) updatePuppetsContactInfo() {
if br.Config.Homeserver.Software != bridgeconfig.SoftwareHungry {
return
}
for _, puppet := range br.GetAllPuppets() {
if !puppet.ContactInfoSet && puppet.NameSet {
puppet.ResendContactInfo()
puppet.Update()
}
}
}
func (puppet *Puppet) GetDisplayname() string {
return puppet.Name
}