diff options
author | John Hernandez <129467592+H3rnand3zzz@users.noreply.github.com> | 2023-04-03 17:58:09 +0200 |
---|---|---|
committer | John Hernandez <129467592+H3rnand3zzz@users.noreply.github.com> | 2023-04-09 14:17:01 +0200 |
commit | 5d3c8ce7c164f74f606ff06d1adf849821591a51 (patch) | |
tree | 22163056dd27624216d91de3ab8b4053e5289a7b /src/command/cmd_funcs.c | |
parent | 6b597f6608c454e48000847bb3c0b5c2fdc4f292 (diff) | |
download | profani-tty-5d3c8ce7c164f74f606ff06d1adf849821591a51.tar.gz |
Allow setting client identification name/version manually
Add changes allowing user to switch client name and version. Useful for enhancing user privacy. Minor cleanup.
Diffstat (limited to 'src/command/cmd_funcs.c')
-rw-r--r-- | src/command/cmd_funcs.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 919b7ddb..b9ad139c 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -841,6 +841,14 @@ _account_set_startscript(char* account_name, char* script) } gboolean +_account_set_client(char* account_name, char* new_client) +{ + accounts_set_client(account_name, new_client); + cons_show("Client name for account %s has been set to %s", account_name, new_client); + return TRUE; +} + +gboolean _account_set_theme(char* account_name, char* theme) { if (!theme_exists(theme)) { @@ -981,6 +989,8 @@ cmd_account_set(ProfWin* window, const char* const command, gchar** args) return _account_set_pgpkeyid(account_name, value); if (strcmp(property, "startscript") == 0) return _account_set_startscript(account_name, value); + if (strcmp(property, "clientid") == 0) + return _account_set_client(account_name, value); if (strcmp(property, "theme") == 0) return _account_set_theme(account_name, value); if (strcmp(property, "tls") == 0) @@ -1017,48 +1027,40 @@ cmd_account_clear(ProfWin* window, const char* const command, gchar** args) if (strcmp(property, "password") == 0) { accounts_clear_password(account_name); cons_show("Removed password for account %s", account_name); - cons_show(""); } else if (strcmp(property, "eval_password") == 0) { accounts_clear_eval_password(account_name); cons_show("Removed eval password for account %s", account_name); - cons_show(""); } else if (strcmp(property, "server") == 0) { accounts_clear_server(account_name); cons_show("Removed server for account %s", account_name); - cons_show(""); } else if (strcmp(property, "port") == 0) { accounts_clear_port(account_name); cons_show("Removed port for account %s", account_name); - cons_show(""); } else if (strcmp(property, "otr") == 0) { accounts_clear_otr(account_name); cons_show("OTR policy removed for account %s", account_name); - cons_show(""); } else if (strcmp(property, "pgpkeyid") == 0) { accounts_clear_pgp_keyid(account_name); cons_show("Removed PGP key ID for account %s", account_name); - cons_show(""); } else if (strcmp(property, "startscript") == 0) { accounts_clear_script_start(account_name); cons_show("Removed start script for account %s", account_name); - cons_show(""); + } else if (strcmp(property, "clientid") == 0) { + accounts_clear_client(account_name); + cons_show("Reset client name for account %s", account_name); } else if (strcmp(property, "theme") == 0) { accounts_clear_theme(account_name); cons_show("Removed theme for account %s", account_name); - cons_show(""); } else if (strcmp(property, "muc") == 0) { accounts_clear_muc(account_name); cons_show("Removed MUC service for account %s", account_name); - cons_show(""); } else if (strcmp(property, "resource") == 0) { accounts_clear_resource(account_name); cons_show("Removed resource for account %s", account_name); - cons_show(""); } else { cons_show("Invalid property: %s", property); - cons_show(""); } - + cons_show(""); return TRUE; } |