X-Git-Url: http://git.giacomolli.uk/onechat/blobdiff_plain/6e7c7f3d47f086b9d59fe40b91fb071e1528684e..5a93b6124068c2a8748fc0bfbb2a2d151815bcf0:/whatsapp_state.go?ds=sidebyside diff --git a/whatsapp_state.go b/whatsapp_state.go index b8929f0..c09423d 100644 --- a/whatsapp_state.go +++ b/whatsapp_state.go @@ -170,6 +170,7 @@ func (s *WhatsAppState) Closed() []WhatsAppBatch { defer s.mutex.Unlock() var closed []WhatsAppBatch + for _, batch := range s.file.Batches { if batch.Closed { closed = append(closed, batch) @@ -198,6 +199,7 @@ func (s *WhatsAppState) Wait(now time.Time) (time.Duration, bool) { defer s.mutex.Unlock() var first time.Time + for _, batch := range s.file.Batches { deadline := s.deadline(batch) if !batch.Closed && (first.IsZero() || deadline.Before(first)) {