(feat) now supports RFC6154 and NoInferiors IMAP flag

This commit is contained in:
Ludovic Marcotte
2016-02-10 10:00:59 -05:00
parent f5b28b0274
commit 693f80dc9a
4 changed files with 45 additions and 10 deletions
@@ -165,6 +165,7 @@
if (this.type) {
this.$isEditable = this.isEditable();
}
this.$isNoInferiors = this.isNoInferiors();
if (angular.isUndefined(this.$shadowData)) {
// Make a copy of the data for an eventual reset
this.$shadowData = this.$omit();
@@ -375,6 +376,16 @@
return this.type == 'folder';
};
/**
* @function isNoInferiors
* @memberof Mailbox.prototype
* @desc Checks if the mailbox can contain submailboxes
* @returns true if the mailbox can not contain submailboxes
*/
Mailbox.prototype.isNoInferiors = function() {
return this.flags.indexOf('noinferiors') >= 0;
};
/**
* @function $rename
* @memberof AddressBook.prototype
@@ -721,7 +732,7 @@
Mailbox.$timeout(function() {
var uids, headers;
if (_this.$topIndex > data.uids.length - 1)
if (!data.uids || _this.$topIndex > data.uids.length - 1)
_this.$topIndex = 0;
_this.init(data);