mirror of
https://github.com/weechat/weechat.git
synced 2026-07-03 08:13:14 +02:00
irc: disable creation of temporary servers by default with command /connect, new option irc.look.temporary_servers
This commit is contained in:
@@ -1172,7 +1172,7 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
connect_ok = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (weechat_config_boolean (irc_config_look_temporary_servers))
|
||||
{
|
||||
if ((strncmp (argv[i], "irc", 3) == 0)
|
||||
&& strstr (argv[i], "://"))
|
||||
@@ -1222,6 +1222,24 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
IRC_PLUGIN_NAME, argv[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
weechat_printf (
|
||||
NULL,
|
||||
_("%s%s: unable to create temporary server \"%s\" "
|
||||
"because the creation of temporary servers with "
|
||||
"command /connect is currently disabled"),
|
||||
weechat_prefix ("error"), IRC_PLUGIN_NAME, argv[i]);
|
||||
weechat_printf (
|
||||
NULL,
|
||||
_("%s%s: if you want to create a standard server, "
|
||||
"use the command \"/server add\" (see /help "
|
||||
"server); if you really want to create a temporary "
|
||||
"server (NOT SAVED), turn on the option "
|
||||
"irc.look.temporary_servers"),
|
||||
weechat_prefix ("error"),
|
||||
IRC_PLUGIN_NAME);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5873,10 +5891,11 @@ irc_command_init ()
|
||||
N_(" server: server name, which can be:\n"
|
||||
" - internal server name (created by /server add, "
|
||||
"recommended usage)\n"
|
||||
" - hostname/port or IP/port (this will create a TEMPORARY "
|
||||
"server), port is 6667 by default\n"
|
||||
" - hostname/port or IP/port, port is 6667 by default\n"
|
||||
" - URL with format: irc[6][s]://[nickname[:password]@]"
|
||||
"irc.example.org[:port][/#channel1][,#channel2[...]]\n"
|
||||
" Note: for an address/IP/URL, a temporary server is "
|
||||
"created (NOT SAVED), see /help irc.look.temporary_servers\n"
|
||||
" option: set option for server (for boolean option, value can be "
|
||||
"omitted)\n"
|
||||
" nooption: set boolean option to 'off' (for example: -nossl)\n"
|
||||
|
||||
@@ -103,6 +103,7 @@ struct t_config_option *irc_config_look_smart_filter_join_unmask;
|
||||
struct t_config_option *irc_config_look_smart_filter_mode;
|
||||
struct t_config_option *irc_config_look_smart_filter_nick;
|
||||
struct t_config_option *irc_config_look_smart_filter_quit;
|
||||
struct t_config_option *irc_config_look_temporary_servers;
|
||||
struct t_config_option *irc_config_look_topic_strip_colors;
|
||||
|
||||
/* IRC config, color section */
|
||||
@@ -2677,6 +2678,12 @@ irc_config_init ()
|
||||
/* TRANSLATORS: please do not translate "part" and "quit" */
|
||||
N_("enable smart filter for \"part\" and \"quit\" messages"),
|
||||
NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
irc_config_look_temporary_servers = weechat_config_new_option (
|
||||
irc_config_file, ptr_section,
|
||||
"temporary_servers", "boolean",
|
||||
N_("enable creation of temporary servers with command "
|
||||
"/connect"),
|
||||
NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
irc_config_look_topic_strip_colors = weechat_config_new_option (
|
||||
irc_config_file, ptr_section,
|
||||
"topic_strip_colors", "boolean",
|
||||
|
||||
@@ -151,6 +151,7 @@ extern struct t_config_option *irc_config_look_smart_filter_join_unmask;
|
||||
extern struct t_config_option *irc_config_look_smart_filter_mode;
|
||||
extern struct t_config_option *irc_config_look_smart_filter_nick;
|
||||
extern struct t_config_option *irc_config_look_smart_filter_quit;
|
||||
extern struct t_config_option *irc_config_look_temporary_servers;
|
||||
extern struct t_config_option *irc_config_look_topic_strip_colors;
|
||||
|
||||
extern struct t_config_option *irc_config_color_input_nick;
|
||||
|
||||
Reference in New Issue
Block a user