# HG changeset patch # User Mikael Berthe # Date 1171580180 -3600 # Node ID 14f5876b5555a05ff143cebe8804981aae3c40c1 # Parent 53c0c5be43fa6d20b354ea5a42004d03ac76d56e Slight optimization + line wrapping diff -r 53c0c5be43fa -r 14f5876b5555 mcabber/src/screen.c --- a/mcabber/src/screen.c Thu Feb 15 23:20:24 2007 +0100 +++ b/mcabber/src/screen.c Thu Feb 15 23:56:20 2007 +0100 @@ -465,10 +465,10 @@ char *id; id = hlog_get_log_jid(title); if (id) { - if(scr_BuddyBufferExists(id)) - tmp->bd=(scr_SearchWindow(id, FALSE))->bd; - else - tmp->bd=(scr_new_buddy(id, TRUE))->bd; + winbuf *wb = scr_SearchWindow(id, FALSE); + if (!wb) + wb = scr_new_buddy(id, TRUE); + tmp->bd=wb->bd; g_free(id); } else { // Load buddy history from file (if enabled) tmp->bd = g_new0(buffdata, 1); @@ -503,13 +503,13 @@ return; } - // win_entry->bd->top is the top message of the screen. If it set to NULL, we - // are displaying the last messages. + // win_entry->bd->top is the top message of the screen. If it set to NULL, + // we are displaying the last messages. // We will show the last CHAT_WIN_HEIGHT lines. // Let's find out where it begins. - if (!win_entry->bd->top || - (g_list_position(g_list_first(win_entry->bd->hbuf), win_entry->bd->top) == -1)) { + if (!win_entry->bd->top || (g_list_position(g_list_first(win_entry->bd->hbuf), + win_entry->bd->top) == -1)) { // Move up CHAT_WIN_HEIGHT lines win_entry->bd->hbuf = g_list_last(win_entry->bd->hbuf); hbuf_head = win_entry->bd->hbuf;