From 13af6c96dcc8c81fe8092d23d4adaf4f0c45ad6c Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Tue, 25 Jul 2023 20:10:09 +0200 Subject: [PATCH] Link from /privacy to relevant /account settings Related to https://github.com/profanity-im/profanity/issues/1836 --- src/command/cmd_defs.c | 5 ++++- src/ui/console.c | 26 +++++++++++++++++++++----- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index f7e42275..711c0588 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -2720,7 +2720,10 @@ static const struct cmd_t command_defs[] = { "/privacy logging on|redact|off", "/privacy os on|off") CMD_DESC( - "Configure privacy settings.") + "Configure privacy settings." + "Also check the the following settings in /account: " + "clientid to set the client identification name" + "session_alarm to configure an alarm when more clients log in.") CMD_ARGS( { "logging on|redact|off", "Switch chat logging. This will also disable logging in the internally used SQL database. Your messages will not be saved anywhere locally. This might have unintended consequences, such as not being able to decrypt OMEMO encrypted messages received later via MAM, and should be used with caution." }, { "os on|off", "Choose whether to include the OS name if a user asks for software information (XEP-0092)." } diff --git a/src/ui/console.c b/src/ui/console.c index dd7ef84f..079ae8ca 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -2934,17 +2934,17 @@ cons_strophe_setting(void) void cons_privacy_setting(void) { - cons_show("Database logging : %s", prefs_get_string(PREF_DBLOG)); + cons_show("Database logging : %s", prefs_get_string(PREF_DBLOG)); if (prefs_get_boolean(PREF_CHLOG)) { - cons_show("Chat logging (/logging chat) : ON"); + cons_show("Chat logging (/logging chat) : ON"); } else { - cons_show("Chat logging (/logging chat) : OFF"); + cons_show("Chat logging (/logging chat) : OFF"); } if (prefs_get_boolean(PREF_HISTORY)) { - cons_show("Chat history (/history) : ON"); + cons_show("Chat history (/history) : ON"); } else { - cons_show("Chat history (/history) : OFF"); + cons_show("Chat history (/history) : OFF"); } if (prefs_get_boolean(PREF_REVEAL_OS)) { @@ -2952,4 +2952,20 @@ cons_privacy_setting(void) } else { cons_show("Reveal OS name when asked for software version (XEP-0092) (/privacy os) : OFF"); } + + if (connection_get_status() == JABBER_CONNECTED) { + char* account_name = session_get_account_name(); + ProfAccount* account = accounts_get_account(account_name); + + if (account->client) { + cons_show("Client name (/account set clientid) : %s", account->client); + } else { + cons_show("Client name (/account set clientid) : (default)"); + } + if (account->max_sessions > 0) { + cons_show("Max sessions alarm (/account set session_alarm) : %s", account->max_sessions); + } else { + cons_show("Max sessions alarm (/account set session_alarm) : not set"); + } + } }