fix: person name update using other options before saving same as number
This commit is contained in:
+15
-4
@@ -1593,11 +1593,22 @@ func GetChatName(client *whatsmeow.Client, messageStore *MessageStore, jid types
|
|||||||
logger.Infof("Getting name for contact: %s", chatJID)
|
logger.Infof("Getting name for contact: %s", chatJID)
|
||||||
|
|
||||||
contact, err := client.Store.Contacts.GetContact(context.Background(), jid)
|
contact, err := client.Store.Contacts.GetContact(context.Background(), jid)
|
||||||
if err == nil && contact.FullName != "" {
|
if err == nil {
|
||||||
name = contact.FullName
|
switch {
|
||||||
} else if sender != "" {
|
case contact.FullName != "":
|
||||||
|
name = contact.FullName
|
||||||
|
case contact.PushName != "":
|
||||||
|
name = contact.PushName
|
||||||
|
case contact.FirstName != "":
|
||||||
|
name = contact.FirstName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if name == "" && sender != "" {
|
||||||
name = sender
|
name = sender
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
if name == "" {
|
||||||
name = jid.User
|
name = jid.User
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user