]> git.giacomolli.uk - onechat/blobdiff - whatsapp_find.go
Resume queued appends at their saved log ID
[onechat] / whatsapp_find.go
index 545e01c9d63e8127d2a6dbc2f7496a654ad70f57..b825a3ecaeea218bf31f5d9c2f4b87c46746edae 100644 (file)
@@ -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)
        }