]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-log-store-empathy.c
Rename empathy_contact_new_static to empathy_contact_new_for_log
[empathy.git] / libempathy / empathy-log-store-empathy.c
index 30284c264c448b5f451c5f112b8cf849beb11fbb..b74b5e177dbb7fb2b41bf07e791c0ec245812448 100644 (file)
@@ -481,8 +481,9 @@ log_store_empathy_get_messages_for_file (EmpathyLogStore *self,
 
       t = empathy_time_parse (time);
 
-      sender = empathy_contact_new_full (account, sender_id, sender_name);
-      empathy_contact_set_is_user (sender, is_user);
+      sender = empathy_contact_new_for_log (account, sender_id, sender_name,
+                                           is_user);
+
       if (!EMP_STR_EMPTY (sender_avatar_token))
         empathy_contact_load_avatar_cache (sender,
             sender_avatar_token);
@@ -505,6 +506,7 @@ log_store_empathy_get_messages_for_file (EmpathyLogStore *self,
       xmlFree (is_user_str);
       xmlFree (msg_type_str);
       xmlFree (cm_id_str);
+      xmlFree (sender_avatar_token);
     }
 
   DEBUG ("Parsed %d messages", g_list_length (messages));
@@ -640,17 +642,15 @@ log_store_empathy_get_chats_for_dir (EmpathyLogStore *self,
   while ((name = g_dir_read_name (gdir)) != NULL)
     {
       EmpathyLogSearchHit *hit;
-      gchar *filename;
 
-      filename = g_build_filename (dir, name, NULL);
-      if (strcmp (name, LOG_DIR_CHATROOMS) == 0)
+      if (!is_chatroom && strcmp (name, LOG_DIR_CHATROOMS) == 0)
         {
+          gchar *filename = g_build_filename (dir, name, NULL);
           hits = g_list_concat (hits, log_store_empathy_get_chats_for_dir (
                 self, filename, TRUE));
           g_free (filename);
           continue;
         }
-
       hit = g_slice_new0 (EmpathyLogSearchHit);
       hit->chat_id = g_strdup (name);
       hit->is_chatroom = is_chatroom;