X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/8d9547f6e7ffa1e95ad25d9f8f2e7cfd23d992d0..3b7a3676dc3614ee3099e8798b5d0c07cb116b93:/whatsapp_groups.go diff --git a/whatsapp_groups.go b/whatsapp_groups.go index e8111c3..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("group names can be missing, because the list of groups did not load: %s", whatsappRedact(link.own, err.Error())) + g.logger.Printf("group list failed: %s", whatsappRedact(link.own, err.Error())) } g.mutex.Lock()