Drop useless messagelist_actions feature

This commit is contained in:
djmaze 2021-09-17 14:07:52 +02:00
parent 00088ef547
commit fa136cd529
6 changed files with 42 additions and 59 deletions

View file

@ -11,7 +11,6 @@ export const Capa = {
Search: 'SEARCH',
SearchAdv: 'SEARCH_ADV',
MessageActions: 'MESSAGE_ACTIONS',
MessageListActions: 'MESSAGELIST_ACTIONS',
AttachmentsActions: 'ATTACHMENTS_ACTIONS',
DangerousActions: 'DANGEROUS_ACTIONS',
Settings: 'SETTINGS',

View file

@ -62,7 +62,6 @@ export class MessageListMailBoxUserView extends AbstractViewRight {
this.allowReload = Settings.capa(Capa.Reload);
this.allowSearch = Settings.capa(Capa.Search);
this.allowSearchAdv = Settings.capa(Capa.SearchAdv);
this.allowMessageListActions = Settings.capa(Capa.MessageListActions);
this.allowDangerousActions = Settings.capa(Capa.DangerousActions);
this.messageList = MessageUserStore.list;
@ -754,24 +753,22 @@ export class MessageListMailBoxUserView extends AbstractViewRight {
}
});
if (Settings.capa(Capa.MessageListActions)) {
// archive (zip)
shortcuts.add('z', '', [Scope.MessageList, Scope.MessageView], () => {
this.archiveCommand();
return false;
});
// archive (zip)
shortcuts.add('z', '', [Scope.MessageList, Scope.MessageView], () => {
this.archiveCommand();
return false;
});
// delete
shortcuts.add('delete', 'shift', Scope.MessageList, () => {
MessageUserStore.listCheckedOrSelected().length && this.deleteWithoutMoveCommand();
return false;
});
// shortcuts.add('3', 'shift', Scope.MessageList, () => {
shortcuts.add('delete', '', Scope.MessageList, () => {
MessageUserStore.listCheckedOrSelected().length && this.deleteCommand();
return false;
});
}
// delete
shortcuts.add('delete', 'shift', Scope.MessageList, () => {
MessageUserStore.listCheckedOrSelected().length && this.deleteWithoutMoveCommand();
return false;
});
// shortcuts.add('3', 'shift', Scope.MessageList, () => {
shortcuts.add('delete', '', Scope.MessageList, () => {
MessageUserStore.listCheckedOrSelected().length && this.deleteCommand();
return false;
});
if (Settings.capa(Capa.Reload)) {
// check mail
@ -793,13 +790,11 @@ export class MessageListMailBoxUserView extends AbstractViewRight {
return false;
});
if (Settings.capa(Capa.MessageListActions)) {
// important - star/flag messages
shortcuts.add('i', '', [Scope.MessageList, Scope.MessageView], () => {
this.flagMessagesFast();
return false;
});
}
// important - star/flag messages
shortcuts.add('i', '', [Scope.MessageList, Scope.MessageView], () => {
this.flagMessagesFast();
return false;
});
shortcuts.add('t', '', [Scope.MessageList], () => {
let message = MessageUserStore.selectorMessageSelected();
@ -814,32 +809,28 @@ export class MessageListMailBoxUserView extends AbstractViewRight {
return false;
});
if (Settings.capa(Capa.MessageListActions)) {
// move
shortcuts.add('insert', '', Scope.MessageList, () => {
if (this.newMoveToFolder) {
this.moveNewCommand();
} else {
this.moveDropdownTrigger(true);
}
// move
shortcuts.add('insert', '', Scope.MessageList, () => {
if (this.newMoveToFolder) {
this.moveNewCommand();
} else {
this.moveDropdownTrigger(true);
}
return false;
});
}
return false;
});
if (Settings.capa(Capa.MessageListActions)) {
// read
shortcuts.add('q', '', [Scope.MessageList, Scope.MessageView], () => {
this.seenMessagesFast(true);
return false;
});
// read
shortcuts.add('q', '', [Scope.MessageList, Scope.MessageView], () => {
this.seenMessagesFast(true);
return false;
});
// unread
shortcuts.add('u', '', [Scope.MessageList, Scope.MessageView], () => {
this.seenMessagesFast(false);
return false;
});
}
// unread
shortcuts.add('u', '', [Scope.MessageList, Scope.MessageView], () => {
this.seenMessagesFast(false);
return false;
});
shortcuts.add('f,mailforward', 'shift', [Scope.MessageList, Scope.MessageView], () => {
this.multyForwardCommand();

View file

@ -54,7 +54,7 @@ class MessageViewMailBoxUserView extends AbstractViewRight {
createCommandActionHelper = (folderType, useFolder) =>
createCommand(() => {
const message = MessageUserStore.message();
if (message && this.allowMessageListActions) {
if (message) {
MessageUserStore.message(null);
rl.app.deleteMessagesFromFolder(folderType, message.folder, [message.uid], useFolder);
}
@ -74,7 +74,6 @@ class MessageViewMailBoxUserView extends AbstractViewRight {
this.moveAction = moveAction;
this.allowMessageActions = Settings.capa(Capa.MessageActions);
this.allowMessageListActions = Settings.capa(Capa.MessageListActions);
const attachmentsActions = Settings.app('attachmentsActions');
this.attachmentsActions = ko.observableArray(arrayLength(attachmentsActions) ? attachmentsActions : []);

View file

@ -1905,12 +1905,8 @@ class Actions
$aResult = array();
if ($oConfig->Get('capa', 'messagelist_actions', true)) {
$aResult[] = Enumerations\Capa::MESSAGELIST_ACTIONS;
if ($oConfig->Get('capa', 'dangerous_actions', true)) {
$aResult[] = Enumerations\Capa::DANGEROUS_ACTIONS;
}
if ($oConfig->Get('capa', 'dangerous_actions', true)) {
$aResult[] = Enumerations\Capa::DANGEROUS_ACTIONS;
}
if ($oConfig->Get('capa', 'reload', true)) {

View file

@ -195,7 +195,6 @@ class Application extends \RainLoop\Config\AbstractConfig
'search_adv' => array(true),
'dangerous_actions' => array(true),
'message_actions' => array(true),
'messagelist_actions' => array(true),
'attachments_actions' => array(true)
),

View file

@ -21,7 +21,6 @@ class Capa
const HELP = 'HELP';
const TEMPLATES = 'TEMPLATES';
const MESSAGE_ACTIONS = 'MESSAGE_ACTIONS';
const MESSAGELIST_ACTIONS = 'MESSAGELIST_ACTIONS';
const ATTACHMENTS_ACTIONS = 'ATTACHMENTS_ACTIONS';
const DANGEROUS_ACTIONS = 'DANGEROUS_ACTIONS';
const AUTOLOGOUT = 'AUTOLOGOUT';