aboutsummaryrefslogtreecommitdiffstats
path: root/src/command
diff options
context:
space:
mode:
authorDebXWoody <stefan@debxwoody.de>2021-10-17 20:41:11 +0200
committerMichael Vetter <jubalh@iodoru.org>2021-12-06 13:33:21 +0100
commit2f3de0eb0da2792e6e4f0cade0acfea5af9ab370 (patch)
tree9e907c1a921a6540e95a9872f8cf8e9ef9e6dad4 /src/command
parente745b4af60bf9d504abec737babebe0a0f9c5ef8 (diff)
downloadprofani-tty-2f3de0eb0da2792e6e4f0cade0acfea5af9ab370.tar.gz
xep-0107: code review
* Remarks in the Merge Request (ac_reset, help) * Defines in iq.c * Mood help and null check * Added additional information about tab key in CMD_DESC. * Added additional null check
Diffstat (limited to 'src/command')
-rw-r--r--src/command/cmd_ac.c8
-rw-r--r--src/command/cmd_defs.c9
-rw-r--r--src/command/cmd_funcs.c13
3 files changed, 14 insertions, 16 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c
index 475d02ff..d817b2ef 100644
--- a/src/command/cmd_ac.c
+++ b/src/command/cmd_ac.c
@@ -1460,6 +1460,7 @@ cmd_ac_reset(ProfWin* window)
autocomplete_reset(executable_ac);
autocomplete_reset(intype_ac);
autocomplete_reset(mood_ac);
+ autocomplete_reset(mood_type_ac);
autocomplete_reset(script_ac);
if (script_show_ac) {
@@ -4247,17 +4248,10 @@ _mood_autocomplete(ProfWin* window, const char* const input, gboolean previous)
return result;
}
- //jabber_conn_status_t conn_status = connection_get_status();
- //if (conn_status == JABBER_CONNECTED) {
result = autocomplete_param_with_ac(input, "/mood set", mood_type_ac, FALSE, previous);
if (result) {
return result;
}
- // result = autocomplete_param_with_func(input, "/mood get", roster_barejid_autocomplete, previous, NULL);
- // if (result) {
- // return result;
- // }
- //}
return result;
}
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c
index fc4c8dca..4ceb8193 100644
--- a/src/command/cmd_defs.c
+++ b/src/command/cmd_defs.c
@@ -2688,9 +2688,12 @@ static struct cmd_t command_defs[] = {
CMD_SYN(
"/mood set <mood> [\"Text\"]")
CMD_DESC(
- "Set your mood")
- CMD_NOARGS
- CMD_NOEXAMPLES
+ "Set your mood. Use the tab key to switch through the available moods")
+ CMD_ARGS(
+ { "set <mood>", "Your mood" },
+ { "<text>", "Additional Text" })
+ CMD_EXAMPLES(
+ "/mood set happy \"I'm happy\"")
},
// NEXT-COMMAND (search helper)
};
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index 5e6b3cc2..fe5d5e45 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -9649,13 +9649,14 @@ cmd_register(ProfWin* window, const char* const command, gchar** args)
gboolean
cmd_mood(ProfWin* window, const char* const command, gchar** args)
{
-
if (g_strcmp0(args[0], "set") == 0) {
- cons_show("Your mood: %s", args[1]);
- if (args[2]) {
- publish_user_mood(args[1], args[2]);
- } else {
- publish_user_mood(args[1], args[1]);
+ if(args[1]) {
+ cons_show("Your mood: %s", args[1]);
+ if (args[2]) {
+ publish_user_mood(args[1], args[2]);
+ } else {
+ publish_user_mood(args[1], args[1]);
+ }
}
}
return TRUE;