From b1258f96afa2c78476488eb9dd0cd081324e8f32 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 11 Apr 2011 17:23:25 +0200 Subject: [PATCH] add tp_proxy_add_interfaces() --- telepathy-glib/proxy-internal.h | 3 +++ telepathy-glib/proxy.c | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 0 deletions(-) diff --git a/telepathy-glib/proxy-internal.h b/telepathy-glib/proxy-internal.h index 949ba23..a8a8cb8 100644 --- a/telepathy-glib/proxy-internal.h +++ b/telepathy-glib/proxy-internal.h @@ -45,4 +45,7 @@ void _tp_proxy_set_feature_prepared (TpProxy *self, void _tp_proxy_set_features_failed (TpProxy *self, const GError *error); +void _tp_proxy_add_interfaces (gpointer proxy, + const gchar * const *interface_names); + #endif diff --git a/telepathy-glib/proxy.c b/telepathy-glib/proxy.c index a8bffff..3a2c7dd 100644 --- a/telepathy-glib/proxy.c +++ b/telepathy-glib/proxy.c @@ -1884,3 +1884,30 @@ _tp_proxy_set_features_failed (TpProxy *self, g_return_if_fail (error != NULL); tp_proxy_poll_features (self, error); } + +void +_tp_proxy_add_interfaces (gpointer proxy, + const gchar * const *interface_names) +{ + guint i; + + if (interface_names == NULL) + return; + + for (i = 0; interface_names[i] != NULL; i++) + { + const gchar *iface = interface_names[i]; + + if (tp_dbus_check_valid_interface_name (iface, NULL)) + { + GQuark q = g_quark_from_string (iface); + + tp_proxy_add_interface_by_id ((TpProxy *) proxy, q); + } + else + { + DEBUG ("Ignoring invalid interface on %s: %s", + tp_proxy_get_object_path (proxy), iface); + } + } +} -- 1.7.4.1