# HG changeset patch # User Tobias Markmann # Date 1215529545 0 # Node ID 3f719eaa7fd191731c5470ed19af28195fade3aa # Parent 61f37abc8a701a618195c52ccd6c28654e6582b6 * IPC work * removed g_free which may've resulted in a bug diff -r 61f37abc8a70 -r 3f719eaa7fd1 libpurple/protocols/jabber/caps.c --- a/libpurple/protocols/jabber/caps.c Mon Jul 07 18:28:05 2008 +0000 +++ b/libpurple/protocols/jabber/caps.c Tue Jul 08 15:05:45 2008 +0000 @@ -227,11 +227,12 @@ static void jabber_caps_store(void) { char *str; + int length = 0; xmlnode *root = xmlnode_new("capabilities"); g_hash_table_foreach(capstable, jabber_caps_store_client, root); - str = xmlnode_to_formatted_str(root, NULL); + str = xmlnode_to_formatted_str(root, &length); xmlnode_free(root); - purple_util_write_data_to_file(JABBER_CAPS_FILENAME, str, -1); + purple_util_write_data_to_file(JABBER_CAPS_FILENAME, str, length); g_free(str); } @@ -535,7 +536,6 @@ client = g_hash_table_lookup(capstable, key); g_hash_table_replace(jabber_contact_info, g_strdup(who), key); - g_free(key); if(!client) { JabberIq *iq = jabber_iq_new_query(js,JABBER_IQ_GET,"http://jabber.org/protocol/disco#info"); diff -r 61f37abc8a70 -r 3f719eaa7fd1 libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Mon Jul 07 18:28:05 2008 +0000 +++ b/libpurple/protocols/jabber/jabber.c Tue Jul 08 15:05:45 2008 +0000 @@ -2477,8 +2477,9 @@ jabber_ipc_add_feature(gchar *feature) { if (feature == 0) return; + jabber_add_feature(feature, 0); - jabber_add_feature(feature, 0); + // send presence with new caps info for all connected accounts } void @@ -2516,4 +2517,8 @@ purple_value_new(PURPLE_TYPE_BOOLEAN), 2, purple_value_new(PURPLE_TYPE_STRING), purple_value_new(PURPLE_TYPE_STRING)); -} \ No newline at end of file + purple_plugin_ipc_register(plugin, "add_feature", PURPLE_CALLBACK(jabber_ipc_add_feature), + purple_marshal_VOID__POINTER, + NULL, 1, + purple_value_new(PURPLE_TYPE_STRING)); +}