Changeset 2988 for trunk


Ignore:
Timestamp:
07/01/10 15:16:19 (14 years ago)
Author:
alexandrecorreia
Message:

Ticket #1116 - As vezes a operacao de remover um contato da lista nao funcionava direito.

Location:
trunk/jmessenger
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/jmessenger/js/jscode/loadIM.js

    r2983 r2988  
    344344                        var _options = [ 
    345345                                                ['Adicionar Contato', 'loadscript.addContact();' ], 
    346                                                 ['Ajuda', 'alert("2")' ], 
    347346                                                ['Preferências', 'loadscript.preferences();'], 
    348347                                                   ]; 
     
    769768                { 
    770769                        var _element = arguments[0]  
    771                         var _parent  = _element.parentNode; 
    772                          
    773                         if( _element ) 
    774                                 _parent.removeChild( _element ); 
     770                         
     771                        if( _element != null ) 
     772                        { 
     773                                _element.parentNode.removeChild( _element ); 
     774                        } 
    775775                } 
    776776        } 
     
    916916                                 
    917917                                        break; 
    918                                          
    919                                 default : 
    920                                         alert( "SEM PARAMETRO DEFINIDO : " + subscription ); 
    921                                          
    922918                } 
    923919        } 
  • trunk/jmessenger/js/trophyim.js

    r2984 r2988  
    10431043    { 
    10441044        var divItenContact       = null; 
    1045         var spanShow             = null; 
    10461045 
    10471046        if( ( divItenContact = document.getElementById('itenContact_' + jidTo ))) 
    10481047        {        
    1049                 loadscript.removeElement( document.getElementById('itenContactNotification_' + jidTo ) ); 
    1050                  
    1051                 spanShow = document.getElementById('span_show_itenContact_' + jidTo ) 
    1052                  
    1053                 spanShow.parentNode.removeChild(spanShow); 
    1054                  
    1055                 loadscript.removeGroup( divItenContact.parentNode ); 
    1056                  
    1057                 divItenContact.parentNode.removeChild(divItenContact); 
    1058                  
    10591048                // Remove Contact 
    10601049                var _id = TrophyIM.connection.getUniqueId();     
     
    10631052                        delContact      = delContact.c('item').attrs({jid: jidTo, subscription:'remove'}).tree(); 
    10641053 
    1065                 TrophyIM.connection.send( delContact );                  
     1054                TrophyIM.connection.send( delContact ); 
     1055                 
     1056                        loadscript.removeElement( document.getElementById('itenContactNotification_' + jidTo ) ); 
     1057                 
     1058                var spanShow = document.getElementById('span_show_itenContact_' + jidTo ) 
     1059                        spanShow.parentNode.removeChild(spanShow); 
     1060                 
     1061                loadscript.removeGroup( divItenContact.parentNode ); 
     1062                 
     1063                divItenContact.parentNode.removeChild(divItenContact); 
    10661064        } 
    10671065    }, 
     
    12631261                                                                statusColor     = "orange";      
    12641262                                                                break; 
    1265                                                                  
    1266                                                         default: 
    1267                                                                 paramsContact.status = " ( SEM PARAMETRO DEFINIDO" + objContact.contact.subscription + " ) "; 
    12681263                                                } 
    12691264 
     
    13721367                                                 
    13731368                                                itensJid.style.background       = "url('"+path_jabberit+"templates/default/images/" + presence + ".gif') no-repeat center left"; 
    1374                                                  
    13751369                                        } 
    13761370         
     
    17021696        this.addContact = function(jid, subscription, name, groups ) 
    17031697        { 
    1704                 if( subscription === "remove" || subscription == "remove") 
     1698                if( subscription.indexOf("remove") >= 0 )        
    17051699        { 
    17061700                        this.removeContact(jid); 
     
    18661860        var jid_lower   = barejid.toLowerCase(); 
    18671861         
    1868                 if( show != 'unavailable') 
     1862        if( show != 'unavailable' && show != 'error' ) 
    18691863                { 
    18701864            if (!this.roster[jid_lower]) 
     
    18881882            this.roster[jid_lower]['presence'][resource] = presence; 
    18891883        } 
    1890                 else if (this.roster[jid_lower] && this.roster[jid_lower]['presence'] && this.roster[jid_lower]['presence'][resource]) 
    1891                 { 
    1892             delete this.roster[jid_lower]['presence'][resource]; 
     1884        else  
     1885                { 
     1886                delete this.roster[jid_lower]; 
    18931887        } 
    18941888         
Note: See TracChangeset for help on using the changeset viewer.