(js) Restore immediate deletion of messages
This commit is contained in:
parent
67f566ec9d
commit
5c7147cccc
1
NEWS
1
NEWS
|
@ -22,6 +22,7 @@ Bug fixes
|
||||||
- [web] fixed auto-completion of list members (#3870)
|
- [web] fixed auto-completion of list members (#3870)
|
||||||
- [web] added missing options to subscribed addressbooks (#3850)
|
- [web] added missing options to subscribed addressbooks (#3850)
|
||||||
- [web] fixed resource conflict error handling (403 vs 409 HTTP code)
|
- [web] fixed resource conflict error handling (403 vs 409 HTTP code)
|
||||||
|
- [web] restored immediate deletion of messages (without moving them to the trash)
|
||||||
- [eas] improve handling of email folders without a parent
|
- [eas] improve handling of email folders without a parent
|
||||||
- [eas] never send IMIP reply when the "initiator" is Outlook 2013/2016
|
- [eas] never send IMIP reply when the "initiator" is Outlook 2013/2016
|
||||||
- [core] only consider SMTP addresses for AD's proxyAddresses (#3842)
|
- [core] only consider SMTP addresses for AD's proxyAddresses (#3842)
|
||||||
|
|
|
@ -164,7 +164,7 @@
|
||||||
<md-tooltip md-direction="bottom"><var:string label:value="Select All"/></md-tooltip>
|
<md-tooltip md-direction="bottom"><var:string label:value="Select All"/></md-tooltip>
|
||||||
<md-icon>select_all</md-icon>
|
<md-icon>select_all</md-icon>
|
||||||
</md-button>
|
</md-button>
|
||||||
<md-button class="sg-icon-button" ng-click="mailbox.confirmDeleteSelectedMessages()">
|
<md-button class="sg-icon-button" ng-click="mailbox.confirmDeleteSelectedMessages($event)">
|
||||||
<md-icon>delete</md-icon>
|
<md-icon>delete</md-icon>
|
||||||
</md-button>
|
</md-button>
|
||||||
<md-button class="sg-icon-button" ng-click="mailbox.markOrUnMarkMessagesAsJunk()">
|
<md-button class="sg-icon-button" ng-click="mailbox.markOrUnMarkMessagesAsJunk()">
|
||||||
|
|
|
@ -676,11 +676,14 @@
|
||||||
* @desc Delete multiple messages from mailbox.
|
* @desc Delete multiple messages from mailbox.
|
||||||
* @return a promise of the HTTP operation
|
* @return a promise of the HTTP operation
|
||||||
*/
|
*/
|
||||||
Mailbox.prototype.$deleteMessages = function(messages) {
|
Mailbox.prototype.$deleteMessages = function(messages, options) {
|
||||||
var _this = this, uids;
|
var _this = this, uids, data;
|
||||||
|
|
||||||
uids = _.map(messages, 'uid');
|
uids = _.map(messages, 'uid');
|
||||||
return Mailbox.$$resource.post(this.id, 'batchDelete', {uids: uids})
|
data = { uids: uids };
|
||||||
|
if (options) angular.extend(data, options);
|
||||||
|
|
||||||
|
return Mailbox.$$resource.post(this.id, 'batchDelete', data)
|
||||||
.then(function(data) {
|
.then(function(data) {
|
||||||
// Update inbox quota
|
// Update inbox quota
|
||||||
if (data.quotas)
|
if (data.quotas)
|
||||||
|
|
|
@ -268,9 +268,9 @@
|
||||||
return [vm.selectedFolder];
|
return [vm.selectedFolder];
|
||||||
}
|
}
|
||||||
|
|
||||||
function _unselectMessage(message, index) {
|
|
||||||
// Unselect current message and cleverly load the next message.
|
// Unselect current message and cleverly load the next message.
|
||||||
// This function must not be called in virtual mode.
|
// This function must not be called in virtual mode.
|
||||||
|
function _unselectMessage(message, index) {
|
||||||
var nextMessage, previousMessage, nextIndex = index;
|
var nextMessage, previousMessage, nextIndex = index;
|
||||||
vm.mode.multiple = vm.selectedFolder.$selectedCount();
|
vm.mode.multiple = vm.selectedFolder.$selectedCount();
|
||||||
if (message) {
|
if (message) {
|
||||||
|
@ -327,6 +327,24 @@
|
||||||
// In normal mode, we immediately unselect the selected message.
|
// In normal mode, we immediately unselect the selected message.
|
||||||
_unselectMessage(deleteSelectedMessage, index);
|
_unselectMessage(deleteSelectedMessage, index);
|
||||||
}
|
}
|
||||||
|
}, function(response) {
|
||||||
|
messageDialog = Dialog.confirm(l('Warning'),
|
||||||
|
l('The messages could not be moved to the trash folder. Would you like to delete them immediately?'),
|
||||||
|
{ ok: l('Delete') })
|
||||||
|
.then(function() {
|
||||||
|
vm.selectedFolder.$deleteMessages(selectedMessages, { withoutTrash: true }).then(function(index) {
|
||||||
|
if (Mailbox.$virtualMode) {
|
||||||
|
// When performing an advanced search, we refresh the view if the selected message
|
||||||
|
// was deleted, but only once all promises have completed.
|
||||||
|
if (deleteSelectedMessage)
|
||||||
|
$state.go('mail.account.virtualMailbox');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// In normal mode, we immediately unselect the selected message.
|
||||||
|
_unselectMessage(deleteSelectedMessage, index);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.finally(function() {
|
.finally(function() {
|
||||||
|
|
Loading…
Reference in a new issue