diff src/blist.c @ 11067:2eca9ed49469

[gaim-migrate @ 13048] Modified configure.ac so that it rejects dbus builds with the dbus library older than 0.34 Added a simple object registration system to the dbus implementation so that it is possible to query object properties remotely (eg. give me property "name" of buddy with id = 5). committer: Tailor Script <tailor@pidgin.im>
author Piotr Zielinski <zielaj>
date Thu, 07 Jul 2005 15:43:48 +0000
parents 3428ad6f5049
children 8b346ce5cdb8
line wrap: on
line diff
--- a/src/blist.c	Thu Jul 07 15:43:05 2005 +0000
+++ b/src/blist.c	Thu Jul 07 15:43:48 2005 +0000
@@ -23,6 +23,7 @@
 #include "internal.h"
 #include "blist.h"
 #include "conversation.h"
+#include "dbus-maybe.h"
 #include "debug.h"
 #include "notify.h"
 #include "prefs.h"
@@ -1053,6 +1054,7 @@
 	if (ops != NULL && ops->new_node != NULL)
 		ops->new_node((GaimBlistNode *)chat);
 
+	GAIM_DBUS_REGISTER_POINTER(chat, DBUS_POINTER_CHAT);
 	return chat;
 }
 
@@ -1078,6 +1080,7 @@
 	if (ops && ops->new_node)
 		ops->new_node((GaimBlistNode *)buddy);
 
+	GAIM_DBUS_REGISTER_POINTER(buddy, DBUS_POINTER_BUDDY);
 	return buddy;
 }
 
@@ -1346,6 +1349,7 @@
 	if (ops && ops->new_node)
 		ops->new_node((GaimBlistNode *)contact);
 
+	GAIM_DBUS_REGISTER_POINTER(contact, DBUS_POINTER_CONTACT);
 	return contact;
 }
 
@@ -1425,6 +1429,7 @@
 	if (ops && ops->new_node)
 		ops->new_node((GaimBlistNode *)group);
 
+	GAIM_DBUS_REGISTER_POINTER(group, DBUS_POINTER_GROUP);
 	return group;
 }
 
@@ -1681,6 +1686,7 @@
 
 		/* Delete the node */
 		g_hash_table_destroy(contact->node.settings);
+		GAIM_DBUS_UNREGISTER_POINTER(contact);
 		g_free(contact);
 	}
 }
@@ -1753,6 +1759,8 @@
 	g_free(buddy->name);
 	g_free(buddy->alias);
 	g_free(buddy->server_alias);
+
+	GAIM_DBUS_UNREGISTER_POINTER(buddy);
 	g_free(buddy);
 
 	/* If the contact is empty then remove it */
@@ -1797,6 +1805,7 @@
 	g_hash_table_destroy(chat->components);
 	g_hash_table_destroy(chat->node.settings);
 	g_free(chat->alias);
+	GAIM_DBUS_UNREGISTER_POINTER(chat);
 	g_free(chat);
 }
 
@@ -1859,6 +1868,7 @@
 	/* Delete the node */
 	g_hash_table_destroy(group->node.settings);
 	g_free(group->name);
+	GAIM_DBUS_UNREGISTER_POINTER(group);
 	g_free(group);
 }