Changeset 3097 for trunk


Ignore:
Timestamp:
07/28/10 17:35:23 (14 years ago)
Author:
alexandrecorreia
Message:

Ticket #1091 - Implementado a busca de salas para bate-papo no novo modulo Expresso messenger XEP-0045-MUC.

Location:
trunk/jabberit_messenger/jmessenger/js
Files:
2 edited

Legend:

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

    r3094 r3097  
    12561256 
    12571257        // TESTE ROOMS 
     1258        function createChatRooms() 
     1259        { 
     1260                var _from               = "alexandrecorreia@im.pr.gov.br" + TROPHYIM_RESOURCE;  
     1261                var _to                 = "teste_alexandre@conference.im.pr.gov.br" + "/alexandrecorreia" ; 
     1262                var new_room    = $pres( {from: _from, to: _to } ).c( "x", { xmlns: Strophe.NS.MUC } ); 
     1263                 
     1264        TrophyIM.connection.send( new_room.tree() ); 
     1265        } 
     1266         
     1267        loadIM.prototype.createChatRooms = createChatRooms; 
    12581268         
    12591269        function listRooms( element ) 
     
    12981308                                'lang2'                 : 'Fechar', 
    12991309                                'onclickClose'  : '_winBuild("window_List_Rooms","remove");', 
    1300                                 'onclickSubmit' : 'alert(\'Vou criar mais uma sala\')' 
     1310                                'onclickSubmit' : 'loadscript.createChatRooms();' 
    13011311                        };  
    13021312 
     
    14011411        function joinRoom( jidRoom, nameRoom ) 
    14021412        { 
    1403             var test_append_nick = function( room, nick ) 
     1413                var test_append_nick = function( room, nick ) 
    14041414            { 
    14051415                var room_nick = room; 
  • trunk/jabberit_messenger/jmessenger/js/trophyim.js

    r3096 r3097  
    670670                if( xmlns.indexOf("http://jabber.org/protocol/muc#user") == 0 ) 
    671671                { 
    672                         var nameChatRoom = xquery[i].parentNode.getAttribute('from') 
     672                        var nameChatRoom = xquery[i].parentNode.getAttribute('from'); 
    673673                                nameChatRoom = Strophe.getBareJidFromJid(nameChatRoom); 
    674674 
     
    695695                        if( nodeUser == null && xquery[i].firstChild.getAttribute('jid') ) 
    696696                        { 
    697                                 nameChatRoom = document.getElementById(nameChatRoom + '__roomChat__participants'); 
    698                                 nameChatRoom.appendChild( _UserChatRoom ); 
     697                                if( document.getElementById( nameChatRoom + '__roomChat__participants' ) != null ) 
     698                                { 
     699                                        nameChatRoom = document.getElementById( nameChatRoom + '__roomChat__participants' ); 
     700                                        nameChatRoom.appendChild( _UserChatRoom ); 
     701                                } 
     702                                else 
     703                                { 
     704                                        TrophyIM.makeChatRoom( nameChatRoom, "TESTE_MEU" ); 
     705                                         
     706                                        nameChatRoom = document.getElementById( nameChatRoom + '__roomChat__participants' ); 
     707                                        nameChatRoom.appendChild( _UserChatRoom ); 
     708                                } 
    699709                        } 
    700710                        else 
Note: See TracChangeset for help on using the changeset viewer.