Better keyword/tags/labels handling for #419

This commit is contained in:
the-djmaze 2022-10-06 10:42:21 +02:00
parent df2de7ad66
commit 2defb7ec35
4 changed files with 16 additions and 21 deletions

View file

@ -24,23 +24,22 @@ ignoredKeywords = [
// Mailo
'sent',
// KMail
'$attachment',
'$encrypted',
'$error',
'$ignored',
'$invitation',
'$queued',
'$replied',
'$sent',
'$signed',
'$todo',
'$watched',
// GMail
'$replied',
'$attachment',
'$notphishing',
'junk',
'nonjunk',
// KMail & GMail
'$attachment',
'$replied',
// Others
'$readreceipt'
],

View file

@ -36,7 +36,7 @@ import { MessageFlagsCache } from 'Common/Cache';
import { AppUserStore } from 'Stores/User/App';
import { SettingsUserStore } from 'Stores/User/Settings';
import { AccountUserStore } from 'Stores/User/Account';
import { FolderUserStore } from 'Stores/User/Folder';
import { FolderUserStore, isAllowedKeyword } from 'Stores/User/Folder';
import { MessageUserStore } from 'Stores/User/Message';
import { MessagelistUserStore } from 'Stores/User/Messagelist';
import { ThemeStore } from 'Stores/Theme';
@ -529,8 +529,8 @@ export class MailMessageView extends AbstractViewRight {
newTag() {
let message = currentMessage();
if (message) {
let keyword = prompt(i18n('MESSAGE/NEW_TAG'), '')?.replace(/\s+/g, '');
if (keyword.length) {
let keyword = prompt(i18n('MESSAGE/NEW_TAG'), '')?.replace(/[\s\\]+/g, '');
if (keyword.length && isAllowedKeyword(keyword)) {
message.toggleTag(keyword);
FolderUserStore.currentFolder().permanentFlags.push(keyword);
}