comparison src/protocols/jabber/jutil.c @ 7445:6ea4a49b4b51

[gaim-migrate @ 8052] this should fix the case sensitivity issues for jabber. what made me think that g_utf8_normalize() did anything with the strings of cases is beyond me. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Thu, 06 Nov 2003 07:07:22 +0000
parents 58a426e1bd1a
children 9a6df4d567e0
comparison
equal deleted inserted replaced
7444:66945d35a7c0 7445:6ea4a49b4b51
272 { 272 {
273 GaimConnection *gc = account ? account->gc : NULL; 273 GaimConnection *gc = account ? account->gc : NULL;
274 JabberStream *js = gc ? gc->proto_data : NULL; 274 JabberStream *js = gc ? gc->proto_data : NULL;
275 static char buf[3072]; /* maximum legal length of a jabber jid */ 275 static char buf[3072]; /* maximum legal length of a jabber jid */
276 JabberID *jid; 276 JabberID *jid;
277 char *node, *domain;
277 278
278 jid = jabber_id_new(in); 279 jid = jabber_id_new(in);
279 280
280 if(!jid) 281 if(!jid)
281 return NULL; 282 return NULL;
282 283
283 if(js && jid->node && jid->resource && 284 node = jid->node ? g_utf8_strdown(jid->node, -1) : NULL;
284 jabber_chat_find(js, jid->node, jid->domain)) 285 domain = g_utf8_strdown(jid->domain, -1);
285 g_snprintf(buf, sizeof(buf), "%s@%s/%s", jid->node, jid->domain, 286
287
288 if(js && node && jid->resource &&
289 jabber_chat_find(js, node, domain))
290 g_snprintf(buf, sizeof(buf), "%s@%s/%s", node, domain,
286 jid->resource); 291 jid->resource);
287 else 292 else
288 g_snprintf(buf, sizeof(buf), "%s%s%s", jid->node ? jid->node : "", 293 g_snprintf(buf, sizeof(buf), "%s%s%s", node ? node : "",
289 jid->node ? "@" : "", jid->domain); 294 node ? "@" : "", domain);
290 295
291 jabber_id_free(jid); 296 jabber_id_free(jid);
297 g_free(node);
298 g_free(domain);
292 299
293 return buf; 300 return buf;
294 } 301 }
295 302