diff --git a/TODO_ROLES b/TODO_ROLES new file mode 100644 index 00000000..7a448555 --- /dev/null +++ b/TODO_ROLES @@ -0,0 +1,6 @@ +Handle status codes +List members of different roles/affiliations +Changing subject +Moderator use cases +Admin use cases +Owner use cases diff --git a/src/command/commands.c b/src/command/commands.c index 65759c0a..4a3cdd43 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -2078,12 +2078,7 @@ cmd_room(gchar **args, struct cmd_help_t help) } if (g_strcmp0(args[0], "info") == 0) { - char *role = muc_role_str(room); - char *affiliation = muc_affiliation_str(room); - win_save_print(window, '-', NULL, 0, 0, "", ""); - win_save_vprint(window, '!', NULL, 0, 0, "", "Affiliation: %s", affiliation); - win_save_vprint(window, '!', NULL, 0, 0, "", "Role: %s", role); - win_save_print(window, '-', NULL, 0, 0, "", ""); + ui_show_room_info(window, room); return TRUE; } diff --git a/src/ui/core.c b/src/ui/core.c index 500e435b..7c6d24cb 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -1886,6 +1886,19 @@ _ui_draw_term_title(void) } } +static void +_ui_show_room_info(ProfWin *window, const char * const room) +{ + char *role = muc_role_str(room); + char *affiliation = muc_affiliation_str(room); + + win_save_print(window, '-', NULL, 0, 0, "", ""); + win_save_vprint(window, '!', NULL, 0, 0, "", "Room: %s", room); + win_save_vprint(window, '!', NULL, 0, 0, "", " Affiliation: %s", affiliation); + win_save_vprint(window, '!', NULL, 0, 0, "", " Role: %s", role); + win_save_print(window, '-', NULL, 0, 0, "", ""); +} + static void _ui_handle_form_field(ProfWin *window, char *tag, FormField *field) { @@ -2513,4 +2526,5 @@ ui_init_module(void) ui_show_form_field_help = _ui_show_form_field_help; ui_show_lines = _ui_show_lines; ui_handle_room_configuration_form_error = _ui_handle_room_configuration_form_error; + ui_show_room_info = _ui_show_room_info; } diff --git a/src/ui/ui.h b/src/ui/ui.h index d71a78c1..85649c0e 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -137,6 +137,7 @@ void (*ui_room_subject)(const char * const room_jid, const char * const subject); void (*ui_room_requires_config)(const char * const room_jid); void (*ui_room_destroyed)(const char * const room_jid); +void (*ui_show_room_info)(ProfWin *window, const char * const room); void (*ui_room_broadcast)(const char * const room_jid, const char * const message); void (*ui_room_member_offline)(const char * const room, const char * const nick);