aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-07-10 23:07:10 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-07-16 19:41:47 +0800
commit41ad88801dbd0efbfe82bd5c5ba3cb595c9151ab (patch)
tree231b147babb09ac9434972951f87f1b7b5283627 /libempathy
parent2e6c79d649630038440d47da78fc6905aea4d36c (diff)
downloadgsoc2013-empathy-41ad88801dbd0efbfe82bd5c5ba3cb595c9151ab.tar
gsoc2013-empathy-41ad88801dbd0efbfe82bd5c5ba3cb595c9151ab.tar.gz
gsoc2013-empathy-41ad88801dbd0efbfe82bd5c5ba3cb595c9151ab.tar.bz2
gsoc2013-empathy-41ad88801dbd0efbfe82bd5c5ba3cb595c9151ab.tar.lz
gsoc2013-empathy-41ad88801dbd0efbfe82bd5c5ba3cb595c9151ab.tar.xz
gsoc2013-empathy-41ad88801dbd0efbfe82bd5c5ba3cb595c9151ab.tar.zst
gsoc2013-empathy-41ad88801dbd0efbfe82bd5c5ba3cb595c9151ab.zip
Implement HandledChannels D-Bus property
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-dispatcher.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c
index 721d398d9..55fa668ca 100644
--- a/libempathy/empathy-dispatcher.c
+++ b/libempathy/empathy-dispatcher.c
@@ -90,6 +90,7 @@ enum
{
PROP_INTERFACES = 1,
PROP_CHANNEL_FILTER,
+ PROP_CHANNELS
};
enum
@@ -928,6 +929,9 @@ dispatcher_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
+ EmpathyDispatcher *dispatcher = EMPATHY_DISPATCHER (object);
+ EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
+
switch (property_id)
{
case PROP_INTERFACES:
@@ -943,6 +947,24 @@ dispatcher_get_property (GObject *object,
g_value_set_boxed (value, filters);
break;
}
+ case PROP_CHANNELS:
+ {
+ GPtrArray *accounts;
+ GList *l;
+
+ accounts = g_ptr_array_new ();
+
+ for (l = priv->channels; l != NULL; l = g_list_next (l))
+ {
+ TpProxy *channel = TP_PROXY (l->data);
+
+ g_ptr_array_add (accounts,
+ g_strdup (tp_proxy_get_object_path (channel)));
+ }
+
+ g_value_set_boxed (value, accounts);
+ break;
+ }
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -961,6 +983,7 @@ empathy_dispatcher_class_init (EmpathyDispatcherClass *klass)
};
static TpDBusPropertiesMixinPropImpl client_handler_props[] = {
{ "HandlerChannelFilter", "channel-filter", NULL },
+ { "HandledChannels", "channels", NULL },
{ NULL }
};
static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = {
@@ -995,6 +1018,13 @@ empathy_dispatcher_class_init (EmpathyDispatcherClass *klass)
g_object_class_install_property (object_class,
PROP_CHANNEL_FILTER, param_spec);
+ param_spec = g_param_spec_boxed ("channels", "channels",
+ "List of channels we're handling",
+ EMPATHY_ARRAY_TYPE_OBJECT,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class,
+ PROP_CHANNELS, param_spec);
+
signals[OBSERVE] =
g_signal_new ("observe",
G_TYPE_FROM_CLASS (klass),