Index: trunk/instant_messenger/docs/change_log.txt
===================================================================
--- trunk/instant_messenger/docs/change_log.txt	(revision 24)
+++ trunk/instant_messenger/docs/change_log.txt	(revision 26)
@@ -7,2 +7,8 @@
 - Vcard, corrigido para a visualização de caracteres e acentos. 
 
+10/05/2007 [0.001]
+- Busca de ids no ldap
+- O envio de autorização, está dentro do menu do botão direito, quando clicado em cima do
+nome do contato.
+- A montagem da lista de contatos é feito direto no elemento da página.
+- Correção para cadastro dos contatos com acentos.
Index: trunk/instant_messenger/inc/class.Ujabber.inc.php
===================================================================
--- trunk/instant_messenger/inc/class.Ujabber.inc.php	(revision 24)
+++ trunk/instant_messenger/inc/class.Ujabber.inc.php	(revision 26)
@@ -55,5 +55,5 @@
 		
 		for($i=0; $i < count($contacts); $i++){
-			$group_users[] = strtolower($contacts[$i]['group']).";".$contacts[$i]['name'].";".$contacts[$i]['jid'].";".$contacts[$i]['subscription'].";".$contacts[$i]['online'];			
+			$group_users[] = strtolower(urldecode($contacts[$i]['group'])).";".urldecode($contacts[$i]['name']).";".$contacts[$i]['jid'].";".$contacts[$i]['subscription'].";".$contacts[$i]['online'];			
 		}
 	
@@ -168,6 +168,6 @@
 			{
 				$newcontact  = "<item jid='$pJid'";
-				$newcontact .= ($pName) ? " name='" . $pName . "'" : '';
-				$newcontact .= (($pGroup) ? "><group>" . $pGroup . "</group>\n</item" : "/") . ">";
+				$newcontact .= ($pName) ? " name='" . urlencode($pName) . "'" : '';
+				$newcontact .= (($pGroup) ? "><group>" . urlencode($pGroup) . "</group>\n</item" : "/") . ">";
 	
 				if($this->sendIq('set', $addid, NULL, NULL, "jabber:iq:roster", $newcontact)){
@@ -204,6 +204,6 @@
 		{
 			$updatecontact  = "<item jid='$pJid'";
-			$updatecontact .= ($pName) ? " name='" . $pName . "'" : '';
-			$updatecontact .= (($pGroup) ? "><group>" . $pGroup . "</group>\n</item" : "/") . ">";
+			$updatecontact .= ($pName) ? " name='" . urlencode($pName) . "'" : '';
+			$updatecontact .= (($pGroup) ? "><group>" . urlencode($pGroup) . "</group>\n</item" : "/") . ">";
 
 			if($this->sendIq('set', $upid, NULL, NULL, "jabber:iq:roster", $updatecontact)){
Index: trunk/instant_messenger/js/im_win.js
===================================================================
--- trunk/instant_messenger/js/im_win.js	(revision 24)
+++ trunk/instant_messenger/js/im_win.js	(revision 26)
@@ -902,5 +902,5 @@
       {
          if ( document.title=="......................" )
-            document.title = "New Message!";
+            document.title = IM.get_lang('New Message!');
          else
             document.title = "......................";
@@ -913,4 +913,5 @@
          if ( newMessageTimer ) clearTimeout(newMessageTimer);
       }
+      
    },
 
Index: trunk/instant_messenger/js/im_preferences.js
===================================================================
--- trunk/instant_messenger/js/im_preferences.js	(revision 24)
+++ trunk/instant_messenger/js/im_preferences.js	(revision 26)
@@ -99,8 +99,10 @@
 				}
 			}
+			var name = url_encode(encodeURI(text1.value));
+			var group = url_encode(encodeURI(text2.value));
 			if(pFunc == 'divAddUser_im')
-				cIM.cExecute("$this.Ujabber.AddNewContacts",handler_add_contact,"email="+text0.value+"&name="+text1.value+"&group="+text2.value+"&subscription=none");
+				cIM.cExecute("$this.Ujabber.AddNewContacts",handler_add_contact,"email="+text0.value+"&name="+name+"&group="+group+"&subscription=none");
 			else
-				cIM.cExecute("$this.Ujabber.AddNewContacts",handler_add_contact,"email="+text0.value+"&name="+text1.value+"&group="+text2.value+"&subscription=to");
+				cIM.cExecute("$this.Ujabber.AddNewContacts",handler_add_contact,"email="+text0.value+"&name="+name+"&group="+group+"&subscription=to");
 		}else{
 			alert("Informe todos os campos!");
@@ -122,6 +124,6 @@
 
 		for(var i=1; i < IM.array_users.length; i++){
-			if(IM.array_users[i].name != ""){
-				opt = new Option(IM.array_users[i].name,IM.array_users[i].jid, false, false);
+			if(decodeURI(IM.array_users[i].name) != ""){
+				opt = new Option(decodeURI(IM.array_users[i].name),IM.array_users[i].jid, false, false);
 				sel_contact.options[sel_contact.length] = opt;
 			}else{
@@ -143,5 +145,5 @@
 					for(var j=1 ; j < IM.array_users.length; j++){
 						var name = IM.array_users[j].jid.substr(0,IM.array_users[j].jid.indexOf('@'));
-						if(IM.array_users[j].name == in_el || name == in_el){
+						if(decodeURI(IM.array_users[j].name) == in_el || name == in_el){
 							var handler_remove_contact = function(data){
 								if(!data){
@@ -175,5 +177,5 @@
 		sel_contact.options[sel_contact.length] = opt;
 		for(var i=0; i < IM.array_users.length; i++){
-			opt = new Option(IM.array_users[i].name,IM.array_users[i].jid, false, false);
+			opt = new Option(decodeURI(IM.array_users[i].name),IM.array_users[i].jid, false, false);
 			sel_contact.options[sel_contact.length] = opt;
 		}
@@ -184,5 +186,5 @@
 		for(var i=0; i < IM.array_users.length; i++){
 			if(IM.array_users[i].jid == pJid){
-				if(confirm("Excluir o contato " + IM.array_users[i].name + "?")){
+				if(confirm("Excluir o contato " + decodeURI(IM.array_users[i].name) + "?")){
 					var handler_remove_contact = function(data){
 						if(!data){
@@ -220,6 +222,6 @@
 		for(var i=1; i < IM.array_users.length; i++){
 			if(IM.array_users[i].jid == pJid){
-				name  = IM.array_users[i].name;
-				group = IM.array_users[i].group;
+				name  = decodeURI(IM.array_users[i].name);
+				group = decodeURI(IM.array_users[i].group);
 			}
 		}
@@ -228,8 +230,10 @@
 			if(pType){
 				var act = prompt("Digite um apelido para :" + pJid , name);
-				name = act;
+				name = url_encode(encodeURI(act));
+				group = url_encode(encodeURI(group));
 			}else{
 				var act = prompt("Digite um novo grupo para : " + name, group);
-				group = act;
+				group = url_encode(encodeURI(act));
+				name = url_encode(encodeURI(name));
 			}				
 			if((act != null) && (act != "")){
Index: trunk/instant_messenger/js/im_functions.js
===================================================================
--- trunk/instant_messenger/js/im_functions.js	(revision 24)
+++ trunk/instant_messenger/js/im_functions.js	(revision 26)
@@ -89,34 +89,34 @@
 			var div_agroups = document.getElementById("all_groups");
 		
-			if(document.getElementById("img_" + pList[i].group.rm_space()) == null ){
-				div_agroups.innerHTML += '<img id="img_' + pList[i].group.rm_space() + '" src="' + img_group_open.src + '" onclick="javascript:IM.visible_group(\'' + pList[i].group.rm_space() + '\')" style="margin-left:16px;">';
-				div_agroups.innerHTML += '<b>' + pList[i].group + '</b></br>';
-
-				if(pList[i].group.rm_space() != 'sem_grupo'){
+			if(document.getElementById("img_" + decodeURI(pList[i].group.rm_space())) == null ){
+				div_agroups.innerHTML += '<img id="img_' + decodeURI(pList[i].group.rm_space()) + '" src="' + img_group_open.src + '" onclick="javascript:IM.visible_group(\'' + decodeURI(pList[i].group.rm_space()) + '\')" style="margin-left:16px;">';
+				div_agroups.innerHTML += '<b>' + decodeURI(pList[i].group) + '</b></br>';
+
+				if(decodeURI(pList[i].group.rm_space()) != 'sem_grupo'){
 					var div_group = document.createElement('DIV');
-						div_group.id = pList[i].group.rm_space();
+						div_group.id = decodeURI(pList[i].group.rm_space());
 						if(pList[i].subscription.rm_space() == "both")
-							div_group.innerHTML = '<div id="' + pList[i].jid + '" nuncontact="'+ i +'" onmouseover="this.className=\'contato_hover\'" onmouseout="this.className=\'\'" onmousedown="javascript:IM.action_button(event, \''+pList[i].online + '\', \'' + pList[i].jid + '\' ,false);" style="cursor:pointer;padding-left:32px;"><img src="' + ((pList[i].online) == parseInt(1) ? img_online.src : img_offline.src) + '">' + pList[i].name + '</div><span id="_span_' + pList[i].jid + '" class="menu_im"></span>';
+							div_group.innerHTML += '<div id="' + pList[i].jid + '" nuncontact="'+ i +'" onmouseover="this.className=\'contato_hover\'" onmouseout="this.className=\'\'" onmousedown="javascript:IM.action_button(event, \''+pList[i].online + '\', \'' + pList[i].jid + '\' ,false);" style="cursor:pointer;padding-left:32px;"><img src="' + ((pList[i].online) == parseInt(1) ? img_online.src : img_offline.src) + '">' + decodeURI(pList[i].name) + '</div><span id="_span_' + pList[i].jid + '" class="menu_im"></span>';
 						else
-							div_group.innerHTML = '<div id="' + pList[i].jid + '" nuncontact="'+ i +'" onmouseover="this.className=\'contato_hover\'" onmouseout="this.className=\'\'" onmousedown="javascript:IM.action_button(event, \''+parseInt(0)+'\', \'' + pList[i].jid + '\' ,true);" style="cursor:pointer;padding-left:32px;"><img src="' + img_wait_auth.src + '">' + pList[i].name + '</div><span id="_span_' + pList[i].jid + '" class="menu_im"></span>';
+							div_group.innerHTML += '<div id="' + pList[i].jid + '" nuncontact="'+ i +'" onmouseover="this.className=\'contato_hover\'" onmouseout="this.className=\'\'" onmousedown="javascript:IM.action_button(event, \''+parseInt(0)+'\', \'' + pList[i].jid + '\' ,true);" style="cursor:pointer;padding-left:32px;"><img src="' + img_wait_auth.src + '">' + decodeURI(pList[i].name) + '</div><span id="_span_' + pList[i].jid + '" class="menu_im"></span>';
 						div_agroups.appendChild(div_group);
 				}else{
 					var div_group = document.createElement('DIV');
-						div_group.id = pList[i].group.rm_space();
-						div_group.innerHTML = '<div id="'+pList[i].jid+'" onclick=Preferences.updateLoad("'+i+'") style="cursor:pointer;padding-left:32px;">'+
-											  '<img src="'+img_not_authorized.src+'">'+pList[i].jid+'</div>';
+						div_group.id = decodeURI(pList[i].group.rm_space());
+						div_group.innerHTML += '<div id="'+pList[i].jid+'" onclick=Preferences.updateLoad("'+i+'") style="cursor:pointer;padding-left:32px;">'+
+											   '<img src="'+img_not_authorized.src+'">'+pList[i].jid+'</div>';
 						div_agroups.appendChild(div_group);					
 				}
 			}else{
 
-				if(pList[i].group.rm_space() != 'sem_grupo'){
-					var div_group = document.getElementById(pList[i].group.rm_space());
+				if(decodeURI(pList[i].group.rm_space()) != 'sem_grupo'){
+					var div_group = document.getElementById(decodeURI(pList[i].group.rm_space()));
 					if(pList[i].subscription.rm_space() == "both")
-						div_group.innerHTML += '<div id="' + pList[i].jid + '" nuncontact="'+ i +'" onmouseover="this.className=\'contato_hover\'" onmouseout="this.className=\'\'" onmousedown="javascript:IM.action_button(event, \''+pList[i].online + '\', \'' + pList[i].jid + '\',false);" style="cursor:pointer;padding-left:32px;"><img src="' + ((pList[i].online) == parseInt(1) ? img_online.src : img_offline.src) + '">' + pList[i].name + '</div><span id="_span_' + pList[i].jid + '" class="menu_im"></span>';
+						div_group.innerHTML += '<div id="' + pList[i].jid + '" nuncontact="'+ i +'" onmouseover="this.className=\'contato_hover\'" onmouseout="this.className=\'\'" onmousedown="javascript:IM.action_button(event, \''+pList[i].online + '\', \'' + pList[i].jid + '\',false);" style="cursor:pointer;padding-left:32px;"><img src="' + ((pList[i].online) == parseInt(1) ? img_online.src : img_offline.src) + '">' + decodeURI(pList[i].name) + '</div><span id="_span_' + pList[i].jid + '" class="menu_im"></span>';
 					else
-						div_group.innerHTML = '<div id="' + pList[i].jid + '" nuncontact="'+ i +'" onmouseover="this.className=\'contato_hover\'" onmouseout="this.className=\'\'" onmousedown="javascript:IM.action_button(event, \''+parseInt(0)+'\', \'' + pList[i].jid + '\',true);" style="cursor:pointer;padding-left:32px;"><img src="' + img_wait_auth.src + '">' + pList[i].name + '</div><span id="_span_' + pList[i].jid + '" class="menu_im"></span>';					
+						div_group.innerHTML += '<div id="' + pList[i].jid + '" nuncontact="'+ i +'" onmouseover="this.className=\'contato_hover\'" onmouseout="this.className=\'\'" onmousedown="javascript:IM.action_button(event, \''+parseInt(0)+'\', \'' + pList[i].jid + '\',true);" style="cursor:pointer;padding-left:32px;"><img src="' + img_wait_auth.src + '">' + decodeURI(pList[i].name) + '</div><span id="_span_' + pList[i].jid + '" class="menu_im"></span>';					
 					div_agroups.appendChild(div_group);
 				}else{
-					var div_group = document.getElementById(pList[i].group.rm_space());
+					var div_group = document.getElementById(decodeURI(pList[i].group.rm_space()));
 						div_group.innerHTML += '<div id="'+pList[i].jid+'" onclick=Preferences.updateLoad("'+i+'") style="cursor:pointer;padding-left:32px;">'+
 											   '<img src="'+img_not_authorized.src+'">'+pList[i].jid+'</div>';
