mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-09-16 02:48:00 +00:00
feat(mail): Deletion of mail older than x
This commit is contained in:
@@ -1312,4 +1312,10 @@
|
||||
Mailbox.prototype.getHighlightWords = function () {
|
||||
return this.$highlightWords;
|
||||
};
|
||||
|
||||
/* TODO */
|
||||
Mailbox.prototype.cleanMailbox = function () {
|
||||
Mailbox.$$resource.post(this.id, 'cleanMailbox');
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
@@ -53,6 +53,10 @@
|
||||
$rootScope.$on('resetMailAdvancedSearchPanel', function () {
|
||||
vm.reset();
|
||||
});
|
||||
|
||||
$rootScope.$on('showRemoveOldEmailsPanel', function (e, d) {
|
||||
vm.showRemoveOldEmailsPanel(d.folder);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -447,6 +451,41 @@
|
||||
});
|
||||
};
|
||||
|
||||
this.showRemoveOldEmailsPanel = function (folder) {
|
||||
// Close sidenav on small devices
|
||||
if (!$mdMedia(sgConstant['gt-md']))
|
||||
$mdSidenav('left').close();
|
||||
|
||||
$mdDialog.show({
|
||||
template: document.getElementById('removeOldEmails').innerHTML,
|
||||
parent: angular.element(document.body),
|
||||
controller: function () {
|
||||
var dialogCtrl = this;
|
||||
|
||||
this.$onInit = function () {
|
||||
// Pass main controller
|
||||
this.mainController = vm;
|
||||
this.folder = folder;
|
||||
this.folderName = folder.$displayName;
|
||||
};
|
||||
|
||||
dialogCtrl.closeDialog = function () {
|
||||
$mdDialog.hide();
|
||||
};
|
||||
|
||||
dialogCtrl.apply = function () {
|
||||
console.log(this.mailbox);
|
||||
this.folder.cleanMailbox();
|
||||
// $mdDialog.hide();
|
||||
};
|
||||
},
|
||||
controllerAs: 'dialogCtrl',
|
||||
clickOutsideToClose: false,
|
||||
escapeToClose: false,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
this.delegate = function(account) {
|
||||
$mdDialog.show({
|
||||
templateUrl: account.id + '/delegation', // UI/Templates/MailerUI/UIxMailUserDelegation.wox
|
||||
|
||||
@@ -271,6 +271,14 @@
|
||||
});
|
||||
};
|
||||
|
||||
this.removeOldEmails = function () {
|
||||
// Close sidenav on small devices
|
||||
if (!$mdMedia(sgConstant['gt-md']))
|
||||
$mdSidenav('left').close();
|
||||
|
||||
$rootScope.$broadcast('showRemoveOldEmailsPanel', {folder: this.folder}); // Show remove old emails panel (broadcast event to MailboxesController)
|
||||
};
|
||||
|
||||
this.emptyJunkFolder = function() {
|
||||
return this.emptyFolder(l('Junk folder emptied'));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user