soc.2010.detachablepurple: 51eab32d: Added the groups path names in parameter...
gillux at soc.pidgin.im
gillux at soc.pidgin.im
Mon Aug 9 23:58:30 EDT 2010
----------------------------------------------------------------------
Revision: 51eab32d5bf613506ee24026925da51baa5cc171
Parent: cf706f9c79b878a44fc6aa8af8a4a935af091757
Author: gillux at soc.pidgin.im
Date: 08/09/10 23:20:05
Branch: im.pidgin.soc.2010.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/51eab32d5bf613506ee24026925da51baa5cc171
Changelog:
Added the groups path names in parameters of the GetBuddyList dbus method.
We need this because clients can't guess it when they create their buddy list.
Changes against parent cf706f9c79b878a44fc6aa8af8a4a935af091757
patched libpurple/dbus/blist.c
patched libpurple/dbus/blist.xml
-------------- next part --------------
============================================================
--- libpurple/dbus/blist.c 17d1b295884f98ed97b75e8c79e13097e28a0728
+++ libpurple/dbus/blist.c 3417d644ac5ddd558678b881be6c2ba7d4f616c3
@@ -26,6 +26,8 @@
#include "blist-node.h"
#include "core.h"
#include "dbus/blist.h"
+#include "dbus/blist-client.h"
+#include "dbus-maybe.h"
#include "dbus-purple.h"
/**
@@ -78,7 +80,8 @@ gboolean DBUS_purple_blist_get_buddy_lis
#define DBUS_PURPLE_GROUP_PACK \
( \
dbus_g_type_get_struct("GValueArray", \
- G_TYPE_STRING, DBUS_PURPLE_BLIST_SETTINGS, G_TYPE_INVALID) \
+ G_TYPE_STRING, G_TYPE_STRING, DBUS_PURPLE_BLIST_SETTINGS, \
+ G_TYPE_INVALID) \
)
#define DBUS_PURPLE_CONTACT_PACK \
( \
@@ -204,6 +207,7 @@ pack_group(GPtrArray *groups, PurpleGrou
{
GValue group_pack = {0, };
gboolean ok;
+ char *group_path;
const char *group_name;
GPtrArray *settings_pack;
@@ -211,11 +215,13 @@ pack_group(GPtrArray *groups, PurpleGrou
g_value_set_boxed(&group_pack,
dbus_g_type_specialized_construct(DBUS_PURPLE_GROUP_PACK));
+ group_path = purple_object_get_dbus_path(PURPLE_OBJECT(group));
group_name = purple_group_get_name(group);
settings_pack = settings_to_ptr_array(PURPLE_BLIST_NODE(group));
ok = dbus_g_type_struct_set(&group_pack,
- 0, group_name,
- 1, settings_pack, G_MAXUINT);
+ 0, group_path,
+ 1, group_name,
+ 2, settings_pack, G_MAXUINT);
g_ptr_array_foreach(settings_pack, (GFunc)g_value_array_free, NULL);
g_ptr_array_free(settings_pack, TRUE);
@@ -392,3 +398,22 @@ DBUS_purple_blist_get_buddy_list(PurpleB
*groups, *contacts, *buddies, *chats);
return TRUE;
}
+
+static void
+set_blist_setting(GValueArray* box, GHashTable *settings)
+{
+ GValue val = {0, };
+ gboolean ok;
+ char *name = NULL;
+ GValue *value;
+
+ g_value_init(&val, DBUS_PURPLE_BLIST_SETTING);
+ g_value_set_boxed(&val, box);
+ ok = dbus_g_type_struct_get(&val, 0, &name, 1, &value, G_MAXUINT);
+ if (ok)
+ g_hash_table_replace(settings, g_strdup(name),
+ purple_g_value_slice_dup(value));
+ g_free(name);
+ g_value_unset(&val);
+ g_value_unset(value);
+}
============================================================
--- libpurple/dbus/blist.xml 0096598a98100c297b0759050c79abe190d03e18
+++ libpurple/dbus/blist.xml db2c0cc236d92ec6d82ce7cbe187e52d1d18baea
@@ -2,8 +2,9 @@
<node name="/im/pidgin/purple/blist">
<interface name="im.pidgin.purple.blist">
<method name="GetBuddyList">
- <!-- group: s = group name; a(sv) = settings -->
- <arg type="a(sa(sv))" name="groups" direction="out" />
+ <!-- group: s = group path name; s = group name;
+ a(sv) = settings -->
+ <arg type="a(ssa(sv))" name="groups" direction="out" />
<!-- contact: s = contact path name; s = alias;
s = parent path name; a(sv) = settings -->
<arg type="a(sssa(sv))" name="contacts"
More information about the Commits
mailing list