Added 4 hooks (internal_link, mailbox_display_buttons, move_messages_button_action...
[squirrelmail.git] / src / move_messages.php
index bc1cd4eb020e4593185e7a3ddd623a7e91e7def6..43b89e567a6cb3a624334407b2c2fa9ad10adb98 100644 (file)
@@ -69,7 +69,7 @@ function attachSelectedMessages($msg, $imapConnection) {
             $body_a = sqimap_run_command($imapConnection, "FETCH $id RFC822",true, $response, $readmessage, $uid_support);
             if ($response == 'OK') {
             $k = $i + $start_index;
-        $subject = $msgs[$k]['SUBJECT'];
+            $subject = $msgs[$k]['SUBJECT'];
 
             array_shift($body_a);
             $body = implode('', $body_a);
@@ -177,14 +177,17 @@ if(isset($expungeButton)) {
     if (count($id)) {
         $cnt = count($id);
         if (!isset($attache)) {
+            $button_action = concat_hook_function('move_messages_button_action');
             if (isset($markRead)) {
                 sqimap_toggle_flag($imapConnection, $id, '\\Seen',true,true);
             } else if (isset($markUnread)) {
                 sqimap_toggle_flag($imapConnection, $id, '\\Seen',false,true);
             } else  {
-                sqimap_msgs_list_delete($imapConnection, $mailbox, $id);
-                if ($auto_expunge) {
-                    $cnt = sqimap_mailbox_expunge($imapConnection, $mailbox, true);
+                if (!$button_action) {
+                    sqimap_msgs_list_delete($imapConnection, $mailbox, $id);
+                    if ($auto_expunge) {
+                        $cnt = sqimap_mailbox_expunge($imapConnection, $mailbox, true);
+                    }
                 }
             }
         }