aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTravis Reitter <travis.reitter@collabora.co.uk>2011-05-11 07:41:04 +0800
committerTravis Reitter <travis.reitter@collabora.co.uk>2011-06-07 00:30:52 +0800
commit018ba00ead80bed3238273a772ec1fd1c55cf58e (patch)
tree5bc6889f476ba0cdebab9923b02df9bf62d58989
parenta6f6a3b008a9da3e437488b480fdbb2b5d07e9fd (diff)
downloadgsoc2013-empathy-018ba00ead80bed3238273a772ec1fd1c55cf58e.tar
gsoc2013-empathy-018ba00ead80bed3238273a772ec1fd1c55cf58e.tar.gz
gsoc2013-empathy-018ba00ead80bed3238273a772ec1fd1c55cf58e.tar.bz2
gsoc2013-empathy-018ba00ead80bed3238273a772ec1fd1c55cf58e.tar.lz
gsoc2013-empathy-018ba00ead80bed3238273a772ec1fd1c55cf58e.tar.xz
gsoc2013-empathy-018ba00ead80bed3238273a772ec1fd1c55cf58e.tar.zst
gsoc2013-empathy-018ba00ead80bed3238273a772ec1fd1c55cf58e.zip
Only retrieve server-stored groups for Individuals with TpContacts.
Helps: bgo#648822 - Port Empathy to Folks 0.5.1
-rw-r--r--libempathy-gtk/empathy-individual-store.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c
index 01ec89436..ac1a96c02 100644
--- a/libempathy-gtk/empathy-individual-store.c
+++ b/libempathy-gtk/empathy-individual-store.c
@@ -419,9 +419,6 @@ individual_store_add_individual (EmpathyIndividualStore *self,
EmpathyIndividualStorePriv *priv;
GtkTreeIter iter;
GeeIterator *group_iter = NULL;
- EmpathyContact *contact;
- TpConnection *connection;
- gchar *protocol_name;
priv = GET_PRIV (self);
@@ -440,18 +437,23 @@ individual_store_add_individual (EmpathyIndividualStore *self,
group_iter = gee_iterable_iterator (GEE_ITERABLE (group_set));
}
- contact = empathy_contact_dup_from_folks_individual (individual);
- connection = empathy_contact_get_connection (contact);
-
- tp_connection_parse_object_path (connection, &protocol_name, NULL);
-
/* fall-back groups, in case there are no named groups */
if (group_iter == NULL)
{
GtkTreeIter iter_group, *parent;
+ EmpathyContact *contact;
+ TpConnection *connection;
+ gchar *protocol_name = NULL;
parent = &iter_group;
+ contact = empathy_contact_dup_from_folks_individual (individual);
+ if (contact != NULL)
+ {
+ connection = empathy_contact_get_connection (contact);
+ tp_connection_parse_object_path (connection, &protocol_name, NULL);
+ }
+
if (!priv->show_groups)
parent = NULL;
else if (!tp_strdiff (protocol_name, "local-xmpp"))
@@ -470,9 +472,10 @@ individual_store_add_individual (EmpathyIndividualStore *self,
add_individual_to_store (GTK_TREE_STORE (self), &iter, parent,
individual);
- }
- g_free (protocol_name);
+ g_free (protocol_name);
+ g_clear_object (&contact);
+ }
/* Else add to each group. */
while (group_iter != NULL && gee_iterator_next (group_iter))
@@ -505,8 +508,6 @@ individual_store_add_individual (EmpathyIndividualStore *self,
}
individual_store_contact_update (self, individual);
-
- tp_clear_object (&contact);
}
static void