Closed Bug 19403 Opened 21 years ago Closed 16 years ago

Edit filters for multiple newsgroups simultaneously, a.k.a "server wide news filters"

Categories

(SeaMonkey :: MailNews: Message Display, enhancement, P3)

enhancement

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: revenant, Assigned: mscott)

References

Details

(Keywords: helpwanted)

Attachments

(1 file, 10 obsolete files)

I have Communicator 4.6, so please forgive me if 4.7 has already addressed this.

At the moment, it appears that if you want to apply a specific filter (e.g.
CONTAINS "Netscape") to multiple newsgroups that you have to set up
the filter individually in each and every newsgroup you want to apply it to.

It would be very handy to be able to edit the filters for multiple newsgroups
simultaneously.

Thank you.
Assignee: phil → nobody
Summary: RFE: Edit filters for multiple newsgroups simultaneously. → [HELP WANTED] Edit filters for multiple newsgroups simultaneously.
Whiteboard: [HELP WANTED]
Add to [help wanted] list
Keywords: helpwanted
Summary: [HELP WANTED] Edit filters for multiple newsgroups simultaneously. → Edit filters for multiple newsgroups simultaneously.
Whiteboard: [HELP WANTED]
Depends on: killfile
I entirely agree.  There should at least be an easy way to have a filter for a
whole news account and even for all newsgroups on all accounts.
That could be an entry like mynewsserver.org > (all)

I think that's really neccessary... I'm not willing to add the same filter that
marks messages from me for twelve groups.
OMG this is so old. Why anybody hasn't done this yet? I totally agree, this
feature would be very useful.
Blocks: 185671
OS: Windows 98 → All
Hardware: PC → All
working on a patch...
Assignee: nobody → mscott
Summary: Edit filters for multiple newsgroups simultaneously. → Edit filters for multiple newsgroups simultaneously, a.k.a "server wide news filters"
Attached patch initial patch, still needs work (obsolete) — Splinter Review
Blocks: 180008
Attachment #146391 - Attachment is obsolete: true
Attached patch updated patch, it works! (obsolete) — Splinter Review
Attachment #146417 - Attachment is obsolete: true
things to figure out:

a) the order, server or per group filter first, see my "// XXX ask david b,
should m_filterList or m_serverFilterList be first?" comment
b) I started out doing the temporary filter thing, but I'm not sure it's the way
to go.  I don't want to mark the filters from the filterlist for the group as
temporary, as changes I make to them I want changes to them to persist on disk.
 (There is UI for them, unlike the MDN / temp spam stuff for mail).  I also have
the luxury for news filters we never move message, so I can always process
filters, so I could just get two filter lists and apply them.  Also, I need the
filter log for server wide actions to be off the server, if that makes sense.

NS_IMETHODIMP nsNNTPNewsgroupList::ApplyFilterHit(nsIMsgFilter *aFilter,
nsIMsgWindow *aMsgWindow, PRBool *aApplyMore)
{
 NS_ENSURE_ARG_POINTER(aFilter);
 NS_ENSURE_ARG_POINTER(aApplyMore);
 NS_ENSURE_TRUE(m_newMsgHdr, NS_ERROR_UNEXPECTED);
 NS_ENSURE_TRUE(m_newsDB, NS_ERROR_UNEXPECTED);
 
 // you can't move news messages, so applyMore is always true
 *aApplyMore = PR_TRUE;

c)  I also have to figure out a better fix for the issue FilterListDialog.js

function onFilterServerClick(selection)
{
   var itemURI = selection.getAttribute('id');

   // Return if same server is selected.
   // XXX this "!itemURI" thing is a hack
   // we come into onFilterServerClick twice
   // and when you choose a news server, and the second time it is ""
   if (!itemURI || itemURI == gCurrentServerURI)
     return; 
Status: NEW → ASSIGNED
Blocks: 187151
-  if (type.Equals("nntp")) {
+  if (type.Equals("nntp") && !isServer) {

can you fix the braces here? A few K&R'isms have crept into this file, and I'd
like to nip that in the bud...thx for fixing the other cases :-)
if (a)
{
}

I believe the per-newsgroup filters should probably go first. It doesn't matter
right now since nothing stops filter execution for newsgroups, but if something
does, like adding a "stop execution" action, then users should be able to
override the global filters in the per-newsgroup filters.

I believe you can just use the member variable, mIsServer, instead of calling
GetIsServer. It's just code bloat to call that method and check the error
return, when we have a member var already...I can't imagine a scenario where
you're calling GetIsServer that we haven't set mIsServer already...

other than that, looks fine to me.
Blocks: 227224
Attachment #146419 - Attachment is obsolete: true
Blocks: 240879
The recent addition to the summary line discards the possibility of setting a
filter across all servers, which would be useful just as well.
Attachment #146431 - Attachment is obsolete: true
Attachment #146432 - Attachment is obsolete: true
I still need to make sure that with the MarkThreadWatched / MarkThreadIgnored
changes (for bug #227224) works.

I have a feeling that I'll need to move that code to after the point where we
call AddNewHdrToDB().
Blocks: 196441
it should work to set the flag on the hdr and then add it to the db...let me see
why that doesn't work.
the mark thread watched/ignored filter actions work in the db, but the view
isn't getting notified, so you don't see the watch/ignore icon until you go to
another newsgroup and then back to the original one. I could just fix the thread
code to call back into the db to have the correct notifications sent around, and
save you adding state to nsNNTPNewsgroupList...
> The recent addition to the summary line discards the possibility of setting a
> filter across all servers, which would be useful just as well.

we'll have to spin that off into a new bug.  next up will be global mail filters.
Attachment #146457 - Attachment is obsolete: true
No longer blocks: 227224
Attachment #146467 - Attachment is obsolete: true
fixed.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Blocks: 240476
We have a chance to get this fix into the 1.7 branch or is it already done?

verified.
Status: RESOLVED → VERIFIED
Attached patch actual patchSplinter Review
Attachment #146468 - Attachment is obsolete: true
fixed on the 0.6 tbird branch
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.