aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2009-03-06 19:52:41 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-03-06 19:52:41 +0800
commit15d9dbd80834fd5bd7efcf0d751fc88d879e0177 (patch)
tree681016ea7839bca62b51a7d6c17afe9c557d14ce
parentd5aeb6601d7290b0ef6ab0564132d92e81106247 (diff)
downloadgsoc2013-empathy-15d9dbd80834fd5bd7efcf0d751fc88d879e0177.tar
gsoc2013-empathy-15d9dbd80834fd5bd7efcf0d751fc88d879e0177.tar.gz
gsoc2013-empathy-15d9dbd80834fd5bd7efcf0d751fc88d879e0177.tar.bz2
gsoc2013-empathy-15d9dbd80834fd5bd7efcf0d751fc88d879e0177.tar.lz
gsoc2013-empathy-15d9dbd80834fd5bd7efcf0d751fc88d879e0177.tar.xz
gsoc2013-empathy-15d9dbd80834fd5bd7efcf0d751fc88d879e0177.tar.zst
gsoc2013-empathy-15d9dbd80834fd5bd7efcf0d751fc88d879e0177.zip
Get last messages for the last day - 1 as well as the last day.
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
-rw-r--r--libempathy/empathy-log-manager.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libempathy/empathy-log-manager.c b/libempathy/empathy-log-manager.c
index 73ddf65ec..30c31f92a 100644
--- a/libempathy/empathy-log-manager.c
+++ b/libempathy/empathy-log-manager.c
@@ -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);