1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-07 10:13:12 +02:00

Added anti-flood option (irc_anti_flood) (task #5442)

This commit is contained in:
Sebastien Helleu
2006-12-04 09:44:23 +00:00
parent c774d9eb00
commit 10ab4b0a20
34 changed files with 6182 additions and 5340 deletions
+22 -1
View File
@@ -731,7 +731,7 @@ user_message (t_irc_server *server, t_gui_buffer *buffer, char *text)
next = pos;
}
server_sendf (server, "PRIVMSG %s :%s", CHANNEL(buffer)->name, text);
server_sendf_queued (server, "PRIVMSG %s :%s", CHANNEL(buffer)->name, text);
user_message_display (server, buffer, text);
if (next)
@@ -1616,6 +1616,8 @@ int
weechat_cmd_debug (t_irc_server *server, t_irc_channel *channel,
int argc, char **argv)
{
t_irc_server *ptr_server;
/* make gcc happy */
(void) server;
(void) channel;
@@ -1639,6 +1641,16 @@ weechat_cmd_debug (t_irc_server *server, t_irc_channel *channel,
gui_printf_nolog (NULL, "DEBUG: windows tree:\n");
weechat_cmd_debug_display_windows (gui_windows_tree, 1);
}
else if (ascii_strcasecmp (argv[0], "deloutq") == 0)
{
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
server_outqueue_free_all (ptr_server);
}
gui_printf_nolog (NULL, "\n");
gui_printf_nolog (NULL, "DEBUG: outqueue DELETED for all servers.\n");
}
else
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
@@ -3521,6 +3533,15 @@ weechat_cmd_upgrade (t_irc_server *server, t_irc_channel *channel,
WEECHAT_ERROR);
return -1;
}
if (ptr_server->outqueue)
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
gui_printf_nolog (NULL,
_("%s can't upgrade: anti-flood is active on "
"at least one server (sending many lines)\n"),
WEECHAT_ERROR);
return -1;
}
}
filename_length = strlen (weechat_home) + strlen (WEECHAT_SESSION_NAME) + 2;
+5
View File
@@ -717,6 +717,7 @@ int cfg_irc_away_check_max_nicks;
int cfg_irc_lag_check;
int cfg_irc_lag_min_show;
int cfg_irc_lag_disconnect;
int cfg_irc_anti_flood;
int cfg_irc_fifo_pipe;
char *cfg_irc_highlight;
int cfg_irc_colors_receive;
@@ -765,6 +766,10 @@ t_config_option weechat_options_irc[] =
N_("disconnect after important lag (in minutes, 0 = never disconnect)"),
OPTION_TYPE_INT, 0, INT_MAX, 5,
NULL, NULL, &cfg_irc_lag_disconnect, NULL, &config_change_noop },
{ "irc_anti_flood", N_("anti-flood"),
N_("anti-flood: # seconds between two user messages (0 = no anti-flood)"),
OPTION_TYPE_INT, 0, 5, 2,
NULL, NULL, &cfg_irc_anti_flood, NULL, &config_change_noop },
{ "irc_fifo_pipe", N_("create a FIFO pipe for remote control"),
N_("create a FIFO pipe for remote control"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
+1
View File
@@ -210,6 +210,7 @@ extern int cfg_irc_away_check_max_nicks;
extern int cfg_irc_lag_check;
extern int cfg_irc_lag_min_show;
extern int cfg_irc_lag_disconnect;
extern int cfg_irc_anti_flood;
extern int cfg_irc_fifo_pipe;
extern char *cfg_irc_highlight;
extern int cfg_irc_colors_receive;