From ba4b59d134e5117e53e77c39ac2f458e03e837ad Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 6 Jan 2001 15:39:36 +0000 Subject: [PATCH] When msg list is full, remove old messages, not new messages.. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1077 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/core/chat-completion.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fe-common/core/chat-completion.c b/src/fe-common/core/chat-completion.c index 26757e14..a45623d1 100644 --- a/src/fe-common/core/chat-completion.c +++ b/src/fe-common/core/chat-completion.c @@ -87,8 +87,10 @@ static void last_msg_add(GSList **list, const char *nick, int own, int max) rec = g_new(LAST_MSG_REC, 1); rec->nick = g_strdup(nick); - if (g_slist_length(*list) == max) - *list = g_slist_remove(*list, (*list)->data); + if (g_slist_length(*list) == max) { + *list = g_slist_remove(*list, + g_slist_last(*list)->data); + } rec->own = own ? max : 0; }