Index: /trunk/expressoMail1_2/js/mail_archiver.js
===================================================================
--- /trunk/expressoMail1_2/js/mail_archiver.js	(revision 7455)
+++ /trunk/expressoMail1_2/js/mail_archiver.js	(revision 7458)
@@ -710,9 +710,18 @@
             "&flags="       + flags +
             "&id="          + id;
-        
+
+            //Decrementa valor total de nÃ£o lidas/total de mensagens na aba de listagem de mensagens
+            if(flags.indexOf("U") != -1){
+                expresso_mail_archive.tot_unseen_msgs_tab -= 1;
+                Element('new_m').innerHTML = '<font color="RED">'+expresso_mail_archive.tot_unseen_msgs_tab+'</font>';
+            }
+            expresso_mail_archive.tot_msgs_tab -= 1;
+            Element("tot_m").innerHTML = expresso_mail_archive.tot_msgs_tab; //folder_num_msgs;
+
             var handler_unarchive = function(data){
                 expresso_mail_archive.unarchieveController(data);
             }
             write_msg(get_lang('Unarchiving message %1 of %2', (expresso_mail_archive.unarchivecounter + 1), expresso_mail_archive.message_list.length));
+            
             cExecute ("$this.imap_functions.unarchive_mail&", handler_unarchive, params);
         }
@@ -1398,5 +1407,4 @@
 MailArchiver.prototype.listAllMessagesByFolder = function(folderid, searchType){
     try{
-        //Marcosw
         if(searchType == "ALL")
             var query_messages = '{"query":{"folder":[{"@id":"'+folderid+'"}], "order":[{"@asc":"date"}]}}';
@@ -1416,5 +1424,4 @@
     for(var i=0; i< returnService.getReturn().length; i++){
         msglist.push(returnService.getReturn()[i]._id);
-        //Marcosw
         if(returnService.getReturn()[i]._tags.indexOf("unseen") != -1){
             expresso_mail_archive.tot_unseen_msgs_tab++;
Index: /trunk/expressoMail1_2/js/messages_controller.js
===================================================================
--- /trunk/expressoMail1_2/js/messages_controller.js	(revision 7455)
+++ /trunk/expressoMail1_2/js/messages_controller.js	(revision 7458)
@@ -11,11 +11,7 @@
     messages_proxy.prototype.messages_list = function(folder,msg_range_begin,emails_per_page,sort_box_type,search_box_type,sort_box_reverse,preview_msg_subject,preview_msg_tip,call_back) {
         if(this.is_local_folder(folder)) {
-
             //MAILARCHIVER-01
-            
-            //var baseFolder = folder.substr(6);
             var baseFolder = folder.replace('local_messages_', '');
             var tree_name;
-            //var drawinginfo = {treeObject: tree_name, treeName: tree_name, folderName: baseFolder};
             var drawinginfo = {};
             expresso_mail_archive.update_counters = false;
@@ -30,26 +26,14 @@
             }
             else{
-                if (!tree_name){
-                    //window.alert('sem arvore para atualizar, com sort_box_type =' + sort_box_type + ' e search_box_type= ' + search_box_type + ' reverse -- ' + sort_box_reverse);
-                    var exp_dfs = new Array(baseFolder,msg_range_begin,emails_per_page,sort_box_type,search_box_type,sort_box_reverse,preview_msg_subject,preview_msg_tip);
-                    expresso_mail_archive.queryconfig.setExpressoDefaults(exp_dfs);
-                    //Para recontagem de mensagens para aba e paginação.
-                    expresso_mail_archive.tot_msgs_tab = 0;
-                    expresso_mail_archive.tot_unseen_msgs_tab = 0;
-                    expresso_mail_archive.listAllMessagesByFolder(folder.replace("local_messages_",""), search_box_type);
-                    selectAllFolderMsgs(false);
-                    populateSelectedMsgs(expresso_mail_archive.allmessagesbyfolder);
-                    expresso_mail_archive.listMessages();
-                }
-                if(tree_name == 'folders_tree'){
-                    /*var div_export_local = document.createElement('div');
-                    div.style.width
-                    var lbl_check = document.createElement('label');
-                    var check_export_local_recursive = document.createElement('input');
-                    var lbl_combo = document.createElement('label');
-                    var combo_export_local_format = document.createElement('select');*/
-                    //window.alert('alert td content = ' + Element('div_buttons').getElementsByTagName('table')[0].tbody[0].tr[4].td[0].innerHTML);
-                    //Element('div_buttons').appendChild(div_export_local);
-                }
+                //window.alert('sem arvore para atualizar, com sort_box_type =' + sort_box_type + ' e search_box_type= ' + search_box_type + ' reverse -- ' + sort_box_reverse);
+                var exp_dfs = new Array(baseFolder,msg_range_begin,emails_per_page,sort_box_type,search_box_type,sort_box_reverse,preview_msg_subject,preview_msg_tip);
+                expresso_mail_archive.queryconfig.setExpressoDefaults(exp_dfs);
+                //Para recontagem de mensagens para aba e paginação.
+                expresso_mail_archive.tot_msgs_tab = 0;
+                expresso_mail_archive.tot_unseen_msgs_tab = 0;
+                expresso_mail_archive.listAllMessagesByFolder(folder.replace("local_messages_",""), search_box_type);
+                selectAllFolderMsgs(false);
+                populateSelectedMsgs(expresso_mail_archive.allmessagesbyfolder);
+                expresso_mail_archive.listMessages();
             }
 
@@ -80,45 +64,4 @@
         }
     }
-	messages_proxy.prototype.messages_list_old = function(folder,msg_range_begin,emails_per_page,sort_box_type,search_box_type,sort_box_reverse,preview_msg_subject,preview_msg_tip,call_back) {
-		if(this.is_local_folder(folder)) {
-			var real_folder = folder.substr(6);		
-			var msgs = expresso_local_messages.get_local_range_msgs(real_folder,msg_range_begin,preferences.max_email_per_page,sort_box_type,sort_box_reverse,search_box_type,preferences.preview_msg_subject,preferences.preview_msg_tip);
-			if(call_back) 
-				call_back(msgs);
-			else{
-				call_back = function(data)
-				{
-					alternate_border(0); 
-					draw_box(data, get_current_folder());
-				} 
-				call_back(msgs);
-			}
-			draw_tree_local_folders();
-		}else {
-			$.ajax({
-				url: "controller.php?" + $.param( {action: "$this.imap_functions.get_range_msgs3", 
-								    folder: folder, 
-								    msg_range_begin: msg_range_begin, 
-								    msg_range_end: emails_per_page, 
-								    sort_box_type: sort_box_type, 
-								    search_box_type: search_box_type, 
-								    sort_box_reverse: sort_box_reverse } ),
-
-			      success: function( data ){
-				    data = connector.unserialize(data);
-				    
-				    if( data )
-						call_back( data );
-			      },
-				  beforeSend: function( jqXHR, settings ){
-				  	connector.showProgressBar();
-				  },
-				  complete: function( jqXHR, settings ){
-				  	connector.hideProgressBar();
-				  }
-			  
-			});
-		}
-	}
 
 	messages_proxy.prototype.get_msg = function(msg_number,msg_folder,set_flag,call_back) {
