summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2010-05-25 17:53:49 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2010-05-25 17:53:49 +0100
commit1dedb276b857276562ec4b007387e856ee8d5bfc (patch)
tree808de2f0ce41d9368688be41ab09650870b67b94
parentfcfe135a45329d25cd8886b3861f68ee736e672e (diff)
downloadtelepathy-mission-control-1dedb276b857276562ec4b007387e856ee8d5bfc.tar.gz
Don't cache whether we have the requests interface
One use of the caching (in _mcd_connection_request_channel) was subtly incorrect: before using the cached variable we checked whether the TpConnection was ready, but that's not the same thing as checking whether our on_connection_ready() callback (which caches it) has actually been called yet. This fixes a regression in dispatcher/connect-for-request.py.
-rw-r--r--src/mcd-connection.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mcd-connection.c b/src/mcd-connection.c
index f4a09bba..521151fa 100644
--- a/src/mcd-connection.c
+++ b/src/mcd-connection.c
@@ -122,7 +122,6 @@ struct _McdConnectionPrivate
guint has_capabilities_if : 1;
guint has_contact_capabilities_draft1_if : 1;
guint has_contact_capabilities_if : 1;
- guint has_requests_if : 1;
/* FALSE until the dispatcher has said it's ready for us */
guint dispatching_started : 1;
@@ -1517,8 +1516,6 @@ on_connection_ready (TpConnection *tp_conn, const GError *error,
MC_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_CAPABILITIES_DRAFT1);
priv->has_contact_capabilities_if = tp_proxy_has_interface_by_id (tp_conn,
TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_CAPABILITIES);
- priv->has_requests_if = tp_proxy_has_interface_by_id (tp_conn,
- TP_IFACE_QUARK_CONNECTION_INTERFACE_REQUESTS);
if (priv->has_presence_if)
_mcd_connection_setup_presence (connection);
@@ -1551,7 +1548,8 @@ _mcd_connection_start_dispatching (McdConnection *self,
self->priv->dispatching_started = TRUE;
- if (self->priv->has_requests_if)
+ if (tp_proxy_has_interface_by_id (self->priv->tp_conn,
+ TP_IFACE_QUARK_CONNECTION_INTERFACE_REQUESTS))
mcd_connection_setup_requests (self);
else
mcd_connection_setup_pre_requests (self);
@@ -2116,8 +2114,11 @@ _mcd_connection_request_channel (McdConnection *connection,
return TRUE;
}
- if (priv->has_requests_if)
+ if (tp_proxy_has_interface_by_id (priv->tp_conn,
+ TP_IFACE_QUARK_CONNECTION_INTERFACE_REQUESTS))
+ {
ret = request_channel_new_iface (connection, channel);
+ }
else
{
mcd_channel_take_error (channel,