Index: /sandbox/2.5.0-expresso1/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- /sandbox/2.5.0-expresso1/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 7157)
+++ /sandbox/2.5.0-expresso1/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 7184)
@@ -5444,45 +5444,44 @@
         return($this->functions->CalculateDateOffset());
     }
-    
+
     //MailArchiver -> get message flags only, invoked at archive operation
+    //Marcosw início - modificação da estrutura da função, removendo estr. de repetição desnecessária
     function get_msg_flags($args){       
 		$msg_folder = $args['folder'];
         $msg_n = $args['msg_number'];
         
-        $arr_msg = explode(",", $msg_n);
-       
-        for($i=0; $i<count($arr_msg); $i++){
-                        
-            if(!$this->mbox || !is_resource($this->mbox))
-                $this->mbox = $this->open_mbox($msg_folder);
-        
-            if(!is_resource($this->mbox))
-                return(false);
-                       
-            $header = @imap_headerinfo($this->mbox, imap_msgno($this->mbox, $arr_msg[$i]), 80, 255);
-                
-            if (!is_object($header))
-                return false;
-
-            $taglist[$i]["msgid"] = $msg_n;
-            $taglist[$i]["unseen"] = $header->Unseen;
-            $taglist[$i]["recent"] = $header->Recent;
-            $taglist[$i]["flagged"] = $header->Flagged;
-            $taglist[$i]["draft"] = $header->Draft;
-            $taglist[$i]["answered"] = $header->Answered;
-            $taglist[$i]["deleted"] = $header->Deleted;
-        
-            if($header->Answered =='A' && $header->Draft == 'X')
-                $taglist[$i]['forwarded'] = 'F';
-            else
-                $taglist[$i]['forwarded'] = ' ';
-        
-            if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_important_flag']) {
-                $flag = preg_match('/importance *: *(.*)\r/i',imap_fetchheader($this->mbox, imap_msgno($this->mbox, $arr_msg[$i])),$importance);
-                $taglist[$i]["importance"] = $flag==0?"Normal":$importance[1];
-            }
+        if(!$this->mbox || !is_resource($this->mbox))
+            $this->mbox = $this->open_mbox($msg_folder);
+    
+        if(!is_resource($this->mbox))
+            return(false);
+          
+        $a = imap_msgno($this->mbox, $msg_n);          
+        $header = @imap_headerinfo($this->mbox, $a, 80, 255);
+		
+        if (!is_object($header))
+            return false;
+
+        $taglist["msgid"] = $msg_n;
+        $taglist["unseen"] = $header->Unseen;
+        $taglist["recent"] = $header->Recent;
+        $taglist["flagged"] = $header->Flagged;
+        $taglist["draft"] = $header->Draft;
+        $taglist["answered"] = $header->Answered;
+        $taglist["deleted"] = $header->Deleted;
+    
+        if($header->Answered =='A' && $header->Draft == 'X')
+            $taglist['forwarded'] = 'F';
+        else
+            $taglist['forwarded'] = ' ';
+    
+        if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_important_flag']) {
+            $flag = preg_match('/importance *: *(.*)\r/i',imap_fetchheader($this->mbox, imap_msgno($this->mbox, $msg_n)),$importance);
+            $taglist["importance"] = $flag==0?"Normal":$importance[1];
         }
+
 		return $taglist;        
     }    
+    // Marcosw fim
 	/* Airton
 	 * Fim dos métodos 
Index: /sandbox/2.5.0-expresso1/expressoMail1_2/js/mail_archiver.js
===================================================================
--- /sandbox/2.5.0-expresso1/expressoMail1_2/js/mail_archiver.js	(revision 7183)
+++ /sandbox/2.5.0-expresso1/expressoMail1_2/js/mail_archiver.js	(revision 7184)
@@ -527,5 +527,8 @@
     }
     else{
-        document.getElementById('main_title').innerHTML = get_lang("All done. End of archive messages operation");
+        //document.getElementById('main_title').innerHTML = get_lang("All done. End of archive messages operation");
+        //Marcosw inicio - Melhoria na exibição de mensagem
+        write_msg(get_lang("All done. End of archive messages operation"));
+        //Marcosw fim
         expresso_mail_archive.resetObject();
         expresso_mail_archive.archivefolder = null;
Index: /sandbox/2.5.0-expresso1/expressoMail1_2/js/main.js
===================================================================
--- /sandbox/2.5.0-expresso1/expressoMail1_2/js/main.js	(revision 7183)
+++ /sandbox/2.5.0-expresso1/expressoMail1_2/js/main.js	(revision 7184)
@@ -1595,4 +1595,25 @@
 
 /* function archive_msgs(folder,folder_dest,id_msgs) {
+    write_msg(get_lang('Starting to archive messages'));
+
+    if(currentTab.toString().indexOf("_r") != -1){
+        id_msgs = currentTab.toString().substr(0,currentTab.toString().indexOf("_r"));
+    }
+
+    if(!id_msgs)
+        id_msgs = get_selected_messages();
+
+    if(folder_dest=='local_root' || folder_dest==null)//Default archive destiny = local_inbox folder
+        folder_dest = 'local_inbox';
+    
+    if (parseInt(id_msgs) > 0 || id_msgs.length > 0){       
+        expresso_mail_archive.Archive(folder,folder_dest,id_msgs);
+    }
+    else
+        write_msg(get_lang('No selected message.'));
+
+
+
+	/*
 	if(proxy_mensagens.is_local_folder(folder)) {
 		write_msg(get_lang("You cant archive local mails"));
@@ -1631,14 +1652,15 @@
 	var handler_arquivar_mensagens = function(data) {
 	  
-	    var msgs_info = [];
+	    //var msgs_info = [];
 	  
-	    for( var i = 0; i < data.length; i++ )
-		msgs_info[i] = connector.unserialize( data[i] );
+	    //for( var i = 0; i < data.length; i++ )
+		//msgs_info[i] = connector.unserialize( data[i] );
 
 	    //vejo se já tinha mensagens locais
-	    var h = expresso_local_messages.has_local_mails();
+	    //var h = expresso_local_messages.has_local_mails();
 	    
-	    expresso_local_messages.insert_mails( msgs_info, folder_dest, function( s, f ){complete_archiving( s, f, h )} );
-
+	    //expresso_local_messages.insert_mails( msgs_info, folder_dest, function( s, f ){complete_archiving( s, f, h )} );
+
+	    expresso_mail_archive.Archive(folder,folder_dest,id_msgs);
 	    document.getElementById("overlay").style.visibility = "hidden";
 	}
