mirror of
https://github.com/irssi/irssi.git
synced 2024-11-03 04:27:19 -05:00
Every time a /SET was changed, it leaked a signal_add() which would cause
very buggy behaviour at least related to flood checking. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2326 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
bba5603903
commit
0b12f76d1f
@ -285,16 +285,19 @@ static void read_settings(void)
|
|||||||
flood_timecheck = settings_get_int("flood_timecheck");
|
flood_timecheck = settings_get_int("flood_timecheck");
|
||||||
flood_max_msgs = settings_get_int("flood_max_msgs");
|
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) {
|
if (flood_timecheck > 0 && flood_max_msgs > 0) {
|
||||||
flood_tag = g_timeout_add(500, (GSourceFunc) flood_timeout, NULL);
|
flood_tag = g_timeout_add(500, (GSourceFunc) flood_timeout, NULL);
|
||||||
|
|
||||||
signal_add("event privmsg", (SIGNAL_FUNC) flood_privmsg);
|
signal_add("event privmsg", (SIGNAL_FUNC) flood_privmsg);
|
||||||
signal_add("event notice", (SIGNAL_FUNC) flood_notice);
|
signal_add("event notice", (SIGNAL_FUNC) flood_notice);
|
||||||
signal_add("ctcp msg", (SIGNAL_FUNC) flood_ctcp);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user