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', Search: 'SEARCH',
SearchAdv: 'SEARCH_ADV', SearchAdv: 'SEARCH_ADV',
MessageActions: 'MESSAGE_ACTIONS', MessageActions: 'MESSAGE_ACTIONS',
MessageListActions: 'MESSAGELIST_ACTIONS',
AttachmentsActions: 'ATTACHMENTS_ACTIONS', AttachmentsActions: 'ATTACHMENTS_ACTIONS',
DangerousActions: 'DANGEROUS_ACTIONS', DangerousActions: 'DANGEROUS_ACTIONS',
Settings: 'SETTINGS', Settings: 'SETTINGS',

View file

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

View file

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

View file

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

View file

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

View file

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