about summary refs log tree commit diff stats
path: root/src/command/cmd_defs.c
diff options
context:
space:
mode:
authorJohn Hernandez <129467592+H3rnand3zzz@users.noreply.github.com>2023-04-13 17:16:24 +0200
committerJohn Hernandez <129467592+H3rnand3zzz@users.noreply.github.com>2023-04-18 14:28:20 +0200
commit07cc19ce10dcf1cbbdca4797540d4f2bea74b724 (patch)
treec82ade1b904636717a352b809652523b56bdacb6 /src/command/cmd_defs.c
parent9bce23e075e4ec4ad7c888688226c7136d5f9257 (diff)
downloadprofani-tty-07cc19ce10dcf1cbbdca4797540d4f2bea74b724.tar.gz
Add sessions_alarm
Introduce new feature: sessions_alarm.

Added new account setting: max_connections. On exceeding this number,
user will get an alert. If number is less than 1, no alert will happen.

Tests altered to fit new feature.
Diffstat (limited to 'src/command/cmd_defs.c')
-rw-r--r--src/command/cmd_defs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c
index fe993e39..0dd7f10a 100644
--- a/src/command/cmd_defs.c
+++ b/src/command/cmd_defs.c
@@ -2070,6 +2070,7 @@ static const struct cmd_t command_defs[] = {
               "/account set <account> tls force|allow|trust|legacy|disable",
               "/account set <account> auth default|legacy",
               "/account set <account> theme <theme>",
+              "/account set <account> session_alarm <max_sessions>",
               "/account clear <account> password",
               "/account clear <account> eval_password",
               "/account clear <account> server",
@@ -2079,7 +2080,8 @@ static const struct cmd_t command_defs[] = {
               "/account clear <account> startscript",
               "/account clear <account> clientid",
               "/account clear <account> muc",
-              "/account clear <account> resource")
+              "/account clear <account> resource",
+              "/account clear <account> session_alarm")
       CMD_DESC(
               "Commands for creating and managing accounts. "
               "Calling with no arguments will display information for the current account.")
@@ -2116,6 +2118,7 @@ static const struct cmd_t command_defs[] = {
               { "set <account> auth default", "Use default authentication process." },
               { "set <account> auth legacy", "Allow legacy authentication." },
               { "set <account> theme <theme>", "Set the UI theme for the account." },
+              { "set <account> session_alarm <max_sessions>", "Alarm about suspicious activity if sessions count exceeds max_sessions." },
               { "clear <account> server", "Remove the server setting for this account." },
               { "clear <account> port", "Remove the port setting for this account." },
               { "clear <account> password", "Remove the password setting for this account." },
@@ -2126,7 +2129,8 @@ static const struct cmd_t command_defs[] = {
               { "clear <account> clientid", "Reset client's name to default." },
               { "clear <account> theme", "Clear the theme setting for the account, the global theme will be used." },
               { "clear <account> resource", "Remove the resource setting for this account." },
-              { "clear <account> muc", "Remove the default MUC service setting." })
+              { "clear <account> muc", "Remove the default MUC service setting." },
+              { "clear <account> session_alarm", "Disable the session alarm." })
       CMD_EXAMPLES(
               "/account add me",
               "/account set me jid ulfhednar@valhalla.edda",