From 7c9bdd521147ee2f11c3f88de8f1c17c83fc2508 Mon Sep 17 00:00:00 2001 From: Emilio Pozuelo Monfort Date: Tue, 26 Apr 2011 22:38:00 +0100 Subject: LogWindow: check the 30min gap with the last message --- libempathy-gtk/empathy-log-window.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libempathy-gtk/empathy-log-window.c') diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c index b8319dd1f..e786f164d 100644 --- a/libempathy-gtk/empathy-log-window.c +++ b/libempathy-gtk/empathy-log-window.c @@ -582,7 +582,7 @@ model_is_parent (GtkTreeModel *model, TpAccount *account; gint64 timestamp; gboolean found = FALSE; - GtkTreeIter parent; + GtkTreeIter parent, child; gboolean is_toplevel; is_toplevel = !gtk_tree_model_iter_parent (model, &parent, iter); @@ -590,7 +590,6 @@ model_is_parent (GtkTreeModel *model, gtk_tree_model_get (model, iter, COL_EVENTS_ACCOUNT, &account, COL_EVENTS_TARGET, &target, - COL_EVENTS_TS, ×tamp, COL_EVENTS_EVENT, &stored_event, -1); @@ -599,6 +598,13 @@ model_is_parent (GtkTreeModel *model, account_equal (account, tpl_event_get_account (event)) && entity_equal (target, event_get_target (event))) { + gtk_tree_model_iter_nth_child (model, &child, iter, + gtk_tree_model_iter_n_children (model, iter) - 1); + + gtk_tree_model_get (model, &child, + COL_EVENTS_TS, ×tamp, + -1); + if (ABS (tpl_event_get_timestamp (event) - timestamp) < 1800) { /* The gap is smaller than 30 min */ -- cgit v1.2.3