about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorThorben Günther <admin@xenrox.net>2021-03-12 12:55:19 +0100
committerThorben Günther <admin@xenrox.net>2021-03-12 14:57:00 +0100
commitec6f9df48605d63f058e766a9d10567a303cb390 (patch)
tree5f91fccd02af9e876c09c9884cddf4c04048c47d /src/command
parentdbd8657759c50628da2999409661b2268a1aa161 (diff)
downloadprofani-tty-ec6f9df48605d63f058e766a9d10567a303cb390.tar.gz
MUC: Add voice request
closes https://github.com/profanity-im/profanity/issues/1211
Diffstat (limited to 'src/command')
-rw-r--r--src/command/cmd_ac.c1
-rw-r--r--src/command/cmd_defs.c6
-rw-r--r--src/command/cmd_funcs.c5
3 files changed, 10 insertions, 2 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c
index 0158a586..a2d949eb 100644
--- a/src/command/cmd_ac.c
+++ b/src/command/cmd_ac.c
@@ -755,6 +755,7 @@ cmd_ac_init(void)
 
     affiliation_cmd_ac = autocomplete_new();
     autocomplete_add(affiliation_cmd_ac, "list");
+    autocomplete_add(affiliation_cmd_ac, "request");
     autocomplete_add(affiliation_cmd_ac, "set");
 
     role_cmd_ac = autocomplete_new();
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c
index 3493b214..2974634b 100644
--- a/src/command/cmd_defs.c
+++ b/src/command/cmd_defs.c
@@ -692,13 +692,15 @@ static struct cmd_t command_defs[] = {
               CMD_TAG_GROUPCHAT)
       CMD_SYN(
               "/affiliation set <affiliation> <jid> [<reason>]",
-              "/affiliation list [<affiliation>]")
+              "/affiliation list [<affiliation>]",
+              "/affiliation request")
       CMD_DESC(
               "Manage room affiliations. "
               "Affiliation may be one of owner, admin, member, outcast or none.")
       CMD_ARGS(
               { "set <affiliation> <jid> [<reason>]", "Set the affiliation of user with jid, with an optional reason." },
-              { "list [<affiliation>]", "List all users with the specified affiliation, or all if none specified." })
+              { "list [<affiliation>]", "List all users with the specified affiliation, or all if none specified." },
+              { "request", "Request voice."})
       CMD_NOEXAMPLES
     },
 
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index 6faa64b8..657850e2 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -4161,6 +4161,11 @@ cmd_affiliation(ProfWin* window, const char* const command, gchar** args)
         }
     }
 
+    if (g_strcmp0(cmd, "request") == 0) {
+        message_request_voice(mucwin->roomjid);
+        return TRUE;
+    }
+
     cons_bad_cmd_usage(command);
     return TRUE;
 }