comparison mcabber/src/jab_iq.c @ 814:109dcf5fc111

Use hgcset (if available) when answering to IQ:version requests
author Mikael Berthe <mikael@lilotux.net>
date Sat, 15 Apr 2006 11:17:34 +0200
parents 19121d9f4aa2
children cb54c9d76853
comparison
equal deleted inserted replaced
813:a8d63395a710 814:109dcf5fc111
448 xmlnode xmldata) 448 xmlnode xmldata)
449 { 449 {
450 xmlnode senderquery, x; 450 xmlnode senderquery, x;
451 xmlnode myquery; 451 xmlnode myquery;
452 char *os = NULL; 452 char *os = NULL;
453 char *ver = mcabber_version();
453 454
454 // "from" has already been converted to user locale 455 // "from" has already been converted to user locale
455 scr_LogPrint(LPRINT_LOGNORM, "Received an IQ version request from <%s>", 456 scr_LogPrint(LPRINT_LOGNORM, "Received an IQ version request from <%s>",
456 from); 457 from);
457 458
466 x = jutil_iqnew(JPACKET__RESULT, NS_VERSION); 467 x = jutil_iqnew(JPACKET__RESULT, NS_VERSION);
467 xmlnode_put_attrib(x, "id", id); 468 xmlnode_put_attrib(x, "id", id);
468 xmlnode_put_attrib(x, "to", xmlnode_get_attrib(xmldata, "from")); 469 xmlnode_put_attrib(x, "to", xmlnode_get_attrib(xmldata, "from"));
469 myquery = xmlnode_get_tag(x, "query"); 470 myquery = xmlnode_get_tag(x, "query");
470 471
471 xmlnode_insert_cdata(xmlnode_insert_tag(myquery, "name"), 472 xmlnode_insert_cdata(xmlnode_insert_tag(myquery, "name"), PACKAGE_NAME, -1);
472 PACKAGE_NAME, -1); 473 xmlnode_insert_cdata(xmlnode_insert_tag(myquery, "version"), ver, -1);
473 xmlnode_insert_cdata(xmlnode_insert_tag(myquery, "version"),
474 PACKAGE_VERSION, -1);
475 if (os) { 474 if (os) {
476 xmlnode_insert_cdata(xmlnode_insert_tag(myquery, "os"), os, -1); 475 xmlnode_insert_cdata(xmlnode_insert_tag(myquery, "os"), os, -1);
477 g_free(os); 476 g_free(os);
478 } 477 }
479 478
479 g_free(ver);
480 jab_send(jc, x); 480 jab_send(jc, x);
481 xmlnode_free(x); 481 xmlnode_free(x);
482 } 482 }
483 483
484 // This function borrows some code from the Gaim project 484 // This function borrows some code from the Gaim project