comparison mcabber/src/screen.c @ 709:5aa66101807b

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.
author Mikael Berthe <mikael@lilotux.net>
date Tue, 21 Feb 2006 23:47:29 +0100
parents ed326697e4ed
children 75dde88f1884
comparison
equal deleted inserted replaced
708:ed326697e4ed 709:5aa66101807b
865 roster_hidden = TRUE; 865 roster_hidden = TRUE;
866 else 866 else
867 roster_hidden = !roster_hidden; 867 roster_hidden = !roster_hidden;
868 868
869 if (roster_hidden != old_roster_status) { 869 if (roster_hidden != old_roster_status) {
870 if (roster_hidden) {
871 // The requested status is hidden.
872 // Let's check it makes sense...
873 if ((!current_buddy) ||
874 ((buddy_gettype(BUDDATA(current_buddy)) &
875 (ROSTER_TYPE_USER|ROSTER_TYPE_ROOM|ROSTER_TYPE_AGENT)) == 0)) {
876 // We should not hide the roster.
877 roster_hidden = FALSE;
878 return; // No need to refresh, a priori.
879 }
880 // Enter chat mode
881 scr_set_chatmode(TRUE);
882 scr_ShowBuddyWindow();
883 }
870 // Recalculate windows size and redraw 884 // Recalculate windows size and redraw
871 scr_Resize(); 885 scr_Resize();
872 redrawwin(stdscr); 886 redrawwin(stdscr);
873 } 887 }
874 } 888 }
964 * buddy_getstatus() call. 978 * buddy_getstatus() call.
965 */ 979 */
966 980
967 if (!current_buddy || !newbuddy) return; 981 if (!current_buddy || !newbuddy) return;
968 if (newbuddy == current_buddy) return; 982 if (newbuddy == current_buddy) return;
983
984 // We're changing the selected buddy, the roster must be displayed.
985 scr_RosterVisibility(1);
969 986
970 prev_st = buddy_getstatus(BUDDATA(current_buddy), NULL); 987 prev_st = buddy_getstatus(BUDDATA(current_buddy), NULL);
971 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, FALSE); 988 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, FALSE);
972 if (chatmode) 989 if (chatmode)
973 alternate_buddy = current_buddy; 990 alternate_buddy = current_buddy;
1819 scr_CheckAutoAway(TRUE); 1836 scr_CheckAutoAway(TRUE);
1820 currentWindow = NULL; 1837 currentWindow = NULL;
1821 chatmode = FALSE; 1838 chatmode = FALSE;
1822 if (current_buddy) 1839 if (current_buddy)
1823 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, FALSE); 1840 buddy_setflags(BUDDATA(current_buddy), ROSTER_FLAG_LOCK, FALSE);
1841 scr_RosterVisibility(1);
1824 top_panel(chatPanel); 1842 top_panel(chatPanel);
1825 top_panel(inputPanel); 1843 top_panel(inputPanel);
1826 update_panels(); 1844 update_panels();
1827 break; 1845 break;
1828 case 12: // Ctrl-l 1846 case 12: // Ctrl-l