X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/f5c601f1801aaa276f8c335fcb51c373edc0b50c..80e348724041a694002fc38f57e8868b9b9a2be9:/whatsapp_find.go diff --git a/whatsapp_find.go b/whatsapp_find.go index 9e3cbf8..5c19ae7 100644 --- a/whatsapp_find.go +++ b/whatsapp_find.go @@ -23,6 +23,13 @@ const ( whatsappNamesNotReady = "The names of the contacts and groups have not arrived from the phone yet. They come some minutes after the link. Try again later." ) +// WhatsAppMatch is one contact or group of whatsappFind. +type WhatsAppMatch struct { + id string + name string + kind string +} + // whatsappFind returns the contacts and the groups whose name contains name, // with no regard to case and accents, as lines "ID | name | contact" or "ID | // name | group", sorted by name. It gives at most whatsappFindMatches lines and @@ -94,13 +101,6 @@ func whatsappFind(ctx context.Context, link WhatsAppLink, groups *WhatsAppGroups return whatsappFindAnswer(name, matches, read || len(names) > 0), nil } -// WhatsAppMatch is one contact or group of whatsappFind. -type WhatsAppMatch struct { - id string - name string - kind string -} - // whatsappFold returns text in lower case with no accents and no space at its // ends, so that names match with no regard to case and accents. func whatsappFold(text string) string {