aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2009-09-01 21:48:59 +0800
committerCosimo Cecchi <cosimoc@gnome.org>2009-09-01 22:49:39 +0800
commit182f1d1d62275355fa248fcdb9ea9b9a09a60e08 (patch)
treed0adad2503e572eea8ee533a3574cf4bc0048bdc /libempathy
parent834d75c763532d104e21a9add828d4a10afb799b (diff)
downloadgsoc2013-empathy-182f1d1d62275355fa248fcdb9ea9b9a09a60e08.tar
gsoc2013-empathy-182f1d1d62275355fa248fcdb9ea9b9a09a60e08.tar.gz
gsoc2013-empathy-182f1d1d62275355fa248fcdb9ea9b9a09a60e08.tar.bz2
gsoc2013-empathy-182f1d1d62275355fa248fcdb9ea9b9a09a60e08.tar.lz
gsoc2013-empathy-182f1d1d62275355fa248fcdb9ea9b9a09a60e08.tar.xz
gsoc2013-empathy-182f1d1d62275355fa248fcdb9ea9b9a09a60e08.tar.zst
gsoc2013-empathy-182f1d1d62275355fa248fcdb9ea9b9a09a60e08.zip
Don't set empty values for the default EmpathyHandler
This implies the following: - have an empty default handler when the Dispatcher is used directly with the singleton - autogenerate the name for the default handler - set priv->filters in the handler to an empty GPtrArray in this case, as that can't be NULL.
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-dispatcher.c3
-rw-r--r--libempathy/empathy-handler.c11
2 files changed, 14 insertions, 0 deletions
diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c
index 7aec41438..fca24daeb 100644
--- a/libempathy/empathy-dispatcher.c
+++ b/libempathy/empathy-dispatcher.c
@@ -890,6 +890,9 @@ dispatcher_constructor (GType type,
priv = GET_PRIV (dispatcher);
+ if (priv->handler == NULL)
+ priv->handler = empathy_handler_new (NULL, NULL, NULL);
+
empathy_handler_set_handle_channels_func (priv->handler,
empathy_dispatcher_handle_channels,
dispatcher);
diff --git a/libempathy/empathy-handler.c b/libempathy/empathy-handler.c
index 649903058..9a597889e 100644
--- a/libempathy/empathy-handler.c
+++ b/libempathy/empathy-handler.c
@@ -141,12 +141,23 @@ handler_set_property (GObject *object,
{
case PROP_CHANNEL_FILTER:
priv->filters = g_value_dup_boxed (value);
+ if (priv->filters == NULL)
+ priv->filters = g_ptr_array_new ();
break;
case PROP_CAPABILITIES:
priv->capabilities = g_value_dup_boxed (value);
break;
case PROP_NAME:
priv->name = g_value_dup_string (value);
+ if (EMP_STR_EMPTY (priv->name))
+ {
+ TpDBusDaemon *bus;
+
+ bus = tp_dbus_daemon_dup (NULL);
+ priv->name = g_strdup_printf ("%s%p",
+ tp_dbus_daemon_get_unique_name (bus), object);
+ g_object_unref (bus);
+ }
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);