| 225 } |
225 } |
| 226 } |
226 } |
| 227 |
227 |
| 228 static void jabber_caps_store(void) { |
228 static void jabber_caps_store(void) { |
| 229 char *str; |
229 char *str; |
| |
230 int length = 0; |
| 230 xmlnode *root = xmlnode_new("capabilities"); |
231 xmlnode *root = xmlnode_new("capabilities"); |
| 231 g_hash_table_foreach(capstable, jabber_caps_store_client, root); |
232 g_hash_table_foreach(capstable, jabber_caps_store_client, root); |
| 232 str = xmlnode_to_formatted_str(root, NULL); |
233 str = xmlnode_to_formatted_str(root, &length); |
| 233 xmlnode_free(root); |
234 xmlnode_free(root); |
| 234 purple_util_write_data_to_file(JABBER_CAPS_FILENAME, str, -1); |
235 purple_util_write_data_to_file(JABBER_CAPS_FILENAME, str, length); |
| 235 g_free(str); |
236 g_free(str); |
| 236 } |
237 } |
| 237 |
238 |
| 238 /* this function assumes that all information is available locally */ |
239 /* this function assumes that all information is available locally */ |
| 239 static JabberCapsClientInfo *jabber_caps_collect_info(const char *node, const char *ver, GList *ext) { |
240 static JabberCapsClientInfo *jabber_caps_collect_info(const char *node, const char *ver, GList *ext) { |
| 533 key->hash = (char*)hash; |
534 key->hash = (char*)hash; |
| 534 |
535 |
| 535 client = g_hash_table_lookup(capstable, key); |
536 client = g_hash_table_lookup(capstable, key); |
| 536 |
537 |
| 537 g_hash_table_replace(jabber_contact_info, g_strdup(who), key); |
538 g_hash_table_replace(jabber_contact_info, g_strdup(who), key); |
| 538 g_free(key); |
|
| 539 |
539 |
| 540 if(!client) { |
540 if(!client) { |
| 541 JabberIq *iq = jabber_iq_new_query(js,JABBER_IQ_GET,"http://jabber.org/protocol/disco#info"); |
541 JabberIq *iq = jabber_iq_new_query(js,JABBER_IQ_GET,"http://jabber.org/protocol/disco#info"); |
| 542 xmlnode *query = xmlnode_get_child_with_namespace(iq->node,"query","http://jabber.org/protocol/disco#info"); |
542 xmlnode *query = xmlnode_get_child_with_namespace(iq->node,"query","http://jabber.org/protocol/disco#info"); |
| 543 char *nodever = g_strdup_printf("%s#%s", node, ver); |
543 char *nodever = g_strdup_printf("%s#%s", node, ver); |