diff --git a/README.md b/README.md index f571840..1280f92 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/lib/Connection.js b/lib/Connection.js index 6496497..5e4355d 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -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;