mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-25 01:46:20 +00:00
XEP-0092: Add configuration option to choose whether to send OS name
`/os on|off` now let's one choose whether to include the OS name once `/software` (XEP-0092) is ran on us.
This commit is contained in:
@@ -1508,7 +1508,7 @@ _cmd_ac_complete_params(ProfWin *window, const char *const input, gboolean previ
|
|||||||
|
|
||||||
// autocomplete boolean settings
|
// autocomplete boolean settings
|
||||||
gchar *boolean_choices[] = { "/beep", "/intype", "/states", "/outtype", "/flash", "/splash",
|
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++) {
|
for (i = 0; i < ARRAY_SIZE(boolean_choices); i++) {
|
||||||
result = autocomplete_param_with_func(input, boolean_choices[i], prefs_autocomplete_boolean_choice, previous);
|
result = autocomplete_param_with_func(input, boolean_choices[i], prefs_autocomplete_boolean_choice, previous);
|
||||||
|
|||||||
@@ -2344,6 +2344,21 @@ static struct cmd_t command_defs[] =
|
|||||||
{ "<barejid>", "JID to download avatar from."})
|
{ "<barejid>", "JID to download avatar from."})
|
||||||
CMD_NOEXAMPLES
|
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;
|
static GHashTable *search_index;
|
||||||
|
|||||||
@@ -8640,3 +8640,11 @@ cmd_avatar(ProfWin *window, const char *const command, gchar **args)
|
|||||||
|
|
||||||
return TRUE;
|
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;
|
||||||
|
}
|
||||||
|
|||||||
@@ -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_paste(ProfWin *window, const char *const command, gchar **args);
|
||||||
gboolean cmd_color(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_avatar(ProfWin *window, const char *const command, gchar **args);
|
||||||
|
gboolean cmd_os(ProfWin *window, const char *const command, gchar **args);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -2011,6 +2011,16 @@ cons_color_setting(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
cons_os_setting(void)
|
||||||
|
{
|
||||||
|
if (prefs_get_boolean(PREF_REVEAL_OS)) {
|
||||||
|
cons_show("Reveal OS name when asked for software version (XEP-0092) (/os) : ON");
|
||||||
|
} else {
|
||||||
|
cons_show("Reveal OS name when asked for software version (XEP-0092) (/os) : OFF");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cons_show_connection_prefs(void)
|
cons_show_connection_prefs(void)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -318,6 +318,7 @@ void cons_inpblock_setting(void);
|
|||||||
void cons_statusbar_setting(void);
|
void cons_statusbar_setting(void);
|
||||||
void cons_winpos_setting(void);
|
void cons_winpos_setting(void);
|
||||||
void cons_color_setting(void);
|
void cons_color_setting(void);
|
||||||
|
void cons_os_setting(void);
|
||||||
void cons_show_contact_online(PContact contact, Resource *resource, GDateTime *last_activity);
|
void cons_show_contact_online(PContact contact, Resource *resource, GDateTime *last_activity);
|
||||||
void cons_show_contact_offline(PContact contact, char *resource, char *status);
|
void cons_show_contact_offline(PContact contact, char *resource, char *status);
|
||||||
void cons_theme_properties(void);
|
void cons_theme_properties(void);
|
||||||
|
|||||||
Reference in New Issue
Block a user