[empathy: 38/80] LogWindow: check the 30min gap with the last message



commit 7c9bdd521147ee2f11c3f88de8f1c17c83fc2508
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Tue Apr 26 22:38:00 2011 +0100

    LogWindow: check the 30min gap with the last message

 libempathy-gtk/empathy-log-window.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index b8319dd..e786f16 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, &timestamp,
       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, &timestamp,
+          -1);
+
       if (ABS (tpl_event_get_timestamp (event) - timestamp) < 1800)
         {
           /* The gap is smaller than 30 min */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]