From 1760d6b13f5d9010ef7d3c27776e09fbf6f080d8 Mon Sep 17 00:00:00 2001 From: "scott%scott-macgregor.org" Date: Mon, 19 Apr 2004 05:15:39 +0000 Subject: [PATCH] fix for bug #19403 support server wide news filters r/sr=bienvenu --- mailnews/base/public/nsIMsgIncomingServer.idl | 3 +- .../resources/content/FilterListDialog.js | 7 +-- .../resources/content/FilterListDialog.xul | 12 +++- .../locale/en-US/FilterListDialog.dtd | 1 + mailnews/base/search/src/nsMsgFilterList.cpp | 9 ++- mailnews/news/src/nsNNTPNewsgroupList.cpp | 57 +++++++++++++++---- mailnews/news/src/nsNNTPNewsgroupList.h | 1 + mailnews/news/src/nsNewsFolder.cpp | 16 ++++++ mailnews/news/src/nsNntpIncomingServer.cpp | 11 +--- mailnews/news/src/nsNntpIncomingServer.h | 1 - 10 files changed, 85 insertions(+), 33 deletions(-) diff --git a/mailnews/base/public/nsIMsgIncomingServer.idl b/mailnews/base/public/nsIMsgIncomingServer.idl index b4d7430a2473..1c79ebe2b9ce 100644 --- a/mailnews/base/public/nsIMsgIncomingServer.idl +++ b/mailnews/base/public/nsIMsgIncomingServer.idl @@ -359,7 +359,7 @@ interface nsIMsgIncomingServer : nsISupports { readonly attribute boolean passwordPromptRequired; /** - * This configures both the MDN filter, and the server-side + * for mail, this configures both the MDN filter, and the server-side * spam filter filters, if needed. * * If we have set up to filter return receipts into @@ -367,6 +367,7 @@ interface nsIMsgIncomingServer : nsISupports { * a filter to do that, and adds it to our filterList * if it doesn't exist. If it does, it will enable it. * + * this is not used by news filters (yet). */ void configureTemporaryFilters(in nsIMsgFilterList filterList); diff --git a/mailnews/base/search/resources/content/FilterListDialog.js b/mailnews/base/search/resources/content/FilterListDialog.js index 575d16cb648f..65afda7ab904 100644 --- a/mailnews/base/search/resources/content/FilterListDialog.js +++ b/mailnews/base/search/resources/content/FilterListDialog.js @@ -161,12 +161,11 @@ function onCancel() } */ -function onServerClick(event) +function onFilterServerClick(selection) { - var itemURI = event.target.id; + var itemURI = selection.getAttribute('id'); - // Return if same server is selected. - if (itemURI == gCurrentServerURI) + if (!itemURI || itemURI == gCurrentServerURI) return; // Save the current filters to disk before switching because diff --git a/mailnews/base/search/resources/content/FilterListDialog.xul b/mailnews/base/search/resources/content/FilterListDialog.xul index 8f9f4290eb49..c707e4d2382e 100644 --- a/mailnews/base/search/resources/content/FilterListDialog.xul +++ b/mailnews/base/search/resources/content/FilterListDialog.xul @@ -65,7 +65,7 @@