aboutsummaryrefslogtreecommitdiffstats
path: root/src/command
diff options
context:
space:
mode:
Diffstat (limited to 'src/command')
-rw-r--r--src/command/cmd_ac.c2
-rw-r--r--src/command/cmd_defs.c15
-rw-r--r--src/command/cmd_funcs.c8
-rw-r--r--src/command/cmd_funcs.h1
4 files changed, 25 insertions, 1 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c
index db885ceb..0ee9af9f 100644
--- a/src/command/cmd_ac.c
+++ b/src/command/cmd_ac.c
@@ -1508,7 +1508,7 @@ _cmd_ac_complete_params(ProfWin *window, const char *const input, gboolean previ
// autocomplete boolean settings
gchar *boolean_choices[] = { "/beep", "/intype", "/states", "/outtype", "/flash", "/splash",
- "/history", "/vercheck", "/privileges", "/wrap", "/carbons", "/lastactivity"};
+ "/history", "/vercheck", "/privileges", "/wrap", "/carbons", "/lastactivity", "/os"};
for (i = 0; i < ARRAY_SIZE(boolean_choices); i++) {
result = autocomplete_param_with_func(input, boolean_choices[i], prefs_autocomplete_boolean_choice, previous);
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c
index 16cf5c7f..b1ba363f 100644
--- a/src/command/cmd_defs.c
+++ b/src/command/cmd_defs.c
@@ -2344,6 +2344,21 @@ static struct cmd_t command_defs[] =
{ "<barejid>", "JID to download avatar from."})
CMD_NOEXAMPLES
},
+
+ { "/os",
+ parse_args, 1, 1, &cons_os_setting,
+ CMD_NOSUBFUNCS
+ CMD_MAINFUNC(cmd_os)
+ CMD_TAGS(
+ CMD_TAG_DISCOVERY)
+ CMD_SYN(
+ "/os <on>|<off>")
+ CMD_DESC(
+ "Choose whether to include the OS name if a user asks for software information (XEP-0092).")
+ CMD_ARGS(
+ { "on|off", ""})
+ CMD_NOEXAMPLES
+ },
};
static GHashTable *search_index;
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index d9fc0ed6..a0d40cdd 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -8640,3 +8640,11 @@ cmd_avatar(ProfWin *window, const char *const command, gchar **args)
return TRUE;
}
+
+gboolean
+cmd_os(ProfWin *window, const char *const command, gchar **args)
+{
+ _cmd_set_boolean_preference(args[0], command, "Revealing OS name", PREF_REVEAL_OS);
+
+ return TRUE;
+}
diff --git a/src/command/cmd_funcs.h b/src/command/cmd_funcs.h
index 74cab615..a743951f 100644
--- a/src/command/cmd_funcs.h
+++ b/src/command/cmd_funcs.h
@@ -226,4 +226,5 @@ gboolean cmd_reload(ProfWin *window, const char *const command, gchar **args);
gboolean cmd_paste(ProfWin *window, const char *const command, gchar **args);
gboolean cmd_color(ProfWin *window, const char *const command, gchar **args);
gboolean cmd_avatar(ProfWin *window, const char *const command, gchar **args);
+gboolean cmd_os(ProfWin *window, const char *const command, gchar **args);
#endif