# HG changeset patch # User Mikael Berthe # Date 1141574041 -3600 # Node ID 264375fe7159c4d904d080142999fa481a0d9b68 # Parent 23068490d06388af23ea05edeb097c7ea05b9424 Fix a roster refresh issue Calling scr_UpdateChatStatus() after clearing the roster window was causing an unneeded screen update. diff -r 23068490d063 -r 264375fe7159 mcabber/src/jabglue.c --- a/mcabber/src/jabglue.c Sun Mar 05 11:00:24 2006 +0100 +++ b/mcabber/src/jabglue.c Sun Mar 05 16:54:01 2006 +0100 @@ -384,7 +384,7 @@ } // Update status line - scr_UpdateMainStatus(); + scr_UpdateMainStatus(TRUE); } void jb_send_msg(const char *jid, const char *text, int type, diff -r 23068490d063 -r 264375fe7159 mcabber/src/screen.c --- a/mcabber/src/screen.c Sun Mar 05 11:00:24 2006 +0100 +++ b/mcabber/src/screen.c Sun Mar 05 16:54:01 2006 +0100 @@ -532,17 +532,19 @@ // scr_UpdateMainStatus() // Redraw the main (bottom) status line. -void scr_UpdateMainStatus(void) +void scr_UpdateMainStatus(int forceupdate) { const char *sm = jb_getstatusmsg(); werase(mainstatusWnd); - mvwprintw(mainstatusWnd, 0, 0, "%c[%c] %s", + mvwprintw(mainstatusWnd, 0, 0, "%c[%c] %s", (unread_msg(NULL) ? '#' : ' '), imstatus2char[jb_getstatus()], (sm ? sm : "")); - top_panel(inputPanel); - update_panels(); - doupdate(); + if (forceupdate) { + top_panel(inputPanel); + update_panels(); + doupdate(); + } } // scr_DrawMainWindow() @@ -734,7 +736,7 @@ // Usually we need to update the bottom status line too, // at least to refresh the pending message flag. - scr_UpdateMainStatus(); + scr_UpdateMainStatus(FALSE); fullname = buddy_getname(BUDDATA(current_buddy)); btype = buddy_gettype(BUDDATA(current_buddy)); @@ -815,6 +817,11 @@ cursor_backup = curs_set(0); + if (!buddylist) + offset = 0; + else + scr_UpdateChatStatus(FALSE); + // Cleanup of roster window werase(rosterWnd); @@ -825,11 +832,6 @@ mvwaddch(rosterWnd, i, Roster_Width-1, ACS_VLINE); } - if (!buddylist) - offset = 0; - else - scr_UpdateChatStatus(FALSE); - // Leave now if buddylist is empty or the roster is hidden if (!buddylist || !Roster_Width) { update_panels(); diff -r 23068490d063 -r 264375fe7159 mcabber/src/screen.h --- a/mcabber/src/screen.h Sun Mar 05 11:00:24 2006 +0100 +++ b/mcabber/src/screen.h Sun Mar 05 16:54:01 2006 +0100 @@ -29,7 +29,7 @@ void scr_TerminateCurses(void); void scr_DrawMainWindow(unsigned int fullinit); void scr_DrawRoster(void); -void scr_UpdateMainStatus(void); +void scr_UpdateMainStatus(int forceupdate); void scr_UpdateChatStatus(int forceupdate); void scr_RosterVisibility(int status); void scr_WriteIncomingMessage(const char *jidfrom, const char *text, @@ -39,10 +39,10 @@ bool scr_BuddyBufferExists(const char *jid); inline void scr_set_chatmode(int enable); inline void scr_set_multimode(int enable); -inline int scr_get_multimode(); +inline int scr_get_multimode(void); void scr_setmsgflag_if_needed(const char *jid); void scr_append_multiline(const char *line); -inline const char *scr_get_multiline(); +inline const char *scr_get_multiline(void); inline void scr_Beep(void); int scr_Getch(void);