From 05b84061f2cc7ca6cf009ad2fc2ed7556cfcae4e Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sun, 10 Nov 2019 23:41:56 -0500 Subject: Bug 1523048 - when copying a filter, copy its triggering events too (filterType). Tag #1273 --- mailnews/base/search/content/FilterEditor.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'mailnews/base/search') diff --git a/mailnews/base/search/content/FilterEditor.js b/mailnews/base/search/content/FilterEditor.js index 986185d349..ecfe9febc5 100644 --- a/mailnews/base/search/content/FilterEditor.js +++ b/mailnews/base/search/content/FilterEditor.js @@ -124,8 +124,8 @@ function filterEditorOnLoad() else if ("copiedFilter" in args) { // we are copying a filter - var copiedFilter = args.copiedFilter; - var copiedName = gFilterBundle.getFormattedString("copyToNewFilterName", + let copiedFilter = args.copiedFilter; + let copiedName = gFilterBundle.getFormattedString("copyToNewFilterName", [copiedFilter.filterName]); let newFilter = gFilterList.createFilter(copiedName); @@ -142,13 +142,15 @@ function filterEditorOnLoad() var searchTerm = copiedFilter.searchTerms.QueryElementAt(i, Components.interfaces.nsIMsgSearchTerm); - var newTerm = newFilter.createTerm(); + let newTerm = newFilter.createTerm(); newTerm.attrib = searchTerm.attrib; newTerm.op = searchTerm.op; newTerm.booleanAnd = searchTerm.booleanAnd; newTerm.value = searchTerm.value; newFilter.appendTerm(newTerm); - }; + } + + newFilter.filterType = copiedFilter.filterType; gPreFillName = copiedName; gFilter = newFilter; -- cgit v1.2.3