diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2009-07-27 09:32:10 +0100 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2009-07-27 13:09:36 +0100 |
commit | d52d1c442b4c9ce07b5257438e5697056ec214fc (patch) | |
tree | 426995b33de365df18be2df7de15bc83e23e52f3 /telepathy-glib/channel.c | |
parent | e78f40b6cd8cd2fe228a477258cf02f7957ce3d3 (diff) | |
download | telepathy-glib-d52d1c442b4c9ce07b5257438e5697056ec214fc.tar.gz |
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").
Diffstat (limited to 'telepathy-glib/channel.c')
-rw-r--r-- | telepathy-glib/channel.c | 13 |
1 files changed, 10 insertions, 3 deletions
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 |