From 6a6fb6af2710922da0148d3154703302f88dd539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Thu, 8 Nov 2018 11:58:44 +0100 Subject: [PATCH] conversation: Reverse messages in each log While b7360ff112a84437c3b68072c5bbe1388fc00c67 took care of not discarding new messges the reversion of the list resulted in reversed entries for each log file (so the overall history was in the correct order but each converstion was reversed). We go this way around instead of using g_list_append() since the later is slower. Fix that by going through each log back to front. --- src/chatty-conversation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chatty-conversation.c b/src/chatty-conversation.c index d32577e4..9db6742d 100644 --- a/src/chatty-conversation.c +++ b/src/chatty-conversation.c @@ -570,7 +570,7 @@ chatty_add_message_history_to_conv (gpointer data) logs = g_strsplit (stripped, "\n", -1); - for (int num = 0; num < (g_strv_length (logs) - 1); num++) { + for (int num = g_strv_length (logs) - 1; num >= 0; num--) { log_data = parse_message (logs[num]); if (log_data) { -- GitLab