diff options
author | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-04-27 17:47:45 +0800 |
---|---|---|
committer | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-06-09 19:34:56 +0800 |
commit | ece7f43a1a51c679fdd9419411c3593ddb597354 (patch) | |
tree | de44028c474dfb81238546f69400fca4a100820f /libempathy-gtk/empathy-log-window.c | |
parent | 002bed41aa3e792e5367f9f996cd496461207783 (diff) | |
download | gsoc2013-empathy-ece7f43a1a51c679fdd9419411c3593ddb597354.tar gsoc2013-empathy-ece7f43a1a51c679fdd9419411c3593ddb597354.tar.gz gsoc2013-empathy-ece7f43a1a51c679fdd9419411c3593ddb597354.tar.bz2 gsoc2013-empathy-ece7f43a1a51c679fdd9419411c3593ddb597354.tar.lz gsoc2013-empathy-ece7f43a1a51c679fdd9419411c3593ddb597354.tar.xz gsoc2013-empathy-ece7f43a1a51c679fdd9419411c3593ddb597354.tar.zst gsoc2013-empathy-ece7f43a1a51c679fdd9419411c3593ddb597354.zip |
Return early if the iter isn't a top level
Diffstat (limited to 'libempathy-gtk/empathy-log-window.c')
-rw-r--r-- | libempathy-gtk/empathy-log-window.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c index b1962cb0f..b64db8201 100644 --- a/libempathy-gtk/empathy-log-window.c +++ b/libempathy-gtk/empathy-log-window.c @@ -613,12 +613,11 @@ model_is_parent (GtkTreeModel *model, TplEvent *stored_event; TplEntity *target; TpAccount *account; - gint64 timestamp; gboolean found = FALSE; - GtkTreeIter parent, child; - gboolean is_toplevel; + GtkTreeIter parent; - is_toplevel = !gtk_tree_model_iter_parent (model, &parent, iter); + if (gtk_tree_model_iter_parent (model, &parent, iter)) + return FALSE; gtk_tree_model_get (model, iter, COL_EVENTS_ACCOUNT, &account, @@ -626,12 +625,14 @@ model_is_parent (GtkTreeModel *model, COL_EVENTS_EVENT, &stored_event, -1); - if (is_toplevel && - G_OBJECT_TYPE (event) == G_OBJECT_TYPE (stored_event) && + if (G_OBJECT_TYPE (event) == G_OBJECT_TYPE (stored_event) && account_equal (account, tpl_event_get_account (event)) && (entity_equal (target, event_get_target (event)) || is_same_confroom (event, stored_event))) { + GtkTreeIter child; + gint64 timestamp; + gtk_tree_model_iter_nth_child (model, &child, iter, gtk_tree_model_iter_n_children (model, iter) - 1); |