- Timestamp:
- 10/15/10 16:01:58 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/expressoMail1_2/js/mail_sync.js
r3345 r3364 29 29 this.localServer = google.gears.factory.create('beta.localserver'); 30 30 this.store = this.localServer.createStore('test-store'); 31 this.update_folder = false; 31 32 } 32 33 … … 48 49 49 50 mail_sync.prototype.start_sync = function() { 51 if (is_ie) 52 connector.loadScript('TreeShow'); 50 53 if(this.working) { 51 54 //Já está sincronizando... … … 97 100 98 101 if (!rs2.isValidRow()) { 102 if((!preferences.hide_folders) || (preferences.hide_folders=="0")) 103 this.update_folder = true; //Precisa atualizar as pastas na arvore de pastas 99 104 this.dbGears.execute("insert into folder (folder,uid_usuario) values (?,?)", [actual_check, account_id]); 100 105 } … … 102 107 actual_check += "/"+folders_to_check[parseInt(i)+1]; 103 108 } 104 ttreeBox.update_folder();109 105 110 rs.next(); 106 111 } … … 138 143 document.getElementById('main_title').innerHTML = get_lang("Deleting downloadeds msgs..."); 139 144 expresso_mail_sync.remove_archived_mails(); 140 this.working=false; 141 update_menu(); 145 if((!preferences.hide_folders) || (preferences.hide_folders=="0")) { 146 if (expresso_mail_sync.update_folder) { 147 ttreeBox.update_folder(); 148 expresso_mail_sync.update_folder = false; 149 } 150 else 151 draw_tree_local_folders(); 152 } 153 expresso_mail_sync.working=false; 142 154 return; 143 155 } … … 147 159 if(folder_to_sync[3]) { //Em caso de arquivamento normal, pode ser que a pasta inbox ainda não tenha sido criada. 148 160 expresso_mail_sync.open_conn() 149 if(!expresso_mail_sync.has_local_mails()) { 161 if(folder_to_sync[1]=="Inbox" && !expresso_mail_sync.has_inbox_folder()) { 162 if((!preferences.hide_folders) || (preferences.hide_folders=="0")) 163 expresso_mail_sync.update_folder = true; //Precisa atualizar as pastas na arvore de pastas 150 164 expresso_mail_sync.dbGears.execute("insert into folder (folder,uid_usuario) values (?,?)",["Inbox",account_id]); 151 165 } 152 166 expresso_mail_sync.dbGears.close(); 153 ttreeBox.update_folder();167 154 168 155 169 } 156 170 157 171 var start_sync_mails = function(data) { 172 if (!data) { //Erro ao pegar lista de e-mails a serem baixados 173 write_msg(get_lang("Problems while downloading mails, please try later")); 174 expresso_mail_sync.working=false; 175 window.setTimeout("eval('document.getElementById(\"main_title\").innerHTML =\"Expresso Mail\"')",3000); 176 return; 177 } 158 178 expresso_mail_sync.messages=data; 159 179 if(expresso_mail_sync.is_auto) … … 338 358 } 339 359 340 mail_sync.prototype.has_ local_mails= function() {//This function considers that the connection with base is already opened.341 var rs = this.dbGears.execute("select rowid from folder limit 0,1");360 mail_sync.prototype.has_inbox_folder = function() {//This function considers that the connection with base is already opened. 361 var rs = this.dbGears.execute("select rowid from folder where folder='Inbox' and uid_usuario=?",[account_id]); 342 362 if(rs.isValidRow()) 343 363 return true; … … 377 397 Element('tot_m').innerHTML = parseInt(Element('tot_m').innerHTML) - data.msgs_number.length; 378 398 } 379 ttreeBox.update_folder();399 380 400 refresh(); 381 401 expresso_mail_sync.remove_archived_mails();
Note: See TracChangeset
for help on using the changeset viewer.