Ignore:
Timestamp:
05/05/10 14:58:58 (14 years ago)
Author:
alexandrecorreia
Message:

Ticket #986 - Implementado a forma de informar um status de message tb pela lista de contatos.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/jabberit_messenger/trophy_expresso/js/trophyim.js

    r2706 r2711  
    13521352                                } 
    13531353                                else 
    1354                                         TrophyIM.connection.send($pres( ).c('show').t(_type).tree()); 
     1354                                { 
     1355                                        if( loadscript.getStatusMessage() != "" ) 
     1356                                        { 
     1357                                                var _presence = $pres( ); 
     1358                                                _presence.node.appendChild( Strophe.xmlElement( 'show' ) ).appendChild( Strophe.xmlTextNode( _type ) ); 
     1359                                                _presence.node.appendChild( Strophe.xmlElement( 'status' ) ).appendChild( Strophe.xmlTextNode( loadscript.getStatusMessage() )); 
     1360                                                 
     1361                                                TrophyIM.connection.send( _presence.tree() ); 
     1362                                        } 
     1363                                        else 
     1364                                        { 
     1365                                                TrophyIM.connection.send($pres( ).c('show').t(_type).tree()); 
     1366                                        } 
     1367                                } 
    13551368                        } 
    13561369                } 
     
    13601373                        var _status     = ""; 
    13611374                         
    1362                         if (( _status = prompt("Digite sua mensagem !") )) 
    1363                         { 
    1364                                 for(var resource in TrophyIM.rosterObj.roster[Base64.decode(loadscript.getUserCurrent().jid)].presence ) 
    1365                                 { 
    1366                                 if ( TrophyIM.rosterObj.roster[Base64.decode(loadscript.getUserCurrent().jid)].presence[ resource ].constructor == Function ) 
    1367                                         continue; 
    1368                                  
    1369                                         if ( TROPHYIM_RESOURCE === ("/" + resource) ) 
    1370                                                 _show = TrophyIM.rosterObj.roster[Base64.decode(loadscript.getUserCurrent().jid)].presence[resource].show; 
    1371                                 } 
    1372  
    1373                                 var _presence = $pres( ); 
    1374                                 _presence.node.appendChild( Strophe.xmlElement( 'show' ) ).appendChild( Strophe.xmlTextNode( _show ) ); 
    1375                                 _presence.node.appendChild( Strophe.xmlElement( 'status' ) ).appendChild( Strophe.xmlTextNode( _status ) ); 
     1375                        if( arguments.length < 2 ) 
     1376                        { 
     1377                                if( loadscript.getStatusMessage() != "" ) 
     1378                                        _status = prompt("Digite sua mensagem !!!", loadscript.getStatusMessage()); 
     1379                                else 
     1380                                        _status = prompt("Digite sua mensagem !!!"); 
    13761381                                 
    1377                                 TrophyIM.connection.send( _presence.tree() ); 
     1382                                var _divStatus = document.getElementById("JabberIMStatusMessage"); 
     1383                                 
     1384                                if( ( _status = _status.replace(/^\s+|\s+$|^\n|\n$/g,"") ) != "") 
     1385                                        _divStatus.firstChild.innerHTML = "( " + _status + " )"; 
     1386                        }  
     1387                        else 
     1388                        { 
     1389                                _status = arguments[1]; 
    13781390                        } 
     1391 
     1392                        for(var resource in TrophyIM.rosterObj.roster[Base64.decode(loadscript.getUserCurrent().jid)].presence ) 
     1393                        { 
     1394                        if ( TrophyIM.rosterObj.roster[Base64.decode(loadscript.getUserCurrent().jid)].presence[ resource ].constructor == Function ) 
     1395                                continue; 
     1396                         
     1397                                if ( TROPHYIM_RESOURCE === ("/" + resource) ) 
     1398                                        _show = TrophyIM.rosterObj.roster[Base64.decode(loadscript.getUserCurrent().jid)].presence[resource].show; 
     1399                        } 
     1400 
     1401                        var _presence = $pres( ); 
     1402                        _presence.node.appendChild( Strophe.xmlElement( 'show' ) ).appendChild( Strophe.xmlTextNode( _show ) ); 
     1403                        _presence.node.appendChild( Strophe.xmlElement( 'status' ) ).appendChild( Strophe.xmlTextNode( _status ) ); 
     1404                         
     1405                        TrophyIM.connection.send( _presence.tree() ); 
    13791406                } 
    13801407        }, 
Note: See TracChangeset for help on using the changeset viewer.