Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/iq.c @ 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 | f52def9dc7c9 |
children | c5c265dff90c |
comparison
equal
deleted
inserted
replaced
18121:9b9e202eb449 | 18122:74b5a39819e6 |
---|---|
206 } | 206 } |
207 } | 207 } |
208 | 208 |
209 static void urn_xmpp_ping_parse(JabberStream *js, xmlnode *packet) | 209 static void urn_xmpp_ping_parse(JabberStream *js, xmlnode *packet) |
210 { | 210 { |
211 const char *type, *id; | 211 const char *type, *id, *from; |
212 JabberIq *iq; | 212 JabberIq *iq; |
213 | |
214 type = xmlnode_get_attrib(packet, "type"); | |
215 from = xmlnode_get_attrib(packet, "from"); | |
216 id = xmlnode_get_attrib(packet, "id"); | |
213 | 217 |
214 if(type && !strcmp(type, "get")) { | 218 if(type && !strcmp(type, "get")) { |
215 iq = jabber_iq_new_query(js, JABBER_IQ_RESULT, "urn:xmpp:ping"); | 219 iq = jabber_iq_new_query(js, JABBER_IQ_RESULT, "urn:xmpp:ping"); |
216 | 220 |
217 jabber_iq_set_id(iq, id); | 221 jabber_iq_set_id(iq, id); |
222 xmlnode_set_attrib(iq->node, "to", from); | |
218 | 223 |
219 jabber_iq_send(iq); | 224 jabber_iq_send(iq); |
220 } else { | 225 } else { |
221 /* XXX: error */ | 226 /* XXX: error */ |
222 } | 227 } |