Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/jab_iq.c @ 1498:2eaa52d314e3
Add option 'iq_hide_requests'
(Suggested by dpc)
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Tue, 15 Jul 2008 21:37:43 +0200 |
parents | 563ba5a861ae |
children | 3df441efb7c2 |
comparison
equal
deleted
inserted
replaced
1497:35020a2ed115 | 1498:2eaa52d314e3 |
---|---|
1478 { | 1478 { |
1479 xmlnode x; | 1479 xmlnode x; |
1480 xmlnode myquery; | 1480 xmlnode myquery; |
1481 char *seconds; | 1481 char *seconds; |
1482 | 1482 |
1483 scr_LogPrint(LPRINT_LOGNORM, "Received an IQ last time request from <%s>", | 1483 if (!settings_opt_get_int("iq_hide_requests")) { |
1484 from); | 1484 scr_LogPrint(LPRINT_LOGNORM, "Received an IQ last time request from <%s>", |
1485 from); | |
1486 } | |
1485 | 1487 |
1486 x = jutil_iqnew(JPACKET__RESULT, NS_LAST); | 1488 x = jutil_iqnew(JPACKET__RESULT, NS_LAST); |
1487 xmlnode_put_attrib(x, "id", id); | 1489 xmlnode_put_attrib(x, "id", id); |
1488 xmlnode_put_attrib(x, "to", xmlnode_get_attrib(xmldata, "from")); | 1490 xmlnode_put_attrib(x, "to", xmlnode_get_attrib(xmldata, "from")); |
1489 myquery = xmlnode_get_tag(x, "query"); | 1491 myquery = xmlnode_get_tag(x, "query"); |
1509 xmlnode x; | 1511 xmlnode x; |
1510 xmlnode myquery; | 1512 xmlnode myquery; |
1511 char *os = NULL; | 1513 char *os = NULL; |
1512 char *ver = mcabber_version(); | 1514 char *ver = mcabber_version(); |
1513 | 1515 |
1514 scr_LogPrint(LPRINT_LOGNORM, "Received an IQ version request from <%s>", | 1516 if (!settings_opt_get_int("iq_hide_requests")) { |
1515 from); | 1517 scr_LogPrint(LPRINT_LOGNORM, "Received an IQ version request from <%s>", |
1518 from); | |
1519 } | |
1516 | 1520 |
1517 if (!settings_opt_get_int("iq_version_hide_os")) { | 1521 if (!settings_opt_get_int("iq_version_hide_os")) { |
1518 struct utsname osinfo; | 1522 struct utsname osinfo; |
1519 uname(&osinfo); | 1523 uname(&osinfo); |
1520 os = g_strdup_printf("%s %s %s", osinfo.sysname, osinfo.release, | 1524 os = g_strdup_printf("%s %s %s", osinfo.sysname, osinfo.release, |
1548 time_t now_t; | 1552 time_t now_t; |
1549 struct tm *now; | 1553 struct tm *now; |
1550 | 1554 |
1551 time(&now_t); | 1555 time(&now_t); |
1552 | 1556 |
1553 scr_LogPrint(LPRINT_LOGNORM, "Received an IQ time request from <%s>", from); | 1557 if (!settings_opt_get_int("iq_hide_requests")) { |
1558 scr_LogPrint(LPRINT_LOGNORM, "Received an IQ time request from <%s>", from); | |
1559 } | |
1554 | 1560 |
1555 buf = g_new0(char, 512); | 1561 buf = g_new0(char, 512); |
1556 | 1562 |
1557 x = jutil_iqnew(JPACKET__RESULT, NS_TIME); | 1563 x = jutil_iqnew(JPACKET__RESULT, NS_TIME); |
1558 xmlnode_put_attrib(x, "id", id); | 1564 xmlnode_put_attrib(x, "id", id); |
1595 char const *sign; | 1601 char const *sign; |
1596 int diff = 0; | 1602 int diff = 0; |
1597 | 1603 |
1598 time(&now_t); | 1604 time(&now_t); |
1599 | 1605 |
1600 scr_LogPrint(LPRINT_LOGNORM, "Received an IQ time request from <%s>", from); | 1606 if (!settings_opt_get_int("iq_hide_requests")) { |
1607 scr_LogPrint(LPRINT_LOGNORM, "Received an IQ time request from <%s>", from); | |
1608 } | |
1601 | 1609 |
1602 buf = g_new0(char, 512); | 1610 buf = g_new0(char, 512); |
1603 | 1611 |
1604 x = jutil_iqnew(JPACKET__RESULT, NULL); | 1612 x = jutil_iqnew(JPACKET__RESULT, NULL); |
1605 xmlnode_hide(xmlnode_get_tag(x, "query")); | 1613 xmlnode_hide(xmlnode_get_tag(x, "query")); |