From c552afb51d9e4c07f4b99729d15ec2cd1c7242bb Mon Sep 17 00:00:00 2001 From: Cosimo Alfarano Date: Fri, 19 Feb 2010 19:46:20 +0000 Subject: Fix chat_id conversion when chat_id is 1-1 conversation from a chatroom In other words: avoid that 1-1 conversation generated from a chatroom, having id similar to room@conference.domain/My_Alias (in XMPP) are threated as a directory path, creating My_Alias as a subdirectory of room@conference.domain --- telepathy-logger/log-store-empathy.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/telepathy-logger/log-store-empathy.c b/telepathy-logger/log-store-empathy.c index 62b0946..74ecfe1 100644 --- a/telepathy-logger/log-store-empathy.c +++ b/telepathy-logger/log-store-empathy.c @@ -379,11 +379,18 @@ log_store_empathy_get_filename (TplLogStore *self, gchar *chatid_dir; gchar *timestamp; gchar *filename; + gchar *esc_chat_id; - chatid_dir = log_store_empathy_get_dir (self, account, chat_id, chatroom); + /* avoid that 1-1 conversation generated from a chatroom, having id similar + * to room@conference.domain/My_Alias (in XMPP) are threated as a directory + * path, creating My_Alias as a subdirectory of room@conference.domain */ + esc_chat_id = g_strdelimit (g_strdup (chat_id), "/", '_'); + chatid_dir = log_store_empathy_get_dir (self, account, esc_chat_id, + chatroom); timestamp = log_store_empathy_get_timestamp_filename (); filename = g_build_filename (chatid_dir, timestamp, NULL); + g_free (esc_chat_id); g_free (chatid_dir); g_free (timestamp); -- cgit v1.2.1