Changeset 3092
- Timestamp:
- 07/27/10 14:26:14 (14 years ago)
- Location:
- trunk/jabberit_messenger/jmessenger/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jabberit_messenger/jmessenger/js/jscode/loadIM.js
r3091 r3092 1413 1413 } 1414 1414 1415 1416 1415 1417 var room_nick = test_append_nick( jidRoom, "USUARIO_DE_TESTE" ); 1416 1418 -
trunk/jabberit_messenger/jmessenger/js/trophyim.js
r3091 r3092 670 670 nameChatRoom = Strophe.getBareJidFromJid(nameChatRoom); 671 671 672 var nickName = xquery[i].firstChild.getAttribute('jid'); 673 nickName = Strophe.getBareJidFromJid( nickName ); 674 nickName = nickName.substring(0, nickName.indexOf('@')); 672 var nickName = xquery[i].parentNode.getAttribute('from'); 673 nickName = Strophe.getResourceFromJid(nickName); 675 674 676 675 var type = xquery[i].parentNode.getAttribute('type') ? xquery[i].parentNode.getAttribute('type') : 'available' ; … … 678 677 var show = ( xquery[i].parentNode.firstChild.firstChild != null ) ? xquery[i].parentNode.firstChild.firstChild.nodeValue : type ; 679 678 680 if ( Strophe.getBareJidFromJid( xquery[i].firstChild.getAttribute('jid') ) == Strophe.getBareJidFromJid( TrophyIM.connection.jid ) ) 681 show = loadscript.getStatusUserIM(); 679 if( xquery[i].firstChild.getAttribute('jid') ) 680 { 681 if ( Strophe.getBareJidFromJid( xquery[i].firstChild.getAttribute('jid') ) == Strophe.getBareJidFromJid( TrophyIM.connection.jid ) ) 682 show = loadscript.getStatusUserIM(); 683 } 682 684 683 685 var _UserChatRoom = document.createElement("div"); … … 688 690 var nodeUser = document.getElementById( nameChatRoom + "_UserChatRoom__" + xquery[i].firstChild.getAttribute('jid')); 689 691 690 if( nodeUser == null )692 if( nodeUser == null && xquery[i].firstChild.getAttribute('jid') ) 691 693 { 692 694 nameChatRoom = document.getElementById(nameChatRoom + '__roomChat__participants'); … … 697 699 if( type == 'unavailable' ) 698 700 { 699 nodeUser.parentNode.removeChild( nodeUser ); 701 var nodeUser = document.getElementById( nameChatRoom + "_UserChatRoom__" + xquery[i].parentNode.getAttribute('to')); 702 nodeUser.parentNode.removeChild( nodeUser ); 700 703 } 701 704 else if( show ) 702 705 { 703 706 var _UserChatRoom = document.getElementById( nameChatRoom + "_UserChatRoom__" + xquery[i].firstChild.getAttribute('jid') ) 704 705 _UserChatRoom.setAttribute("style","padding-left:18px ; margin:3px 0px 0px 2px; background: url('"+path_jabberit+"templates/default/images/" + show + ".gif')no-repeat center left"); 707 _UserChatRoom.setAttribute("style","padding-left:18px ; margin:3px 0px 0px 2px; background: url('"+path_jabberit+"templates/default/images/" + show + ".gif')no-repeat center left"); 706 708 } 707 709 } … … 1233 1235 joinChatRoom : function( roomName ) 1234 1236 { 1235 1236 1237 var presence = $pres({from: TrophyIM.connection.jid, to: roomName}).c("x",{xmlns: Strophe.NS.MUC}); 1238 1237 1239 TrophyIM.connection.send( presence ); 1238 1240 }, … … 1243 1245 */ 1244 1246 1245 leaveChatRoom : function( roomName )1247 leaveChatRoom : function( roomName ) 1246 1248 { 1247 var room_nick = roomName; 1248 var presenceid = TrophyIM.connection.getUniqueId(); 1249 //var presence = $pres( {type: "unavailable", id: presenceid, to: room_nick} ).c("x",{ xmlns: Strophe.NS.MUC } ); 1250 //TrophyIM.connection.send( presence ); 1249 var room_nick = roomName + "/USUARIO_DE_TESTE"; 1250 1251 var presenceid = TrophyIM.connection.getUniqueId(); 1252 1253 var presence = $pres( {type: "unavailable", id: presenceid, from: TrophyIM.connection.jid, to: room_nick} ).c("x",{xmlns: Strophe.NS.MUC}); 1254 1255 TrophyIM.connection.send( presence ); 1251 1256 }, 1252 1257
Note: See TracChangeset
for help on using the changeset viewer.