X-Git-Url: http://git.giacomolli.uk/onechat/blobdiff_plain/a3b9849a54a6cd8a4cc5b1ae03a39aab31322f7b..522d7fd117285e4e4ce3ea5ec9b5a1722521b681:/whatsapp_groups.go?ds=sidebyside diff --git a/whatsapp_groups.go b/whatsapp_groups.go index c8d066a..56676e5 100644 --- a/whatsapp_groups.go +++ b/whatsapp_groups.go @@ -49,6 +49,7 @@ type WhatsAppGroups struct { // again, at most once in whatsappGroupsRefresh. func (g *WhatsAppGroups) name(ctx context.Context, link WhatsAppLink, id string) string { g.mutex.Lock() + name, found := g.names[id] fresh := time.Since(g.triedAt) < whatsappGroupsRefresh g.mutex.Unlock() @@ -57,6 +58,7 @@ func (g *WhatsAppGroups) name(ctx context.Context, link WhatsAppLink, id string) g.read(ctx, link) g.mutex.Lock() + name, found = g.names[id] g.mutex.Unlock() }