summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/irc/flood/flood.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/irc/flood/flood.c b/src/irc/flood/flood.c
index d5339d4f..de7d292c 100644
--- a/src/irc/flood/flood.c
+++ b/src/irc/flood/flood.c
@@ -285,16 +285,19 @@ static void read_settings(void)
flood_timecheck = settings_get_int("flood_timecheck");
flood_max_msgs = settings_get_int("flood_max_msgs");
- if (flood_tag != -1) {
- g_source_remove(flood_tag);
- flood_tag = -1;
- }
-
if (flood_timecheck > 0 && flood_max_msgs > 0) {
flood_tag = g_timeout_add(500, (GSourceFunc) flood_timeout, NULL);
+
signal_add("event privmsg", (SIGNAL_FUNC) flood_privmsg);
signal_add("event notice", (SIGNAL_FUNC) flood_notice);
signal_add("ctcp msg", (SIGNAL_FUNC) flood_ctcp);
+ } else if (flood_tag != -1) {
+ g_source_remove(flood_tag);
+ flood_tag = -1;
+
+ signal_remove("event privmsg", (SIGNAL_FUNC) flood_privmsg);
+ signal_remove("event notice", (SIGNAL_FUNC) flood_notice);
+ signal_remove("ctcp msg", (SIGNAL_FUNC) flood_ctcp);
}
}