Allow setting client identification name/version manually

Add changes allowing user to switch client name and version.

Useful for enhancing user privacy.

Minor cleanup.
This commit is contained in:
John Hernandez
2023-04-03 17:58:09 +02:00
parent 6b597f6608
commit 5d3c8ce7c1
16 changed files with 151 additions and 86 deletions

View File

@@ -329,6 +329,11 @@ accounts_get_account(const char* const name)
startscript = g_key_file_get_string(accounts, name, "script.start", NULL);
}
gchar* client = NULL;
if (g_key_file_has_key(accounts, name, "client.name", NULL)) {
client = g_key_file_get_string(accounts, name, "client.name", NULL);
}
gchar* theme = NULL;
if (g_key_file_has_key(accounts, name, "theme", NULL)) {
theme = g_key_file_get_string(accounts, name, "theme", NULL);
@@ -348,7 +353,7 @@ accounts_get_account(const char* const name)
priority_dnd, muc_service, muc_nick, otr_policy, otr_manual,
otr_opportunistic, otr_always, omemo_policy, omemo_enabled,
omemo_disabled, ox_enabled, pgp_enabled, pgp_keyid,
startscript, theme, tls_policy, auth_policy);
startscript, theme, tls_policy, auth_policy, client);
return new_account;
}
@@ -551,6 +556,12 @@ accounts_set_script_start(const char* const account_name, const char* const valu
_accounts_set_string_option(account_name, "script.start", value);
}
void
accounts_set_client(const char* const account_name, const char* const value)
{
_accounts_set_string_option(account_name, "client.name", value);
}
void
accounts_set_theme(const char* const account_name, const char* const value)
{
@@ -593,6 +604,12 @@ accounts_clear_script_start(const char* const account_name)
_accounts_clear_string_option(account_name, "script.start");
}
void
accounts_clear_client(const char* const account_name)
{
_accounts_clear_string_option(account_name, "client.name");
}
void
accounts_clear_theme(const char* const account_name)
{