diff --git a/src/chatty-conversation.c b/src/chatty-conversation.c index eec2d2c61a33e2635df12eda2e1d30b01f453eee..10491ea28074f1926b2a3526a0d40147d712ba3a 100644 --- a/src/chatty-conversation.c +++ b/src/chatty-conversation.c @@ -474,22 +474,23 @@ parse_message (const gchar* msg) return NULL; /* Separate the timestamp from the rest of the message */ - timesplit = g_strsplit (msg, ") ", -1); - if (timesplit[0] == NULL) + timesplit = g_strsplit (msg, ") ", 2); + /* Format is '(x:y:z' */ + if (timesplit[0] == NULL || strlen (timesplit[0]) < 6) return NULL; log = g_new0 (ChattyLog, 1); - log->time_stamp = g_strdup(timesplit[0]); + log->time_stamp = g_strdup(&(timesplit[0][1])); if (timesplit[1] == NULL) return log; - accountsplit = g_strsplit (timesplit[1], ": ", -1); + accountsplit = g_strsplit (timesplit[1], ": ", 2); if (accountsplit[0] == NULL) return log; - namesplit = g_strsplit (accountsplit[0], "/", -1); + namesplit = g_strsplit (accountsplit[0], "/", 2); log->name = g_strdup (namesplit[0]); if (accountsplit[1] == NULL) @@ -592,7 +593,7 @@ chatty_add_message_history_to_conv (gpointer data) log_data = msgs->data; if (msgs == (g_list_last (msgs))) { - time_stamp = log_data->time_stamp + 2; + time_stamp = log_data->time_stamp; } else { time_stamp = NULL; }