Added /room <role> command

This commit is contained in:
James Booth
2014-10-01 00:27:25 +01:00
parent 76d2b9e9b5
commit 5879f497ad
6 changed files with 100 additions and 1 deletions

View File

@@ -2063,6 +2063,9 @@ cmd_room(gchar **args, struct cmd_help_t help)
if ((g_strcmp0(args[0], "accept") != 0) &&
(g_strcmp0(args[0], "destroy") != 0) &&
(g_strcmp0(args[0], "config") != 0) &&
(g_strcmp0(args[0], "moderators") != 0) &&
(g_strcmp0(args[0], "participants") != 0) &&
(g_strcmp0(args[0], "visitors") != 0) &&
(g_strcmp0(args[0], "info") != 0)) {
cons_show("Usage: %s", help.usage);
return TRUE;
@@ -2082,6 +2085,21 @@ cmd_room(gchar **args, struct cmd_help_t help)
return TRUE;
}
if (g_strcmp0(args[0], "moderators") == 0) {
ui_show_room_role_list(window, room, MUC_ROLE_MODERATOR);
return TRUE;
}
if (g_strcmp0(args[0], "participants") == 0) {
ui_show_room_role_list(window, room, MUC_ROLE_PARTICIPANT);
return TRUE;
}
if (g_strcmp0(args[0], "visitors") == 0) {
ui_show_room_role_list(window, room, MUC_ROLE_VISITOR);
return TRUE;
}
if (g_strcmp0(args[0], "accept") == 0) {
gboolean requires_config = muc_requires_config(room);
if (!requires_config) {