--- a/libpurple/protocols/jabber/caps.c Sun Oct 02 07:13:45 2016 +0300 +++ b/libpurple/protocols/jabber/caps.c Sun Oct 02 08:13:03 2016 +0300 @@ -209,10 +209,11 @@ char *str; int length = 0; PurpleXmlNode *root = purple_xmlnode_new("capabilities"); + g_hash_table_foreach(capstable, jabber_caps_store_client, root); str = purple_xmlnode_to_formatted_str(root, &length); purple_xmlnode_free(root); - purple_util_write_data_to_file(JABBER_CAPS_FILENAME, str, length); + purple_util_write_data_to_cache_file(JABBER_CAPS_FILENAME, str, length); g_free(str); save_timer = 0; @@ -229,7 +230,7 @@ static void jabber_caps_load(void) { - PurpleXmlNode *capsdata = purple_util_read_xml_from_file(JABBER_CAPS_FILENAME, "XMPP capabilities cache"); + PurpleXmlNode *capsdata = purple_util_read_xml_from_cache_file(JABBER_CAPS_FILENAME, "XMPP capabilities cache"); PurpleXmlNode *client; if(!capsdata) @@ -332,6 +333,7 @@ { nodetable = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify)jabber_caps_node_exts_unref); capstable = g_hash_table_new_full(jabber_caps_hash, jabber_caps_compare, NULL, (GDestroyNotify)jabber_caps_client_info_destroy); + purple_move_to_xdg_base_dir(purple_cache_dir(), JABBER_CAPS_FILENAME); jabber_caps_load(); }