]> git.0d.be Git - empathy.git/commitdiff
Get last messages for the last day - 1 as well as the last day.
authorJonny Lamb <jonny.lamb@collabora.co.uk>
Fri, 6 Mar 2009 11:52:41 +0000 (11:52 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Fri, 6 Mar 2009 11:52:41 +0000 (11:52 +0000)
As messages are being logged straight away, the most recent day
will *always* be today.

Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
svn path=/trunk/; revision=2603

libempathy/empathy-log-manager.c

index 73ddf65ec0998e26483fcd20e7999080e220cd19..30c31f92aa268771df331dc0624fbf8a27f9be8f 100644 (file)
@@ -280,9 +280,19 @@ empathy_log_manager_get_last_messages (EmpathyLogManager *manager,
 
   l = g_list_last (dates);
   if (l)
-    messages = empathy_log_manager_get_messages_for_date (manager, account,
+    {
+      messages = empathy_log_manager_get_messages_for_date (manager, account,
         chat_id, chatroom, l->data);
 
+      /* The latest date will always be today as messages are logged immediately. */
+      l = g_list_previous (l);
+      if (l)
+        {
+          messages = g_list_concat (messages, empathy_log_manager_get_messages_for_date (
+            manager, account, chat_id, chatroom, l->data));
+        }
+    }
+
   g_list_foreach (dates, (GFunc) g_free, NULL);
   g_list_free (dates);