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);
xmlFree (is_user_str);
xmlFree (msg_type_str);
xmlFree (cm_id_str);
+ xmlFree (sender_avatar_token);
}
DEBUG ("Parsed %d messages", g_list_length (messages));
GDir *gdir;
GList *hits = NULL;
const gchar *name;
+ GError *error = NULL;
- gdir = g_dir_open (dir, 0, NULL);
+ gdir = g_dir_open (dir, 0, &error);
if (!gdir)
- return NULL;
+ {
+ DEBUG ("Failed to open directory: %s, error: %s", dir, error->message);
+ g_error_free (error);
+ return NULL;
+ }
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, dir, TRUE));
+ self, filename, TRUE));
g_free (filename);
continue;
}
-
hit = g_slice_new0 (EmpathyLogSearchHit);
hit->chat_id = g_strdup (name);
hit->is_chatroom = is_chatroom;