]> git.0d.be Git - empathy.git/commitdiff
Make the dir names for the logs look nicer
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Sun, 23 Aug 2009 20:26:17 +0000 (21:26 +0100)
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>
Sun, 23 Aug 2009 22:18:48 +0000 (23:18 +0100)
libempathy/empathy-log-store-empathy.c

index 81cbcade763f8fad492aa0962fb8ec86da6496dd..fe1afd9b0e29f0ab7b71b34436c78b0be9c83667 100644 (file)
@@ -37,6 +37,7 @@
 #define G_DISABLE_DEPRECATED
 
 #include <telepathy-glib/util.h>
 #define G_DISABLE_DEPRECATED
 
 #include <telepathy-glib/util.h>
+#include <telepathy-glib/defs.h>
 
 #include "empathy-log-store.h"
 #include "empathy-log-store-empathy.h"
 
 #include "empathy-log-store.h"
 #include "empathy-log-store-empathy.h"
@@ -122,15 +123,16 @@ log_store_empathy_get_dir (EmpathyLogStore *self,
 {
   gchar *basedir;
   gchar *escaped;
 {
   gchar *basedir;
   gchar *escaped;
+  const gchar *name;
   EmpathyLogStoreEmpathyPriv *priv;
 
   priv = GET_PRIV (self);
 
   EmpathyLogStoreEmpathyPriv *priv;
 
   priv = GET_PRIV (self);
 
-  /* unique name is an object path, ignore the initial / and replace the others
-   * by % */
-  escaped = g_strdup (empathy_account_get_unique_name (account) + 1);
+  name = empathy_account_get_unique_name (account);
+  if (g_str_has_prefix (name, TP_ACCOUNT_OBJECT_PATH_BASE))
+    name += strlen (TP_ACCOUNT_OBJECT_PATH_BASE);
 
 
-  g_strdelimit (escaped, "/", '%');
+  escaped = g_strdelimit (g_strdup (name), "/", '_');
 
   if (chatroom)
     basedir = g_build_path (G_DIR_SEPARATOR_S, priv->basedir, escaped,
 
   if (chatroom)
     basedir = g_build_path (G_DIR_SEPARATOR_S, priv->basedir, escaped,