summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Markmann <tfar@soc.pidgin.im>2008-07-08 15:05:45 +0000
committerTobias Markmann <tfar@soc.pidgin.im>2008-07-08 15:05:45 +0000
commitcd290badc9393ee6f561640022589e95e4244521 (patch)
treea9563173c8d3477b3dca275c6459594b21dfee8a
parent3953acbc0d09e992ec356ae251af562322217c9c (diff)
downloadpidgin-cd290badc9393ee6f561640022589e95e4244521.tar.gz
* IPC work
* removed g_free which may've resulted in a bug
-rw-r--r--libpurple/protocols/jabber/caps.c6
-rw-r--r--libpurple/protocols/jabber/jabber.c9
2 files changed, 10 insertions, 5 deletions
diff --git a/libpurple/protocols/jabber/caps.c b/libpurple/protocols/jabber/caps.c
index 0d9a279839..1633ef6965 100644
--- a/libpurple/protocols/jabber/caps.c
+++ b/libpurple/protocols/jabber/caps.c
@@ -227,11 +227,12 @@ static void jabber_caps_store_client(gpointer key, gpointer value, gpointer user
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 @@ void jabber_caps_get_info(JabberStream *js, const char *who, const char *node, c
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 --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c
index f34e4a85fd..41c932726f 100644
--- a/libpurple/protocols/jabber/jabber.c
+++ b/libpurple/protocols/jabber/jabber.c
@@ -2477,8 +2477,9 @@ static void
jabber_ipc_add_feature(gchar *feature)
{
if (feature == 0) return;
-
jabber_add_feature(feature, 0);
+
+ // send presence with new caps info for all connected accounts
}
void
@@ -2516,4 +2517,8 @@ jabber_init_plugin(PurplePlugin *plugin)
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));
+}