diff options
author | Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> | 2010-02-19 19:46:20 +0000 |
---|---|---|
committer | Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> | 2010-02-22 12:45:39 +0000 |
commit | c552afb51d9e4c07f4b99729d15ec2cd1c7242bb (patch) | |
tree | 5fd113da546d13d029fcc4b4157bfbe9ea3a2771 | |
parent | afee8187bcc7728f29e20d085c32053612b3e361 (diff) | |
download | telepathy-logger-c552afb51d9e4c07f4b99729d15ec2cd1c7242bb.tar.gz |
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
-rw-r--r-- | telepathy-logger/log-store-empathy.c | 9 |
1 files changed, 8 insertions, 1 deletions
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); |