X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/1804474c7a03cca8bf780dd870a985e7badb4331..522d7fd117285e4e4ce3ea5ec9b5a1722521b681:/whatsapp_groups.go?ds=sidebyside diff --git a/whatsapp_groups.go b/whatsapp_groups.go index ab5ed61..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() } @@ -80,7 +82,7 @@ func (g *WhatsAppGroups) read(ctx context.Context, link WhatsAppLink) bool { groups, err := link.client.GetJoinedGroups(ctx) if err != nil { - g.logger.Printf("read the groups: %s", whatsappRedact(link.own, err.Error())) + g.logger.Printf("group list failed: %s", whatsappRedact(link.own, err.Error())) } g.mutex.Lock()