mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-22 13:16:21 +00:00
Added /occupants commands, unfinished
This commit is contained in:
@@ -2326,6 +2326,35 @@ cmd_room(gchar **args, struct cmd_help_t help)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
cmd_occupants(gchar **args, struct cmd_help_t help)
|
||||
{
|
||||
jabber_conn_status_t conn_status = jabber_get_connection_status();
|
||||
|
||||
if (conn_status != JABBER_CONNECTED) {
|
||||
cons_show("You are not currently connected.");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
win_type_t win_type = ui_current_win_type();
|
||||
if (win_type != WIN_MUC) {
|
||||
cons_show("Command '/occupants' does not apply to this window.");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
char *room = ui_current_recipient();
|
||||
|
||||
if (g_strcmp0(args[0], "show") == 0) {
|
||||
ui_room_show_occupants(room);
|
||||
} else if (g_strcmp0(args[0], "hide") == 0) {
|
||||
ui_room_hide_occupants(room);
|
||||
} else {
|
||||
cons_show("Usage: %s", help.usage);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
cmd_rooms(gchar **args, struct cmd_help_t help)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user