changeset 724:264375fe7159

Fix a roster refresh issue Calling scr_UpdateChatStatus() after clearing the roster window was causing an unneeded screen update.
author Mikael Berthe <mikael@lilotux.net>
date Sun, 05 Mar 2006 16:54:01 +0100
parents 23068490d063
children 1aff92625bdb
files mcabber/src/jabglue.c mcabber/src/screen.c mcabber/src/screen.h
diffstat 3 files changed, 17 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- 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,
--- 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();
--- 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);