Add unread count to Box object #116

Merged
merged 2 commits into from Oct 4, 2012

Projects

None yet

2 participants

@chotiwat
Contributor
chotiwat commented Oct 4, 2012

Add unread count as unseen property in Box object.

Pull request for #111

@mscdex
Owner
mscdex commented Oct 4, 2012

The property needs to be defined in the _state object definition near the top and in the reset() function. Otherwise LGTM.

@mscdex mscdex and 1 other commented on an outdated diff Oct 4, 2012
@@ -463,7 +467,9 @@ ImapConnection.prototype.connect = function(loginCb) {
} else if (/^ALERT$/i.test(code))
self.emit('alert', m[3]);
else if (state.status === STATES.BOXSELECTING) {
- if (m = /^UIDVALIDITY (\d+)/i.exec(code))
+ if (m = /^UNSEEN (\d+)/i.exec(code))
+ state.box.unseen = m[1];
@mscdex
mscdex Oct 4, 2012 Owner

This should probably be parsed as an integer like above.

@chotiwat
chotiwat Oct 4, 2012 Contributor

It's also should be in state.box.messages.unseen. I'll fix it.

@mscdex mscdex merged commit 876a212 into mscdex:master Oct 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment