feat(mail): filter mailbox by unread messages

Fixes #1146
Fixes #3156
Fixes #4752
This commit is contained in:
Francis Lachapelle
2021-10-19 14:49:50 -04:00
parent 248516e947
commit e5dbebb100
4 changed files with 49 additions and 20 deletions

View File

@@ -342,6 +342,17 @@
return angular.isDefined(this.$selectedMessage);
};
/**
* @function toggleUnseenOnly
* @memberof Mailbox.prototype
* @desc Toggle filter by unseen messages only. Requires a round trip to the server.
*/
Mailbox.prototype.toggleUnseenOnly = function() {
var _this = this;
this.$unseenOnly = !this.$unseenOnly;
this.$filter(Mailbox.$query);
};
/**
* @function $filter
* @memberof Mailbox.prototype
@@ -394,6 +405,9 @@
options.syncToken = this.$syncToken;
}
if (this.$unseenOnly)
options.unseenOnly = 1;
// Restart the refresh timer, if needed
if (!Mailbox.$virtualMode) {
var refreshViewCheck = Mailbox.$Preferences.defaults.SOGoRefreshViewCheck;