[imp] Filter on refresh of folder view

Dan Wilson dan@acucore.com
Mon, 5 Aug 2002 16:47:24 -0600


I've worked on a patch for folders.php to run filters, but have run into a 
small snag.

Here's my patch so far (borrowed from lib/Sessions.php):
[dan@ryloth imp]$ cvs diff folders.php 
Index: folders.php
===================================================================
RCS file: /repository/imp/folders.php,v
retrieving revision 2.177
diff -r2.177 folders.php
137a138,149
>     if ($prefs->getValue('filter_on_refresh')) {
>         // Open the INBOX read-write.
>         imap_reopen($_SESSION['imp']['stream'], IMP::serverString
() . 'INBOX');
> 
>         // Run filters.
>         include_once IMP_BASE . '/lib/Filter.php';
>         $imp_filter = new IMP_Filter();
>         $imp_filter->filter();
> 
>         // Return to read-only.
>         imap_reopen($_SESSION['imp']['stream'], IMP::serverString(), 
OP_HALFOPEN);
>     }

My problem is that when a new message comes, the javascript alert pops up 
telling me that their are ## new messages in INBOX.  If I cancel the request 
to go to that folder and then hit refresh, the filtering happens.

So how do I get it to run the filters prior to the javascript popup?  I 
couldn't find the code that does this.

-Dan