aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-individual-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy/empathy-individual-manager.c')
-rw-r--r--libempathy/empathy-individual-manager.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c
index 1e76cbf83..15baa8538 100644
--- a/libempathy/empathy-individual-manager.c
+++ b/libempathy/empathy-individual-manager.c
@@ -173,6 +173,20 @@ aggregator_individuals_changed_cb (FolksIndividualAggregator *aggregator,
EmpathyIndividualManagerPriv *priv = GET_PRIV (self);
GList *l, *added_filtered = NULL;
+ /* Handle the removals first, as one of the added Individuals might have the
+ * same ID as one of the removed Individuals (due to linking). */
+ for (l = removed; l; l = l->next)
+ {
+ FolksIndividual *ind = FOLKS_INDIVIDUAL (l->data);
+
+ g_signal_handlers_disconnect_by_func (ind,
+ individual_notify_personas_cb, self);
+
+ if (g_hash_table_lookup (priv->individuals,
+ folks_individual_get_id (ind)) != NULL)
+ remove_individual (self, ind);
+ }
+
/* Filter the individuals for ones which contain EmpathyContacts */
for (l = added; l; l = l->next)
{
@@ -188,18 +202,6 @@ aggregator_individuals_changed_cb (FolksIndividualAggregator *aggregator,
}
}
- for (l = removed; l; l = l->next)
- {
- FolksIndividual *ind = FOLKS_INDIVIDUAL (l->data);
-
- g_signal_handlers_disconnect_by_func (ind,
- individual_notify_personas_cb, self);
-
- if (g_hash_table_lookup (priv->individuals,
- folks_individual_get_id (ind)) != NULL)
- remove_individual (self, ind);
- }
-
/* Bail if we have no individuals left */
if (added_filtered == NULL && removed == NULL)
return;