aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-08-24 07:22:54 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-08-24 07:22:54 +0800
commitf23c28d9775e5679fa17568cb49e296b8251e0ea (patch)
tree160c3e4501de142384f88f32f2466582aebb7e1e
parentaa0487edef4dc671e99a9e4dc6a1895c0fdaca4a (diff)
downloadgsoc2013-empathy-f23c28d9775e5679fa17568cb49e296b8251e0ea.tar
gsoc2013-empathy-f23c28d9775e5679fa17568cb49e296b8251e0ea.tar.gz
gsoc2013-empathy-f23c28d9775e5679fa17568cb49e296b8251e0ea.tar.bz2
gsoc2013-empathy-f23c28d9775e5679fa17568cb49e296b8251e0ea.tar.lz
gsoc2013-empathy-f23c28d9775e5679fa17568cb49e296b8251e0ea.tar.xz
gsoc2013-empathy-f23c28d9775e5679fa17568cb49e296b8251e0ea.tar.zst
gsoc2013-empathy-f23c28d9775e5679fa17568cb49e296b8251e0ea.zip
Have log_store_empathy_search_hit_new lookup accounts properly
-rw-r--r--libempathy/empathy-log-store-empathy.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/libempathy/empathy-log-store-empathy.c b/libempathy/empathy-log-store-empathy.c
index 723ee6434..2049fc24a 100644
--- a/libempathy/empathy-log-store-empathy.c
+++ b/libempathy/empathy-log-store-empathy.c
@@ -389,11 +389,11 @@ log_store_empathy_search_hit_new (EmpathyLogStore *self,
{
EmpathyLogStoreEmpathyPriv *priv = GET_PRIV (self);
EmpathyLogSearchHit *hit;
- gchar *unescaped;
gchar *account_name;
const gchar *end;
gchar **strv;
guint len;
+ GList *accounts, *l;
if (!g_str_has_suffix (filename, LOG_FILENAME_SUFFIX))
return NULL;
@@ -413,15 +413,25 @@ log_store_empathy_search_hit_new (EmpathyLogStore *self,
else
account_name = strv[len-3];
- unescaped = g_strdup_printf ("/%s", g_strdelimit (account_name, "%", '/'));
+ accounts = empathy_account_manager_dup_accounts(priv->account_manager);
+
+ for (l = accounts; l != NULL; l = g_list_next (l))
+ {
+ EmpathyAccount *account = EMPATHY_ACCOUNT (l->data);
+ gchar *name;
+ name = log_store_account_to_dirname (account);
+ if (!tp_strdiff (name, account_name))
+ {
+ g_assert (hit->account == NULL);
+ hit->account = account;
+ g_object_ref (account);
+ }
+ g_object_unref (account);
+ }
+ g_list_free (accounts);
- hit->account = empathy_account_manager_get_account (priv->account_manager,
- unescaped);
- if (hit->account != NULL)
- g_object_ref (hit->account);
hit->filename = g_strdup (filename);
- g_free (unescaped);
g_strfreev (strv);
return hit;