From d52d1c442b4c9ce07b5257438e5697056ec214fc Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Mon, 27 Jul 2009 09:32:10 +0100 Subject: Don't ping Group channels with GetInterfaces() If we're about to introspect the Group interface anyway, there's no need to call GetInterfaces() to check if the channel's alive: the Group introspection will abort if the channel's dead or broken. This saves an unnecessary roundtrip in the case of group channels for which we have immutable properties; on the happy path, we can introspect a group channel with just one call to GetAll("Chan.Iface.Group"). --- telepathy-glib/channel.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'telepathy-glib/channel.c') diff --git a/telepathy-glib/channel.c b/telepathy-glib/channel.c index de565bbd9..540ec26ab 100644 --- a/telepathy-glib/channel.c +++ b/telepathy-glib/channel.c @@ -576,10 +576,17 @@ _tp_channel_get_interfaces (TpChannel *self) { DEBUG ("%p", self); - if (self->priv->exists && - tp_asv_lookup (self->priv->channel_properties, - TP_IFACE_CHANNEL ".Interfaces") != NULL) + if (tp_asv_lookup (self->priv->channel_properties, + TP_IFACE_CHANNEL ".Interfaces") != NULL && + (self->priv->exists || + tp_proxy_has_interface_by_id (self, + TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP))) { + /* If we already know the channel's interfaces, and either have already + * successfully called a method on the channel (so know it's alive) or + * are going to call one on it when we introspect the Group properties, + * then we don't need to do anything here. + */ _tp_channel_continue_introspection (self); } else -- cgit v1.2.1