| 2250 static void user_search_x_data_cb(JabberStream *js, xmlnode *result, gpointer data) |
2250 static void user_search_x_data_cb(JabberStream *js, xmlnode *result, gpointer data) |
| 2251 { |
2251 { |
| 2252 xmlnode *query; |
2252 xmlnode *query; |
| 2253 JabberIq *iq; |
2253 JabberIq *iq; |
| 2254 char *dir_server = data; |
2254 char *dir_server = data; |
| |
2255 const char *type; |
| |
2256 |
| |
2257 /* if they've cancelled the search, we're |
| |
2258 * just going to get an error if we send |
| |
2259 * a cancel, so skip it */ |
| |
2260 type = xmlnode_get_attrib(result, "type"); |
| |
2261 if(type && !strcmp(type, "cancel")) { |
| |
2262 g_free(dir_server); |
| |
2263 return; |
| |
2264 } |
| 2255 |
2265 |
| 2256 iq = jabber_iq_new_query(js, JABBER_IQ_SET, "jabber:iq:search"); |
2266 iq = jabber_iq_new_query(js, JABBER_IQ_SET, "jabber:iq:search"); |
| 2257 query = xmlnode_get_child(iq->node, "query"); |
2267 query = xmlnode_get_child(iq->node, "query"); |
| 2258 |
2268 |
| 2259 xmlnode_insert_child(query, result); |
2269 xmlnode_insert_child(query, result); |