aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2011-04-16 02:31:28 +0800
committerWill Thompson <will.thompson@collabora.co.uk>2011-04-25 18:55:15 +0800
commit3e34b40f5a2ce026187c2e9c8316f1b255c193e9 (patch)
tree8c272cad3988af52950259251c66c64601f34032 /libempathy-gtk
parent4b33bdcdb42169a0e38c4a21b07deb6a4d8dcc93 (diff)
downloadgsoc2013-empathy-3e34b40f5a2ce026187c2e9c8316f1b255c193e9.tar
gsoc2013-empathy-3e34b40f5a2ce026187c2e9c8316f1b255c193e9.tar.gz
gsoc2013-empathy-3e34b40f5a2ce026187c2e9c8316f1b255c193e9.tar.bz2
gsoc2013-empathy-3e34b40f5a2ce026187c2e9c8316f1b255c193e9.tar.lz
gsoc2013-empathy-3e34b40f5a2ce026187c2e9c8316f1b255c193e9.tar.xz
gsoc2013-empathy-3e34b40f5a2ce026187c2e9c8316f1b255c193e9.tar.zst
gsoc2013-empathy-3e34b40f5a2ce026187c2e9c8316f1b255c193e9.zip
contact_list_store_chat_state_changed_cb(): tidy
This doesn't fix bgo#647891, but I think it makes the loop clearer. Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-contact-list-store.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/libempathy-gtk/empathy-contact-list-store.c b/libempathy-gtk/empathy-contact-list-store.c
index f6a7a114d..783ce77ef 100644
--- a/libempathy-gtk/empathy-contact-list-store.c
+++ b/libempathy-gtk/empathy-contact-list-store.c
@@ -194,17 +194,15 @@ contact_list_store_chat_state_changed_cb (TpChannel *self,
contacts = empathy_contact_list_get_members (priv->list);
- /* Find the contact in the list. After that l is the list elem or NULL */
for (l = contacts; l != NULL; l = l->next) {
- if (empathy_contact_get_handle (EMPATHY_CONTACT (l->data)) ==
- contact_handle) {
+ EmpathyContact *contact = EMPATHY_CONTACT (l->data);
+
+ if (empathy_contact_get_handle (contact) == contact_handle) {
+ contact_list_store_contact_update (store, contact);
break;
}
}
- if (l != NULL)
- contact_list_store_contact_update (store, l->data);
-
g_list_foreach (contacts, (GFunc) g_object_unref, NULL);
g_list_free (contacts);
}