forked from MirrorHub/mautrix-whatsapp
Fix updated name log
This commit is contained in:
parent
f0401ee81e
commit
0e298bb88b
1 changed files with 2 additions and 1 deletions
|
@ -266,12 +266,13 @@ func (puppet *Puppet) UpdateAvatar(source *User, forcePortalSync bool) bool {
|
|||
func (puppet *Puppet) UpdateName(contact types.ContactInfo, forcePortalSync bool) bool {
|
||||
newName, quality := puppet.bridge.Config.Bridge.FormatDisplayname(puppet.JID, contact)
|
||||
if (puppet.Displayname != newName || !puppet.NameSet) && quality >= puppet.NameQuality {
|
||||
oldName := puppet.Displayname
|
||||
puppet.Displayname = newName
|
||||
puppet.NameQuality = quality
|
||||
puppet.NameSet = false
|
||||
err := puppet.DefaultIntent().SetDisplayName(newName)
|
||||
if err == nil {
|
||||
puppet.log.Debugln("Updated name", puppet.Displayname, "->", newName)
|
||||
puppet.log.Debugln("Updated name", oldName, "->", newName)
|
||||
puppet.NameSet = true
|
||||
go puppet.updatePortalName()
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue