summaryrefslogtreecommitdiff
path: root/src/plugins/relay
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2024-03-30 17:52:43 +0100
committerSébastien Helleu <flashcode@flashtux.org>2024-04-07 13:18:10 +0200
commitfd3219246432b35f165c5d1edfa78c76a743723e (patch)
treed1f27d48cc48350874e978790b5e59d4670a0af5 /src/plugins/relay
parentc2343ecb7414587e5a0563d2f03d2255def330db (diff)
downloadweechat-fd3219246432b35f165c5d1edfa78c76a743723e.zip
relay: add option `disconnect` in command `/remote` (issue #2066)
Diffstat (limited to 'src/plugins/relay')
-rw-r--r--src/plugins/relay/relay-command.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/plugins/relay/relay-command.c b/src/plugins/relay/relay-command.c
index 0279b9b07..7b6643b3d 100644
--- a/src/plugins/relay/relay-command.c
+++ b/src/plugins/relay/relay-command.c
@@ -647,6 +647,26 @@ relay_command_remote (const void *pointer, void *data,
WEECHAT_COMMAND_ERROR;
}
+ if (weechat_strcmp (argv[1], "disconnect") == 0)
+ {
+ WEECHAT_COMMAND_MIN_ARGS(3, "disconnect");
+
+ ptr_remote = relay_remote_search (argv[2]);
+ if (!ptr_remote)
+ {
+ weechat_printf (
+ NULL,
+ _("%s%s: remote \"%s\" not found for \"%s\" command"),
+ weechat_prefix ("error"),
+ RELAY_PLUGIN_NAME,
+ argv[2],
+ "remote disconnect");
+ return WEECHAT_RC_OK;
+ }
+
+ WEECHAT_COMMAND_ERROR;
+ }
+
if (weechat_strcmp (argv[1], "del") == 0)
{
WEECHAT_COMMAND_MIN_ARGS(3, "del");
@@ -780,6 +800,7 @@ relay_command_init ()
N_("list|listfull [<name>]"
" || add <name> <url> [-<option>[=<value>]]"
" || connect <name>"
+ " || disconnect <name>"
" || rename <name> <new_name>"
" || del <name>"),
WEECHAT_CMD_ARGS_DESC(
@@ -793,6 +814,7 @@ relay_command_init ()
"or http://example.com:9000 (plain-text connection, not recommended)"),
N_("option: set option for remote: proxy, password or totp_secret"),
N_("raw[connect]: connect to a remote relay server"),
+ N_("raw[disconnect]: disconnect from a remote relay server"),
N_("raw[rename]: rename a remote relay server"),
N_("raw[del]: delete a remote relay server"),
"",
@@ -809,6 +831,7 @@ relay_command_init ()
" || add %(relay_remotes) https://localhost:9000 "
"-password=${xxx}|-proxy=xxx|-totp_secret=${xxx}|%*"
" || connect %(relay_remotes)"
+ " || disconnect %(relay_remotes)"
" || rename %(relay_remotes) %(relay_remotes)"
" || del %(relay_remotes)",
&relay_command_remote, NULL, NULL);