diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-11-05 16:50:38 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2010-11-05 16:50:38 +0000 |
commit | 82e3034c0f19771d64765df1ad895fabe507804c (patch) | |
tree | 36443d74ae470f75a8c17705ffccefc3b07ef980 /src/conn-aliasing.c | |
parent | e29b24766c84e0317db738097c532379a63d1ee1 (diff) |
aliasing: don't call into vCard manager if unconnected
Diffstat (limited to 'src/conn-aliasing.c')
-rw-r--r-- | src/conn-aliasing.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/conn-aliasing.c b/src/conn-aliasing.c index e18e800da..7442afccf 100644 --- a/src/conn-aliasing.c +++ b/src/conn-aliasing.c @@ -245,6 +245,7 @@ aliases_request_basic_pep_cb (GabbleConnection *self, gpointer user_data, GError *error) { + TpBaseConnection *base = (TpBaseConnection *) self; GabbleConnectionAliasSource source = GABBLE_CONNECTION_ALIAS_NONE; TpHandle handle = GPOINTER_TO_UINT (user_data); @@ -253,7 +254,8 @@ aliases_request_basic_pep_cb (GabbleConnection *self, source = _gabble_connection_get_cached_alias (self, handle, NULL); if (source < GABBLE_CONNECTION_ALIAS_FROM_VCARD && - !gabble_vcard_manager_has_cached_alias (self->vcard_manager, handle)) + !gabble_vcard_manager_has_cached_alias (self->vcard_manager, handle) && + base->status == TP_CONNECTION_STATUS_CONNECTED) { /* no alias in PEP, get the vcard */ gabble_vcard_manager_request (self->vcard_manager, handle, 0, @@ -267,6 +269,7 @@ aliases_request_pep_cb (GabbleConnection *self, gpointer user_data, GError *error) { + TpBaseConnection *base = (TpBaseConnection *) self; AliasRequest *alias_request = (AliasRequest *) user_data; AliasesRequest *aliases_request = alias_request->aliases_request; guint index = alias_request->index; @@ -291,6 +294,11 @@ aliases_request_pep_cb (GabbleConnection *self, { aliases_request->aliases[index] = alias; } + else if (base->status != TP_CONNECTION_STATUS_CONNECTED) + { + DEBUG ("no longer connected, not chaining up to vCard"); + g_free (alias); + } else { /* not in PEP and we have no vCard - chain to looking up their vCard */ |