comparison mcabber/src/jabglue.c @ 612:789ec6aed764

Respect RFC 3921 order advice
author Mikael Berthe <mikael@lilotux.net>
date Thu, 15 Dec 2005 23:08:22 +0100
parents ad737139a144
children a61a257ec38b
comparison
equal deleted inserted replaced
611:ad737139a144 612:789ec6aed764
421 cleanjid = jidtodisp(jid); 421 cleanjid = jidtodisp(jid);
422 422
423 // We don't check if the jabber user already exists in the roster, 423 // We don't check if the jabber user already exists in the roster,
424 // because it allows to re-ask for notification. 424 // because it allows to re-ask for notification.
425 425
426 x = jutil_presnew(JPACKET__SUBSCRIBE, cleanjid, NULL);
427 jab_send(jc, x);
428 xmlnode_free(x);
429
430 x = jutil_iqnew(JPACKET__SET, NS_ROSTER); 426 x = jutil_iqnew(JPACKET__SET, NS_ROSTER);
431 y = xmlnode_get_tag(x, "query"); 427 y = xmlnode_get_tag(x, "query");
432 z = xmlnode_insert_tag(y, "item"); 428 z = xmlnode_insert_tag(y, "item");
433 xmlnode_put_attrib(z, "jid", cleanjid); 429 xmlnode_put_attrib(z, "jid", cleanjid);
434 430
444 z = xmlnode_insert_tag(z, "group"); 440 z = xmlnode_insert_tag(z, "group");
445 xmlnode_insert_cdata(z, group_utf8, (unsigned) -1); 441 xmlnode_insert_cdata(z, group_utf8, (unsigned) -1);
446 g_free(group_utf8); 442 g_free(group_utf8);
447 } 443 }
448 444
445 jab_send(jc, x);
446 xmlnode_free(x);
447
448 x = jutil_presnew(JPACKET__SUBSCRIBE, cleanjid, NULL);
449 jab_send(jc, x); 449 jab_send(jc, x);
450 xmlnode_free(x); 450 xmlnode_free(x);
451 451
452 roster_add_user(cleanjid, name, group, ROSTER_TYPE_USER, sub_pending); 452 roster_add_user(cleanjid, name, group, ROSTER_TYPE_USER, sub_pending);
453 g_free(cleanjid); 453 g_free(cleanjid);