Index: branches/2.2/jabberit_messenger/jmessenger/js/trophyim.js
===================================================================
--- branches/2.2/jabberit_messenger/jmessenger/js/trophyim.js	(revision 3107)
+++ branches/2.2/jabberit_messenger/jmessenger/js/trophyim.js	(revision 3115)
@@ -671,4 +671,60 @@
                 
                 if( xmlns.indexOf("http://jabber.org/protocol/muc#user") == 0 )
+                {
+                	var _from	= xquery[i].parentNode.getAttribute('from');
+                	var _to		= xquery[i].parentNode.getAttribute('to');
+
+                	// Get NameChatRoom
+                	var nameChatRoom	= Strophe.getBareJidFromJid( _from );
+                	
+                	// Get nickName
+                	var nickName		= Strophe.getResourceFromJid( _from );
+                	
+                	var type	= ( xquery[i].parentNode.getAttribute('type') != null ) ? xquery[i].parentNode.getAttribute('type') : 'available' ;
+                	var show	= type;
+                	
+                	var _UserChatRoom = document.createElement("div");
+	            		_UserChatRoom.id = nameChatRoom + "_UserChatRoom__" + xquery[i].firstChild.getAttribute('jid');
+	            		_UserChatRoom.setAttribute("style","padding-left:18px ; margin:3px 0px 0px 2px; background: url('"+path_jabberit+"templates/default/images/" + show + ".gif')no-repeat center left");
+	            		_UserChatRoom.appendChild( document.createTextNode(nickName) );
+
+                	var nodeUser = document.getElementById( nameChatRoom + "_UserChatRoom__" + xquery[i].firstChild.getAttribute('jid') );		
+            		
+                	if( nodeUser == null && xquery[i].firstChild.getAttribute('jid') )
+                	{
+                		if( document.getElementById( nameChatRoom + '__roomChat__participants' ) != null )
+                		{
+                			nameChatRoom = document.getElementById( nameChatRoom + '__roomChat__participants' );
+                			nameChatRoom.appendChild( _UserChatRoom );
+                		}
+                		else
+                		{
+                			TrophyIM.makeChatRoom( nameChatRoom, nameChatRoom.substring(0, nameChatRoom.indexOf('@')) );
+                			nameChatRoom = document.getElementById( nameChatRoom + '__roomChat__participants' );
+                			nameChatRoom.appendChild( _UserChatRoom );
+                		}
+                	}
+                	else
+                	{
+                		if( type == 'unavailable' )
+                		{
+                			var nodeUser = "";
+                			
+                			if( xquery[i].firstChild.getAttribute('jid') != null )
+                				nodeUser = document.getElementById( nameChatRoom + "_UserChatRoom__" + xquery[i].firstChild.getAttribute('jid') );
+                			else
+                				nodeUser = document.getElementById( nameChatRoom + "_UserChatRoom__" + xquery[i].parentNode.getAttribute('to') );
+                			
+                			nodeUser.parentNode.removeChild( nodeUser );
+                		}
+                		else if( show )
+                		{
+                			var _UserChatRoom = document.getElementById( nameChatRoom + "_UserChatRoom__" + xquery[i].firstChild.getAttribute('jid') )
+                				_UserChatRoom.setAttribute("style","padding-left:18px ; margin:3px 0px 0px 2px; background: url('"+path_jabberit+"templates/default/images/" + show + ".gif')no-repeat center left");	
+                		}
+                	}
+                }
+                
+                /*if( xmlns.indexOf("http://jabber.org/protocol/muc#user") == 0 )
                 {
                 	var nameChatRoom = xquery[i].parentNode.getAttribute('from');
@@ -728,5 +784,5 @@
                 		}
                 	}
-                }
+                }*/
             }
         }
@@ -1275,5 +1331,5 @@
     joinChatRoom : function( roomName )
     {
-        var presence = $pres({from: TrophyIM.connection.jid, to: roomName}).c("x",{xmlns: Strophe.NS.MUC});
+        var presence = $pres( {from: TrophyIM.connection.jid, to: roomName} ).c("x",{xmlns: Strophe.NS.MUC});
         
 		TrophyIM.connection.send( presence );
@@ -1748,5 +1804,5 @@
     	TrophyIM.connection.send($pres( ).attrs({ from: jidFrom, to: jidTo, type: _typeSubscription, id: _id }).tree());
 	},
-    
+
 	/** Function: setPresence
      *
Index: branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.js
===================================================================
--- branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.js	(revision 3102)
+++ branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.js	(revision 3115)
@@ -1433,5 +1433,5 @@
 	function joinRoom( jidRoom, nameRoom )
 	{
-		var test_append_nick = function( room, nick )
+		var append_nick = function( room, nick )
 	    {
 	        var room_nick = room;
@@ -1460,9 +1460,9 @@
 			   	_prompt = _prompt.replace(/^\s+|\s+$|^\n|\n$/g,"");
 			    
-			    var room_nick = test_append_nick( jidRoom, nickName );	
+			    var room_nick = append_nick( jidRoom, nickName );	
 			    	
 			    if( _prompt && _prompt != "" )
 			    {
-			    	var room_nick = test_append_nick( jidRoom, _prompt );
+			    	var room_nick = append_nick( jidRoom, _prompt );
 			    }
 			    
