Connection: add 'uidvalidity' event for unsolicited, untagged OK responses with uidvalidity text code

fork
mscdex 11 years ago
parent b06599ceb2
commit f8f9310f56

@ -325,6 +325,8 @@ Connection Events
* **expunge**(< _integer_ >seqno) - Emitted when a message was expunged externally. `seqno` is the sequence number (instead of the unique UID) of the message that was expunged. If you are caching sequence numbers, all sequence numbers higher than this value **MUST** be decremented by 1 in order to stay synchronized with the server and to keep correct continuity.
* **uidvalidity**(< _integer_ >uidvalidity) - Emitted if the UID validity value for the currently open mailbox changes during the current session.
* **update**(< _integer_ >seqno, < _object_ >info) - Emitted when message metadata (e.g. flags) changes externally.
* **error**(< _Error_ >err) - Emitted when an error occurs. The 'source' property will be set to indicate where the error originated from.

@ -1014,7 +1014,9 @@ Connection.prototype._resUntagged = function(info) {
for (i = 0, len = keywords.length; i < len; ++i)
permFlags.splice(permFlags.indexOf(keywords[i]), 1);
}
}
} else if (typeof info.textCode === 'string'
&& info.textCode.toUpperCase() === 'UIDVALIDITY')
this.emit('uidvalidity', info.text);
} else if (type === 'list') {
if (this.delimiter === undefined)
this.delimiter = info.text.delimiter;

Loading…
Cancel
Save