Added Flag/Unflag buttons. I have been up for 2 days straight. Please check for...
[squirrelmail.git] / src / move_messages.php
index 8200de48fa4b54d1c1664d38aa054c15db5507d3..008bf1eaaff14c85ded0daa42b6a8638a7889af7 100644 (file)
@@ -3,15 +3,16 @@
 /**
  * move_messages.php
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 1999-2004 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * Enables message moving between folders on the IMAP server.
  *
  * $Id$
+ * @package squirrelmail
  */
 
-/* Path for SquirrelMail required files. */
+/** Path for SquirrelMail required files. */
 define('SM_PATH','../');
 
 /* SquirrelMail required files. */
@@ -77,7 +78,7 @@ function attachSelectedMessages($msg, $imapConnection) {
             $fp = fopen( $full_localfilename, 'wb');
             fwrite ($fp, $body);
             fclose($fp);
-            $composeMessage->initAttachment('message/rfc822',$subject.'.eml',
+            $composeMessage->initAttachment('message/rfc822',$subject.'.msg',
                  $full_localfilename);
         }
     }
@@ -172,13 +173,16 @@ 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 if (isset($markFlagged)) {
+                sqimap_toggle_flag($imapConnection, $id, '\\Flagged', true, true);
+            } else if (isset($markUnflagged)) {
+                sqimap_toggle_flag($imapConnection, $id, '\\Flagged', false, true);
             } else  {
-                if (!$button_action) {
+                if (!boolean_hook_function('move_messages_button_action', NULL, 1)) {
                     sqimap_msgs_list_delete($imapConnection, $mailbox, $id,$bypass_trash);
                     if ($auto_expunge) {
                         $cnt = sqimap_mailbox_expunge($imapConnection, $mailbox, true);