mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-23 02:06:21 +00:00
Added /roster show|hide command, only show roster on connect success
This commit is contained in:
@@ -941,6 +941,15 @@ _cons_titlebar_setting(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_cons_roster_setting(void)
|
||||
{
|
||||
if (prefs_get_boolean(PREF_ROSTER))
|
||||
cons_show("Roster (/roster) : show");
|
||||
else
|
||||
cons_show("Roster (/roster) : hide");
|
||||
}
|
||||
|
||||
static void
|
||||
_cons_show_ui_prefs(void)
|
||||
{
|
||||
@@ -955,6 +964,7 @@ _cons_show_ui_prefs(void)
|
||||
cons_mouse_setting();
|
||||
cons_statuses_setting();
|
||||
cons_occupants_setting();
|
||||
cons_roster_setting();
|
||||
cons_privileges_setting();
|
||||
cons_titlebar_setting();
|
||||
cons_presence_setting();
|
||||
@@ -1573,6 +1583,7 @@ console_init_module(void)
|
||||
cons_splash_setting = _cons_splash_setting;
|
||||
cons_autoconnect_setting = _cons_autoconnect_setting;
|
||||
cons_occupants_setting = _cons_occupants_setting;
|
||||
cons_roster_setting = _cons_roster_setting;
|
||||
cons_vercheck_setting = _cons_vercheck_setting;
|
||||
cons_mouse_setting = _cons_mouse_setting;
|
||||
cons_statuses_setting = _cons_statuses_setting;
|
||||
|
||||
@@ -2985,6 +2985,25 @@ _ui_room_hide_occupants(const char * const room)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_ui_show_roster(void)
|
||||
{
|
||||
ProfWin *window = wins_get_console();
|
||||
if (window && !window->subwin) {
|
||||
wins_show_subwin(window);
|
||||
ui_roster();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_ui_hide_roster(void)
|
||||
{
|
||||
ProfWin *window = wins_get_console();
|
||||
if (window && window->subwin) {
|
||||
wins_hide_subwin(window);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_win_handle_switch(const wint_t * const ch)
|
||||
{
|
||||
@@ -3291,6 +3310,8 @@ ui_init_module(void)
|
||||
ui_roster = _ui_roster;
|
||||
ui_room_show_occupants = _ui_room_show_occupants;
|
||||
ui_room_hide_occupants = _ui_room_hide_occupants;
|
||||
ui_show_roster = _ui_show_roster;
|
||||
ui_hide_roster = _ui_hide_roster;
|
||||
ui_room_role_change = _ui_room_role_change;
|
||||
ui_room_affiliation_change = _ui_room_affiliation_change;
|
||||
ui_switch_to_room = _ui_switch_to_room;
|
||||
|
||||
@@ -175,6 +175,8 @@ void (*ui_room_member_presence)(const char * const room,
|
||||
const char * const nick, const char * const show, const char * const status);
|
||||
void (*ui_room_show_occupants)(const char * const room);
|
||||
void (*ui_room_hide_occupants)(const char * const room);
|
||||
void (*ui_show_roster)(void);
|
||||
void (*ui_hide_roster)(void);
|
||||
void (*ui_roster_add)(const char * const barejid, const char * const name);
|
||||
void (*ui_roster_remove)(const char * const barejid);
|
||||
void (*ui_contact_already_in_group)(const char * const contact, const char * const group);
|
||||
@@ -298,6 +300,7 @@ void (*cons_flash_setting)(void);
|
||||
void (*cons_splash_setting)(void);
|
||||
void (*cons_vercheck_setting)(void);
|
||||
void (*cons_occupants_setting)(void);
|
||||
void (*cons_roster_setting)(void);
|
||||
void (*cons_presence_setting)(void);
|
||||
void (*cons_wrap_setting)(void);
|
||||
void (*cons_mouse_setting)(void);
|
||||
|
||||
@@ -71,7 +71,7 @@ win_create(const char * const title, win_type_t type)
|
||||
new_win->from = strdup(title);
|
||||
int cols = getmaxx(stdscr);
|
||||
|
||||
if ((type == WIN_MUC && prefs_get_boolean(PREF_OCCUPANTS)) || (type == WIN_CONSOLE)) {
|
||||
if (type == WIN_MUC && prefs_get_boolean(PREF_OCCUPANTS)) {
|
||||
int main_cols = win_main_width();
|
||||
new_win->win = newpad(PAD_SIZE, main_cols);
|
||||
wbkgd(new_win->win, COLOUR_TEXT);
|
||||
|
||||
Reference in New Issue
Block a user