Store room affiliation and role
This commit is contained in:
@@ -307,12 +307,13 @@ static struct cmd_t command_defs[] =
|
||||
|
||||
{ "/room",
|
||||
cmd_room, parse_args, 1, 1, NULL,
|
||||
{ "/room accept|destroy|config", "Room configuration.",
|
||||
{ "/room accept|destroy|config",
|
||||
"---------------------------",
|
||||
{ "/room accept|destroy|config|info", "Room configuration.",
|
||||
{ "/room accept|destroy|config|info",
|
||||
"--------------------------------",
|
||||
"accept - Accept default room configuration.",
|
||||
"destroy - Reject default room configuration.",
|
||||
"config - Edit room configuration.",
|
||||
"info - Show room details.",
|
||||
NULL } } },
|
||||
|
||||
{ "/form",
|
||||
@@ -1226,6 +1227,7 @@ cmd_init(void)
|
||||
autocomplete_add(room_ac, "accept");
|
||||
autocomplete_add(room_ac, "destroy");
|
||||
autocomplete_add(room_ac, "config");
|
||||
autocomplete_add(room_ac, "info");
|
||||
|
||||
form_ac = autocomplete_new();
|
||||
autocomplete_add(form_ac, "submit");
|
||||
|
||||
@@ -2083,7 +2083,8 @@ 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], "config") != 0) &&
|
||||
(g_strcmp0(args[0], "info") != 0)) {
|
||||
cons_show("Usage: %s", help.usage);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -2097,6 +2098,13 @@ cmd_room(gchar **args, struct cmd_help_t help)
|
||||
ui_index = 0;
|
||||
}
|
||||
|
||||
if (g_strcmp0(args[0], "info") == 0) {
|
||||
char *role = muc_get_role_str(room);
|
||||
char *affiliation = muc_get_affiliation_str(room);
|
||||
ui_current_print_line("Affiliation: %s, Role: %s", affiliation, role);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (g_strcmp0(args[0], "accept") == 0) {
|
||||
gboolean requires_config = muc_requires_config(room);
|
||||
if (!requires_config) {
|
||||
|
||||
Reference in New Issue
Block a user