aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-log-manager.c
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2009-03-06 19:51:21 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-03-06 19:51:21 +0800
commitd78ab99f9c8eb7952f502cfb81a9bb0274b210df (patch)
treeb4b658beade4c547e19199b2837b5921e315843d /libempathy/empathy-log-manager.c
parent51b836484f5eef122ffb1b364caec38cb3973fde (diff)
downloadgsoc2013-empathy-d78ab99f9c8eb7952f502cfb81a9bb0274b210df.tar
gsoc2013-empathy-d78ab99f9c8eb7952f502cfb81a9bb0274b210df.tar.gz
gsoc2013-empathy-d78ab99f9c8eb7952f502cfb81a9bb0274b210df.tar.bz2
gsoc2013-empathy-d78ab99f9c8eb7952f502cfb81a9bb0274b210df.tar.lz
gsoc2013-empathy-d78ab99f9c8eb7952f502cfb81a9bb0274b210df.tar.xz
gsoc2013-empathy-d78ab99f9c8eb7952f502cfb81a9bb0274b210df.tar.zst
gsoc2013-empathy-d78ab99f9c8eb7952f502cfb81a9bb0274b210df.zip
Made get_last_messages source independent. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk> svn path=/trunk/; revision=2579
Diffstat (limited to 'libempathy/empathy-log-manager.c')
-rw-r--r--libempathy/empathy-log-manager.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/libempathy/empathy-log-manager.c b/libempathy/empathy-log-manager.c
index 371100e13..f734a184d 100644
--- a/libempathy/empathy-log-manager.c
+++ b/libempathy/empathy-log-manager.c
@@ -246,29 +246,25 @@ empathy_log_manager_get_last_messages (EmpathyLogManager *manager,
const gchar *chat_id,
gboolean chatroom)
{
- GList *l, *out = NULL;
- EmpathyLogManagerPriv *priv;
+ GList *messages = NULL;
+ GList *dates;
+ GList *l;
g_return_val_if_fail (EMPATHY_IS_LOG_MANAGER (manager), NULL);
g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL);
g_return_val_if_fail (chat_id != NULL, NULL);
- priv = GET_PRIV (manager);
+ dates = empathy_log_manager_get_dates (manager, account, chat_id, chatroom);
- for (l = priv->sources; l; l = l->next)
- {
- EmpathyLogSource *source = (EmpathyLogSource *) l->data;
+ l = g_list_last (dates);
+ if (l)
+ messages = empathy_log_manager_get_messages_for_date (manager, account,
+ chat_id, chatroom, l->data);
- if (!source->get_last_messages)
- continue;
-
- if (!out)
- out = source->get_last_messages (manager, account, chat_id, chatroom);
- else
- out = g_list_concat (out, source->get_last_messages (manager, account, chat_id, chatroom));
- }
+ g_list_foreach (dates, (GFunc) g_free, NULL);
+ g_list_free (dates);
- return out;
+ return messages;
}
GList *