mirror of
https://github.com/irssi/irssi.git
synced 2024-10-27 05:20:20 -04:00
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
This commit is contained in:
parent
9f7f4395bf
commit
ba4b59d134
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user