Closed iwconfig closed 6 years ago
Hello, thank you for pull request.
Did you try maxResults
query option? Cause iterating over pages feels like not so good solution.
btw, how many unread messages you have? :slightly_smiling_face:
Oh, heh, you're absolutely right. Clearly i was over my head with this. I read up on the api documentation a little further and .users().labels().get(userId='me', id='INBOX').execute()
gives us a dict which contains the threadsUnread
key which is the total in the 'INBOX' label. This should work. No iteration occurring. 🙂 I'll update this PR soon.
Hrmm.. Heh, right now it's at 511 unread messages. Thats nothing compared to some other email accounts i own. 😄
I have a lot of unread messages (shame on me :see_no_evil: :hear_no_evil: :speak_no_evil: :smile:).
The search result in
list
is only the first page. So if you have a lot of unread messages, iterating the result with thenextPageToken
gives a proper count of the unread messages.