comparison mcabber/src/jab_iq.c @ 1134:995dde656033

Response to XMPP Ping (XEP-0199)
author misc@mandriva.org
date Sat, 03 Feb 2007 18:31:55 +0100
parents c0d44a9a99bc
children c30c315dc447
comparison
equal deleted inserted replaced
1133:9dd28a56128f 1134:995dde656033
818 "var", NS_CHATSTATES); 818 "var", NS_CHATSTATES);
819 xmlnode_put_attrib(xmlnode_insert_tag(myquery, "feature"), 819 xmlnode_put_attrib(xmlnode_insert_tag(myquery, "feature"),
820 "var", NS_TIME); 820 "var", NS_TIME);
821 xmlnode_put_attrib(xmlnode_insert_tag(myquery, "feature"), 821 xmlnode_put_attrib(xmlnode_insert_tag(myquery, "feature"),
822 "var", NS_VERSION); 822 "var", NS_VERSION);
823 823 xmlnode_put_attrib(xmlnode_insert_tag(myquery, "feature"),
824 "var", NS_PING);
825 jab_send(jc, x);
826 xmlnode_free(x);
827 }
828
829 static void handle_iq_ping(jconn conn, char *from, const char *id,
830 xmlnode xmldata)
831 {
832 xmlnode x;
833 x = jutil_iqresult(xmldata);
824 jab_send(jc, x); 834 jab_send(jc, x);
825 xmlnode_free(x); 835 xmlnode_free(x);
826 } 836 }
827 837
828 static void handle_iq_version(jconn conn, char *from, const char *id, 838 static void handle_iq_version(jconn conn, char *from, const char *id,
913 guint iq_not_implemented = FALSE; 923 guint iq_not_implemented = FALSE;
914 924
915 id = xmlnode_get_attrib(xmldata, "id"); 925 id = xmlnode_get_attrib(xmldata, "id");
916 if (!id) { 926 if (!id) {
917 scr_LogPrint(LPRINT_LOG, "IQ get stanza with no ID, ignored."); 927 scr_LogPrint(LPRINT_LOG, "IQ get stanza with no ID, ignored.");
928 return;
929 }
930
931 x = xmlnode_get_tag(xmldata, "ping");
932 ns = xmlnode_get_attrib(x, "xmlns");
933 if (ns && !strcmp(ns, NS_PING)) {
934 handle_iq_ping(conn, from, id, xmldata);
918 return; 935 return;
919 } 936 }
920 937
921 x = xmlnode_get_tag(xmldata, "query"); 938 x = xmlnode_get_tag(xmldata, "query");
922 ns = xmlnode_get_attrib(x, "xmlns"); 939 ns = xmlnode_get_attrib(x, "xmlns");