aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-07-16 22:39:25 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-07-16 22:39:25 +0800
commite8f72606c7fc3ff48916c27a3e8d776618fe6f93 (patch)
tree4f781bd6aae23795205545d81d9e701e9d094e41 /libempathy
parent9309c89a6ce064223dc2879d5b61baf69472a334 (diff)
downloadgsoc2013-empathy-e8f72606c7fc3ff48916c27a3e8d776618fe6f93.tar
gsoc2013-empathy-e8f72606c7fc3ff48916c27a3e8d776618fe6f93.tar.gz
gsoc2013-empathy-e8f72606c7fc3ff48916c27a3e8d776618fe6f93.tar.bz2
gsoc2013-empathy-e8f72606c7fc3ff48916c27a3e8d776618fe6f93.tar.lz
gsoc2013-empathy-e8f72606c7fc3ff48916c27a3e8d776618fe6f93.tar.xz
gsoc2013-empathy-e8f72606c7fc3ff48916c27a3e8d776618fe6f93.tar.zst
gsoc2013-empathy-e8f72606c7fc3ff48916c27a3e8d776618fe6f93.zip
Escape unique names by replacing / by %
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-log-store-empathy.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/libempathy/empathy-log-store-empathy.c b/libempathy/empathy-log-store-empathy.c
index 56dc70fa4..189bf0036 100644
--- a/libempathy/empathy-log-store-empathy.c
+++ b/libempathy/empathy-log-store-empathy.c
@@ -113,23 +113,26 @@ log_store_empathy_get_dir (EmpathyLogStore *self,
const gchar *chat_id,
gboolean chatroom)
{
- gchar *account_id;
gchar *basedir;
+ gchar *escaped;
EmpathyLogStoreEmpathyPriv *priv;
priv = GET_PRIV (self);
- account_id = tp_escape_as_identifier (
- empathy_account_get_unique_name (account));
+ /* unique name is an object path, ignore the initial / and replace the others
+ * by % */
+ escaped = g_strdup (empathy_account_get_unique_name (account) + 1);
+
+ g_strdelimit(escaped, "/", '%');
if (chatroom)
- basedir = g_build_path (G_DIR_SEPARATOR_S, priv->basedir, account_id,
+ basedir = g_build_path (G_DIR_SEPARATOR_S, priv->basedir, escaped,
LOG_DIR_CHATROOMS, chat_id, NULL);
else
basedir = g_build_path (G_DIR_SEPARATOR_S, priv->basedir,
- account_id, chat_id, NULL);
+ escaped, chat_id, NULL);
- g_free (account_id);
+ g_free (escaped);
return basedir;
}
@@ -369,7 +372,8 @@ log_store_empathy_search_hit_new (EmpathyLogStore *self,
{
EmpathyLogStoreEmpathyPriv *priv = GET_PRIV (self);
EmpathyLogSearchHit *hit;
- const gchar *account_name;
+ gchar *unescaped;
+ gchar *account_name;
const gchar *end;
gchar **strv;
guint len;
@@ -392,10 +396,13 @@ log_store_empathy_search_hit_new (EmpathyLogStore *self,
else
account_name = strv[len-3];
+ unescaped = g_strdup_printf ("/%s", g_strdelimit (account_name, "%", '/'));
+
hit->account = empathy_account_manager_lookup (priv->account_manager,
- account_name);
+ unescaped);
hit->filename = g_strdup (filename);
+ g_free (unescaped);
g_strfreev (strv);
return hit;