soc.2008.xmpp: cf844ef0: * IPC work

tfar at soc.pidgin.im tfar at soc.pidgin.im
Tue Jul 15 12:16:23 EDT 2008


-----------------------------------------------------------------
Revision: cf844ef01dd31f6ec26b22c234d1af5c31f15316
Ancestor: 0e1154d70093b2106e0901b3c9077f92e77a6c5f
Author: tfar at soc.pidgin.im
Date: 2008-07-08T15:05:45
Branch: im.pidgin.soc.2008.xmpp
URL: http://d.pidgin.im/viewmtn/revision/info/cf844ef01dd31f6ec26b22c234d1af5c31f15316

Modified files:
        libpurple/protocols/jabber/caps.c
        libpurple/protocols/jabber/jabber.c

ChangeLog: 

* IPC work
* removed g_free which may've resulted in a bug

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/caps.c	be660766299dbad3a7724f4e97ef52bc0317b5d4
+++ libpurple/protocols/jabber/caps.c	fb2fbf53dc0ab023e1187c4846ee5d340b0d7168
@@ -227,11 +227,12 @@ static void jabber_caps_store(void) {
 
 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 *
 	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");
============================================================
--- libpurple/protocols/jabber/jabber.c	6be96c7db9a96e0686206e7684e89d4cf64f13bb
+++ libpurple/protocols/jabber/jabber.c	98889e65abb04a7e3d2439af9e7bb24459bcd464
@@ -2477,8 +2477,9 @@ jabber_ipc_add_feature(gchar *feature) 
 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 @@ jabber_init_plugin(PurplePlugin *plugin)
 							 purple_value_new(PURPLE_TYPE_BOOLEAN), 2,
 							 purple_value_new(PURPLE_TYPE_STRING),
 							 purple_value_new(PURPLE_TYPE_STRING));
+	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));
 }


More information about the Commits mailing list