Changeset 3115
- Timestamp:
- 08/02/10 13:43:20 (13 years ago)
- Location:
- branches/2.2/jabberit_messenger/jmessenger/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.js
r3102 r3115 1433 1433 function joinRoom( jidRoom, nameRoom ) 1434 1434 { 1435 var test_append_nick = function( room, nick )1435 var append_nick = function( room, nick ) 1436 1436 { 1437 1437 var room_nick = room; … … 1460 1460 _prompt = _prompt.replace(/^\s+|\s+$|^\n|\n$/g,""); 1461 1461 1462 var room_nick = test_append_nick( jidRoom, nickName );1462 var room_nick = append_nick( jidRoom, nickName ); 1463 1463 1464 1464 if( _prompt && _prompt != "" ) 1465 1465 { 1466 var room_nick = test_append_nick( jidRoom, _prompt );1466 var room_nick = append_nick( jidRoom, _prompt ); 1467 1467 } 1468 1468 -
branches/2.2/jabberit_messenger/jmessenger/js/trophyim.js
r3107 r3115 671 671 672 672 if( xmlns.indexOf("http://jabber.org/protocol/muc#user") == 0 ) 673 { 674 var _from = xquery[i].parentNode.getAttribute('from'); 675 var _to = xquery[i].parentNode.getAttribute('to'); 676 677 // Get NameChatRoom 678 var nameChatRoom = Strophe.getBareJidFromJid( _from ); 679 680 // Get nickName 681 var nickName = Strophe.getResourceFromJid( _from ); 682 683 var type = ( xquery[i].parentNode.getAttribute('type') != null ) ? xquery[i].parentNode.getAttribute('type') : 'available' ; 684 var show = type; 685 686 var _UserChatRoom = document.createElement("div"); 687 _UserChatRoom.id = nameChatRoom + "_UserChatRoom__" + xquery[i].firstChild.getAttribute('jid'); 688 _UserChatRoom.setAttribute("style","padding-left:18px ; margin:3px 0px 0px 2px; background: url('"+path_jabberit+"templates/default/images/" + show + ".gif')no-repeat center left"); 689 _UserChatRoom.appendChild( document.createTextNode(nickName) ); 690 691 var nodeUser = document.getElementById( nameChatRoom + "_UserChatRoom__" + xquery[i].firstChild.getAttribute('jid') ); 692 693 if( nodeUser == null && xquery[i].firstChild.getAttribute('jid') ) 694 { 695 if( document.getElementById( nameChatRoom + '__roomChat__participants' ) != null ) 696 { 697 nameChatRoom = document.getElementById( nameChatRoom + '__roomChat__participants' ); 698 nameChatRoom.appendChild( _UserChatRoom ); 699 } 700 else 701 { 702 TrophyIM.makeChatRoom( nameChatRoom, nameChatRoom.substring(0, nameChatRoom.indexOf('@')) ); 703 nameChatRoom = document.getElementById( nameChatRoom + '__roomChat__participants' ); 704 nameChatRoom.appendChild( _UserChatRoom ); 705 } 706 } 707 else 708 { 709 if( type == 'unavailable' ) 710 { 711 var nodeUser = ""; 712 713 if( xquery[i].firstChild.getAttribute('jid') != null ) 714 nodeUser = document.getElementById( nameChatRoom + "_UserChatRoom__" + xquery[i].firstChild.getAttribute('jid') ); 715 else 716 nodeUser = document.getElementById( nameChatRoom + "_UserChatRoom__" + xquery[i].parentNode.getAttribute('to') ); 717 718 nodeUser.parentNode.removeChild( nodeUser ); 719 } 720 else if( show ) 721 { 722 var _UserChatRoom = document.getElementById( nameChatRoom + "_UserChatRoom__" + xquery[i].firstChild.getAttribute('jid') ) 723 _UserChatRoom.setAttribute("style","padding-left:18px ; margin:3px 0px 0px 2px; background: url('"+path_jabberit+"templates/default/images/" + show + ".gif')no-repeat center left"); 724 } 725 } 726 } 727 728 /*if( xmlns.indexOf("http://jabber.org/protocol/muc#user") == 0 ) 673 729 { 674 730 var nameChatRoom = xquery[i].parentNode.getAttribute('from'); … … 728 784 } 729 785 } 730 } 786 }*/ 731 787 } 732 788 } … … 1275 1331 joinChatRoom : function( roomName ) 1276 1332 { 1277 var presence = $pres( {from: TrophyIM.connection.jid, to: roomName}).c("x",{xmlns: Strophe.NS.MUC});1333 var presence = $pres( {from: TrophyIM.connection.jid, to: roomName} ).c("x",{xmlns: Strophe.NS.MUC}); 1278 1334 1279 1335 TrophyIM.connection.send( presence ); … … 1748 1804 TrophyIM.connection.send($pres( ).attrs({ from: jidFrom, to: jidTo, type: _typeSubscription, id: _id }).tree()); 1749 1805 }, 1750 1806 1751 1807 /** Function: setPresence 1752 1808 *
Note: See TracChangeset
for help on using the changeset viewer.