filter fix on folder/rename is back in. added hooks back to imap_mailbox.php, reworke...
authorjmunro <jmunro@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 12 Mar 2002 20:40:03 +0000 (20:40 +0000)
committerjmunro <jmunro@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 12 Mar 2002 20:40:03 +0000 (20:40 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2572 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_mailbox.php
plugins/filters/filters.php
plugins/filters/setup.php

index d392c13..2ecd675 100755 (executable)
@@ -184,7 +184,7 @@ function sqimap_mailbox_delete ($imap_stream, $mailbox)
     $read_ary = sqimap_run_command($imap_stream, "DELETE \"$mailbox\"",
                                  TRUE, $response, $message);
     sqimap_unsubscribe ($imap_stream, $mailbox);
//   do_hook("rename_or_delete_folder");
      do_hook_function("rename_or_delete_folder",$args = array($mailbox, 'delete', ''));
 }
 
 /***********************************************************************
@@ -222,7 +222,7 @@ function sqimap_mailbox_rename( $imap_stream, $old_name, $new_name ) {
                                  TRUE, $response, $message);
         sqimap_unsubscribe($imap_stream, $old_name.$postfix);
         sqimap_subscribe($imap_stream, $new_name.$postfix);
-//        do_hook("rename_or_delete_folder");
+        do_hook_function("rename_or_delete_folder",$args = array($old_name, 'rename', $new_name));
         $l = strlen( $old_name ) + 1;
         $p = 'unformatted';
         foreach ( $boxesall as $box ) {
@@ -235,7 +235,7 @@ function sqimap_mailbox_rename( $imap_stream, $old_name, $new_name ) {
                 }
                 sqimap_unsubscribe($imap_stream, $box[$p]);
                 sqimap_subscribe($imap_stream, $new_sub);
-            //    do_hook("rename_or_delete_folder");
+                       do_hook_function("rename_or_delete_folder",$args = array($box[$p], 'rename', $new_sub));
             }
         }
     }
index 1550fa5..5259d1b 100644 (file)
@@ -707,7 +707,10 @@ function filter_swap($id1, $id2) {
 
 /* This update the filter rules when
    renaming or deleting folders */
-function update_for_folder ($old_folder, $action, $new_folder = 'INBOX') {
+function update_for_folder ($args) {
+    $old_folder = $args[0];
+       $new_folder = $args[2];
+       $action = $args[1];
     global $plugins, $data_dir, $username;
     $filters = array();
     $filters = load_filters();
index 99e9357..a390627 100644 (file)
@@ -86,7 +86,7 @@ function squirrelmail_plugin_init_filters() {
     }
     $squirrelmail_plugin_hooks['optpage_register_block']['filters'] = 'squirrelmail_plugin_optpage_register_block';
 #    $squirrelmail_plugin_hooks['special_mailbox']['filters'] = 'filters_special_mailbox';
-//    $squirrelmail_plugin_hooks['rename_or_delete_folder']['filters'] = 'update_for_folder';
+    $squirrelmail_plugin_hooks['rename_or_delete_folder']['filters'] = 'update_for_folder';
 }
 
 function filters_special_mailbox( $mb ) {