X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/2e2524881dfe8f6c5cabfd9d342d5d3492953bd4..36229ef68a30c5a117599037d79fa1fc708fbfef:/whatsapp_find.go?ds=sidebyside diff --git a/whatsapp_find.go b/whatsapp_find.go index 545e01c..b825a3e 100644 --- a/whatsapp_find.go +++ b/whatsapp_find.go @@ -61,6 +61,7 @@ func whatsappFind(ctx context.Context, link WhatsAppLink, groups *WhatsAppGroups } var matches []WhatsAppMatch + for jid, contact := range contacts { names := []string{contact.FullName, contact.FirstName, contact.BusinessName, contact.PushName} shown := slices.IndexFunc(names, func(name string) bool { @@ -119,6 +120,7 @@ func whatsappFindAnswer(name string, matches []WhatsAppMatch, groups bool) strin }) var lines []string + for _, match := range matches[:min(len(matches), whatsappFindMatches)] { lines = append(lines, match.id+" | "+match.name+" | "+match.kind) }