[empathy] When getting messages for a file, pass the account as we already know it



commit 6d7f7edd8ee8290d0e07441523d6c9e44ed0a38d
Author: Sjoerd Simons <sjoerd simons collabora co uk>
Date:   Sun Sep 13 16:57:48 2009 +0100

    When getting messages for a file, pass the account as we already know it

 libempathy/empathy-log-store-empathy.c |   18 ++++--------------
 1 files changed, 4 insertions(+), 14 deletions(-)
---
diff --git a/libempathy/empathy-log-store-empathy.c b/libempathy/empathy-log-store-empathy.c
index 9963bfc..69cbab7 100644
--- a/libempathy/empathy-log-store-empathy.c
+++ b/libempathy/empathy-log-store-empathy.c
@@ -441,6 +441,7 @@ log_store_empathy_search_hit_new (EmpathyLogStore *self,
 
 static GList *
 log_store_empathy_get_messages_for_file (EmpathyLogStore *self,
+                                         EmpathyAccount *account,
                                          const gchar *filename)
 {
   GList *messages = NULL;
@@ -448,8 +449,6 @@ log_store_empathy_get_messages_for_file (EmpathyLogStore *self,
   xmlDocPtr doc;
   xmlNodePtr log_node;
   xmlNodePtr node;
-  EmpathyLogSearchHit *hit;
-  EmpathyAccount *account;
 
   g_return_val_if_fail (EMPATHY_IS_LOG_STORE (self), NULL);
   g_return_val_if_fail (filename != NULL, NULL);
@@ -462,17 +461,6 @@ log_store_empathy_get_messages_for_file (EmpathyLogStore *self,
       return NULL;
     }
 
-  /* Get the account from the filename */
-  hit = log_store_empathy_search_hit_new (self, filename);
-
-  if (hit->account != NULL)
-    account = g_object_ref (hit->account);
-
-  empathy_log_manager_search_hit_free (hit);
-
-  if (hit->account == NULL)
-    return NULL;
-
   /* Create parser. */
   ctxt = xmlNewParserCtxt ();
 
@@ -731,10 +719,12 @@ log_store_empathy_get_messages_for_date (EmpathyLogStore *self,
 
   g_return_val_if_fail (EMPATHY_IS_LOG_STORE (self), NULL);
   g_return_val_if_fail (chat_id != NULL, NULL);
+  g_return_val_if_fail (account != NULL, NULL);
 
   filename = log_store_empathy_get_filename_for_date (self, account,
       chat_id, chatroom, date);
-  messages = log_store_empathy_get_messages_for_file (self, filename);
+  messages = log_store_empathy_get_messages_for_file (self, account,
+    filename);
   g_free (filename);
 
   return messages;



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