Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/screen.c @ 1142:0e27177882c7
Small fix for the max_history_blocks option
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Tue, 06 Feb 2007 07:37:20 +0100 |
parents | 5be2408a6534 |
children | f746d91c5d3b |
comparison
equal
deleted
inserted
replaced
1141:5be2408a6534 | 1142:0e27177882c7 |
---|---|
658 { | 658 { |
659 winbuf *win_entry; | 659 winbuf *win_entry; |
660 char *text_locale; | 660 char *text_locale; |
661 int dont_show = FALSE; | 661 int dont_show = FALSE; |
662 int special; | 662 int special; |
663 guint num_history_blocks; | |
663 bool setmsgflg = FALSE; | 664 bool setmsgflg = FALSE; |
664 | 665 |
665 // Look for the window entry. | 666 // Look for the window entry. |
666 special = (winId == NULL); | 667 special = (winId == NULL); |
667 win_entry = scr_SearchWindow(winId, special); | 668 win_entry = scr_SearchWindow(winId, special); |
687 | 688 |
688 // The message must be displayed -> update top pointer | 689 // The message must be displayed -> update top pointer |
689 if (win_entry->cleared) | 690 if (win_entry->cleared) |
690 win_entry->top = g_list_last(win_entry->hbuf); | 691 win_entry->top = g_list_last(win_entry->hbuf); |
691 | 692 |
693 // Make sure we do not free the buffer while it's locked or when | |
694 // top is set. | |
695 if (win_entry->lock || win_entry->top) | |
696 num_history_blocks = 0U; | |
697 else | |
698 num_history_blocks = get_max_history_blocks(); | |
699 | |
692 text_locale = from_utf8(text); | 700 text_locale = from_utf8(text); |
693 hbuf_add_line(&win_entry->hbuf, text_locale, timestamp, prefix_flags, | 701 hbuf_add_line(&win_entry->hbuf, text_locale, timestamp, prefix_flags, |
694 maxX - Roster_Width - PREFIX_WIDTH, | 702 maxX - Roster_Width - PREFIX_WIDTH, num_history_blocks); |
695 get_max_history_blocks()); | |
696 g_free(text_locale); | 703 g_free(text_locale); |
697 | 704 |
698 if (win_entry->cleared) { | 705 if (win_entry->cleared) { |
699 win_entry->cleared = FALSE; | 706 win_entry->cleared = FALSE; |
700 if (g_list_next(win_entry->top)) | 707 if (g_list_next(win_entry->top)) |