Ignore:
Timestamp:
09/24/07 10:22:29 (17 years ago)
Author:
niltonneto
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/instant_messenger/js/im_functions.js

    r70 r72  
    11        function IM() 
    22        { 
    3            this._listen     = true; 
    43           this.vcards      = false; 
    54           this.labelVcard  = []; 
     
    3130        IM.prototype.listen = function() 
    3231        { 
    33            if ( !this._listen ) 
    34               return false; 
    35  
    3632           var _this = this; 
    37            var handler = function(data) 
     33           var handler = function(XMLdata) 
    3834           { 
    3935              try 
     
    4541                                } 
    4642 
    47                     _this.getContacts(data); 
    48                     _this.getPresence(data); 
    49                                 _this.getComposing(data); 
    50                     _this.getMessages(data); 
    51                                 _this.getVcard(data); 
     43                    _this.getContacts(XMLdata); 
     44                    _this.getPresence(XMLdata); 
     45                                _this.getComposing(XMLdata); 
     46                    _this.getMessages(XMLdata); 
     47                                _this.getVcard(XMLdata); 
    5248 
    5349                if(!_this.vcards) 
     
    5652                        _this.vcards = true; 
    5753                    } 
     54 
    5855              }catch(e){} 
    5956 
    60               _this._listen = true; 
    6157              setTimeout('IM.listen()', 3000); 
    6258           }; 
     
    801797   }; 
    802798 
    803    IM.prototype.setStatus = function(pStatus) 
    804    { 
    805       try 
    806       { 
    807               var handler = function() 
    808               { 
    809               }; 
    810               im_menu_action.menu('fast_menu_im', null); 
    811  
    812               if ( pStatus == 'custom' ) 
    813               { 
    814                 pStatus = prompt('Personalize seu Status : '); 
    815                 pStatus = 'show=' + statusFlag + '&status=' + pStatus; 
    816               } 
    817               else 
    818               { 
    819                 if ( pStatus == 'unavailable' ) 
    820                 { 
    821                                 this.ImgStatus(pStatus); 
    822                         pStatus = 'type=' + pStatus; 
    823                 } 
    824                 else 
    825                 { 
    826                  try 
    827                  { 
    828                                 this.ImgStatus(pStatus); 
    829                                 pStatus = 'show=' + pStatus; 
    830                  }catch(e){} 
    831                 } 
    832               } 
    833                   XMLTools.request('$this.Ujabber.setPresence', 'POST', handler, pStatus); 
    834           } 
    835           catch(e){} 
    836    }; 
     799        IM.prototype.setStatus = function(pStatus) 
     800        { 
     801                try 
     802                { 
     803                        var handler = function() 
     804                        { 
     805                        }; 
     806 
     807                        if ( func.byId('fast_menu_im').style.display == 'block' ) 
     808                                im_menu_action.menu('fast_menu_im', null); 
     809                         
     810                        if ( pStatus == 'custom' ) 
     811                        { 
     812                                pStatus = prompt('Personalize seu Status : '); 
     813                                pStatus = 'show=' + statusFlag + '&status=' + pStatus; 
     814                        } 
     815                        else 
     816                        { 
     817                                if ( pStatus == 'unavailable' ) 
     818                                { 
     819                                        this.ImgStatus(pStatus); 
     820                                        pStatus = 'type=' + pStatus; 
     821                                } 
     822                                else 
     823                                { 
     824                                        try 
     825                                        { 
     826                                                this.ImgStatus(pStatus); 
     827                                                pStatus = 'show=' + pStatus; 
     828                                        } 
     829                                        catch(e) 
     830                                        {} 
     831                                } 
     832                        } 
     833                        XMLTools.request('$this.Ujabber.setPresence', 'POST', handler, pStatus); 
     834                } 
     835                catch(e) 
     836                {} 
     837        }; 
    837838 
    838839   IM.prototype.ImgStatus = function(pStatus) 
     
    845846   IM.prototype.setAway = function() 
    846847   { 
    847       if ( statusFlag != 'available' ) 
     848      if ( statusFlag != 'available' || this._listen > 0 ) 
    848849         return false; 
    849850 
     
    860861   }; 
    861862 
    862    IM.prototype.infoContact = function(pUid) 
    863    { 
    864       var info = false; 
    865       var div_allg = document.getElementById('all_groups'); 
    866       var elements = div_allg.firstChild; 
    867       while ( elements ) 
    868       { 
    869          var childs = elements.firstChild; 
    870          while( childs ) 
    871          { 
    872             if(childs.tagName == "DIV" && childs.id.indexOf(pUid) === 0 ) 
    873             { 
    874                info = {'jid':childs.id, 'src':childs.firstChild.src}; 
    875                break; 
    876             } 
    877             childs = childs.nextSibling; 
    878          } 
    879          if ( !info ) 
    880             elements = elements.nextSibling; 
    881          else 
    882             break; 
    883       } 
    884       return info; 
    885    }; 
     863        IM.prototype.infoContact = function(pUid) 
     864        { 
     865                try 
     866                { 
     867                        var info = false; 
     868                        var div_allg = document.getElementById('all_groups'); 
     869                        var elements = div_allg.firstChild; 
     870                        while ( elements ) 
     871                        { 
     872                                var childs = elements.firstChild; 
     873                                while( childs ) 
     874                                { 
     875                                        if(childs.tagName == "DIV" && childs.id.indexOf(pUid) === 0 ) 
     876                                        { 
     877                                                info = {'jid':childs.id, 'src':childs.firstChild.src}; 
     878                                                break; 
     879                                        } 
     880                                        childs = childs.nextSibling; 
     881                                } 
     882                                if ( !info ) 
     883                                        elements = elements.nextSibling; 
     884                                else 
     885                                        break; 
     886                        } 
     887                        return info; 
     888                } 
     889                catch(e) 
     890                { 
     891                        return false; 
     892                } 
     893        }; 
    886894 
    887895var IM = new IM(); 
Note: See TracChangeset for help on using the changeset viewer.