Changeset 3122
- Timestamp:
- 08/02/10 17:45:44 (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
r3115 r3122 1433 1433 function joinRoom( jidRoom, nameRoom ) 1434 1434 { 1435 1435 1436 var append_nick = function( room, nick ) 1436 1437 { … … 1468 1469 1469 1470 TrophyIM.makeChatRoom( jidRoom , nameRoom ); 1471 1472 TrophyIM.activeChatRoom.name[ TrophyIM.activeChatRoom.name.length ] = room_nick; 1470 1473 1471 1474 TrophyIM.joinChatRoom( room_nick); -
branches/2.2/jabberit_messenger/jmessenger/js/trophyim.js
r3120 r3122 142 142 autoConnection : { connect : true }, 143 143 144 /** Active Chat Room 145 * 146 */ 147 148 activeChatRoom : { name : [] }, 149 144 150 /** Object: chatHistory 145 151 * … … 681 687 var nickName = Strophe.getResourceFromJid( _from ); 682 688 689 // Get Type/Show 683 690 var type = ( xquery[i].parentNode.getAttribute('type') != null ) ? xquery[i].parentNode.getAttribute('type') : 'available' ; 684 var show = type;691 var show = ( xquery[i].parentNode.firstChild.nodeName == "show" ) ? xquery[i].parentNode.firstChild.firstChild.nodeValue : type; 685 692 686 693 var _idElement = nameChatRoom + "_UserChatRoom__" + nickName; … … 689 696 _UserChatRoom.id = _idElement; 690 697 _UserChatRoom.setAttribute("style","padding-left:18px ; margin:3px 0px 0px 2px; background: url('"+path_jabberit+"templates/default/images/" + show + ".gif')no-repeat center left"); 691 _UserChatRoom.appendChild( document.createTextNode( nickName) );698 _UserChatRoom.appendChild( document.createTextNode( nickName ) ); 692 699 693 700 var nodeUser = document.getElementById( _idElement ); … … 719 726 } 720 727 } 721 722 /*if( xmlns.indexOf("http://jabber.org/protocol/muc#user") == 0 )723 {724 var nameChatRoom = xquery[i].parentNode.getAttribute('from');725 nameChatRoom = Strophe.getBareJidFromJid(nameChatRoom);726 727 var nickName = xquery[i].parentNode.getAttribute('from');728 nickName = Strophe.getResourceFromJid(nickName);729 730 var type = ( xquery[i].parentNode.getAttribute('type') != null ) ? xquery[i].parentNode.getAttribute('type') : 'available' ;731 732 var show = ( xquery[i].parentNode.firstChild.firstChild.nodeName.toLowerCase() == "show" ) ? xquery[i].parentNode.firstChild.firstChild.nodeValue : type ;733 734 if( xquery[i].firstChild.getAttribute('jid') )735 {736 if ( Strophe.getBareJidFromJid( xquery[i].firstChild.getAttribute('jid') ) == Strophe.getBareJidFromJid( TrophyIM.connection.jid ) )737 show = loadscript.getStatusUserIM();738 }739 740 var _UserChatRoom = document.createElement("div");741 _UserChatRoom.id = nameChatRoom + "_UserChatRoom__" + xquery[i].firstChild.getAttribute('jid');742 _UserChatRoom.setAttribute("style","padding-left:18px ; margin:3px 0px 0px 2px; background: url('"+path_jabberit+"templates/default/images/" + show + ".gif')no-repeat center left");743 _UserChatRoom.appendChild( document.createTextNode(nickName) );744 745 var nodeUser = document.getElementById( nameChatRoom + "_UserChatRoom__" + xquery[i].firstChild.getAttribute('jid') );746 747 if( nodeUser == null && xquery[i].firstChild.getAttribute('jid') )748 {749 if( document.getElementById( nameChatRoom + '__roomChat__participants' ) != null )750 {751 nameChatRoom = document.getElementById( nameChatRoom + '__roomChat__participants' );752 nameChatRoom.appendChild( _UserChatRoom );753 }754 else755 {756 TrophyIM.makeChatRoom( nameChatRoom, nameChatRoom );757 nameChatRoom = document.getElementById( nameChatRoom + '__roomChat__participants' );758 nameChatRoom.appendChild( _UserChatRoom );759 }760 }761 else762 {763 if( type == 'unavailable' )764 {765 var nodeUser = "";766 767 if( xquery[i].firstChild.getAttribute('jid') != null )768 nodeUser = document.getElementById( nameChatRoom + "_UserChatRoom__" + xquery[i].firstChild.getAttribute('jid') );769 else770 nodeUser = document.getElementById( nameChatRoom + "_UserChatRoom__" + xquery[i].parentNode.getAttribute('to') );771 772 nodeUser.parentNode.removeChild( nodeUser );773 }774 else if( show )775 {776 var _UserChatRoom = document.getElementById( nameChatRoom + "_UserChatRoom__" + xquery[i].firstChild.getAttribute('jid') )777 _UserChatRoom.setAttribute("style","padding-left:18px ; margin:3px 0px 0px 2px; background: url('"+path_jabberit+"templates/default/images/" + show + ".gif')no-repeat center left");778 }779 }780 }*/781 728 } 782 729 } … … 1805 1752 setPresence : function( _type ) 1806 1753 { 1754 var presence_chatRoom = ""; 1755 1807 1756 if( _type != 'status') 1808 1757 { … … 1854 1803 1855 1804 TrophyIM.connection.send( _presence.tree() ); 1805 1806 presence_chatRoom = _type; 1856 1807 } 1857 1808 else 1858 1809 { 1859 1810 TrophyIM.connection.send($pres( ).c('show').t(_type).tree()); 1811 1812 presence_chatRoom = _type; 1860 1813 } 1861 1814 } … … 1901 1854 1902 1855 TrophyIM.connection.send( _presence.tree() ); 1903 } 1904 } 1856 1857 presence_chatRoom = _show; 1858 } 1859 } 1860 1861 // Send Presence Chat Room 1862 if( TrophyIM.activeChatRoom.name.length > 0 ) 1863 { 1864 for( var i in TrophyIM.activeChatRoom.name ) 1865 { 1866 TrophyIM.connection.send($pres( { to : TrophyIM.activeChatRoom.name[i] } ).c('show').t( presence_chatRoom ) ); 1867 } 1868 } 1869 1905 1870 }, 1906 1871
Note: See TracChangeset
for help on using the changeset viewer.