Set contact info for puppets on startup (#85)
This commit is contained in:
1
main.go
1
main.go
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
12
puppet.go
12
puppet.go
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user