From b65502681aacef5b2ee64d91f1f0e4614cc9dfc5 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 11 Apr 2011 17:23:52 +0200 Subject: [PATCH] TpProtocol: add supported interfaces (fdo #36134) --- telepathy-glib/protocol.c | 6 ++++++ tests/dbus/protocol-objects.c | 5 +++++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/telepathy-glib/protocol.c b/telepathy-glib/protocol.c index 94b911d..903429f 100644 --- a/telepathy-glib/protocol.c +++ b/telepathy-glib/protocol.c @@ -436,6 +436,7 @@ tp_protocol_constructed (GObject *object) const GPtrArray *rccs; gboolean had_immutables = TRUE; const gchar * const *auth_types = NULL; + const gchar * const *interfaces; if (chain_up != NULL) chain_up (object); @@ -502,6 +503,11 @@ tp_protocol_constructed (GObject *object) self->priv->authentication_types = g_strdupv (tmp); } + interfaces = tp_asv_get_strv (self->priv->protocol_properties, + TP_PROP_PROTOCOL_INTERFACES); + + _tp_proxy_add_interfaces (self, interfaces); + /* become ready immediately */ _tp_proxy_set_feature_prepared (proxy, TP_PROTOCOL_FEATURE_PARAMETERS, had_immutables); diff --git a/tests/dbus/protocol-objects.c b/tests/dbus/protocol-objects.c index db486ac..ecea32f 100644 --- a/tests/dbus/protocol-objects.c +++ b/tests/dbus/protocol-objects.c @@ -336,6 +336,11 @@ test_protocol_object (Test *test, g_assert_cmpstr (tp_protocol_get_name (test->protocol), ==, "example"); + g_assert (tp_proxy_has_interface_by_id (test->protocol, + TP_IFACE_QUARK_PROTOCOL)); + g_assert (tp_proxy_has_interface_by_id (test->protocol, + TP_IFACE_QUARK_PROTOCOL_INTERFACE_AVATARS)); + g_assert (tp_proxy_is_prepared (test->protocol, TP_PROTOCOL_FEATURE_PARAMETERS)); -- 1.7.4.1