changeset 18122:74b5a39819e6

i'm an idiot. now we have real support for replying to XMPP pings
author Nathan Walp <nwalp@pidgin.im>
date Sat, 16 Jun 2007 20:59:41 +0000
parents 9b9e202eb449
children ca965dfd3875 590bd623d7db
files libpurple/protocols/jabber/iq.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/iq.c	Sat Jun 16 20:34:35 2007 +0000
+++ b/libpurple/protocols/jabber/iq.c	Sat Jun 16 20:59:41 2007 +0000
@@ -208,13 +208,18 @@
 
 static void urn_xmpp_ping_parse(JabberStream *js, xmlnode *packet)
 {
-	const char *type, *id;
+	const char *type, *id, *from;
 	JabberIq *iq;
 
+	type = xmlnode_get_attrib(packet, "type");
+	from = xmlnode_get_attrib(packet, "from");
+	id = xmlnode_get_attrib(packet, "id");
+
 	if(type && !strcmp(type, "get")) {
 		iq = jabber_iq_new_query(js, JABBER_IQ_RESULT, "urn:xmpp:ping");
 
 		jabber_iq_set_id(iq, id);
+		xmlnode_set_attrib(iq->node, "to", from);
 
 		jabber_iq_send(iq);
 	} else {