# HG changeset patch # User Mikael Berthe # Date 1140562049 -3600 # Node ID 5aa66101807bb55583d45cbd7bdad2c3304498d0 # Parent ed326697e4eddce1036e7a02b319eaccaff4a5b2 Leave full-width mode automatically under some conditions Leave full-width mode when leaving chat mode and when changing the selected buddy. Enter chat mode when hiding the roster. diff -r ed326697e4ed -r 5aa66101807b mcabber/src/screen.c --- a/mcabber/src/screen.c Tue Feb 21 23:05:08 2006 +0100 +++ b/mcabber/src/screen.c Tue Feb 21 23:47:29 2006 +0100 @@ -867,6 +867,20 @@ roster_hidden = !roster_hidden; if (roster_hidden != old_roster_status) { + if (roster_hidden) { + // The requested status is hidden. + // Let's check it makes sense... + if ((!current_buddy) || + ((buddy_gettype(BUDDATA(current_buddy)) & + (ROSTER_TYPE_USER|ROSTER_TYPE_ROOM|ROSTER_TYPE_AGENT)) == 0)) { + // We should not hide the roster. + roster_hidden = FALSE; + return; // No need to refresh, a priori. + } + // Enter chat mode + scr_set_chatmode(TRUE); + scr_ShowBuddyWindow(); + } // Recalculate windows size and redraw scr_Resize(); redrawwin(stdscr); @@ -967,6 +981,9 @@ if (!current_buddy || !newbuddy) return; if (newbuddy == current_buddy) return; + // We're changing the selected buddy, the roster must be displayed. + scr_RosterVisibility(1); + prev_st = buddy_getstatus(BUDDATA(current_buddy), NULL); buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, FALSE); if (chatmode) @@ -1821,6 +1838,7 @@ chatmode = FALSE; if (current_buddy) buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, FALSE); + scr_RosterVisibility(1); top_panel(chatPanel); top_panel(inputPanel); update_panels();