diff options
author | attilamolnar <attilamolnar@hush.com> | 2012-08-08 14:07:09 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2012-08-08 14:12:03 +0200 |
commit | fae560cddc389b88c9cd34afdccf9035f4d11c5b (patch) | |
tree | f145aa8da94d30ac210863aa04b584f076d73b13 | |
parent | 21c3232b8e0bb41727f2d65a0b2d5304587cf6be (diff) |
m_messageflood Unset +f when the module is unloaded
-rw-r--r-- | src/modules/m_messageflood.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp index e0b30163c..ff92fcaa3 100644 --- a/src/modules/m_messageflood.cpp +++ b/src/modules/m_messageflood.cpp @@ -75,8 +75,6 @@ class MsgFlood : public ModeHandler ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding) { - floodsettings *f = ext.get(channel); - if (adding) { std::string::size_type colon = parameter.find(':'); @@ -97,6 +95,7 @@ class MsgFlood : public ModeHandler return MODEACTION_DENY; } + floodsettings* f = ext.get(channel); if ((f) && (nlines == f->lines) && (nsecs == f->secs) && (ban == f->ban)) // mode params match return MODEACTION_DENY; @@ -108,15 +107,13 @@ class MsgFlood : public ModeHandler } else { - if (f) - { - ext.unset(channel); - channel->SetModeParam('f', ""); - return MODEACTION_ALLOW; - } - } + if (!channel->IsModeSet('f')) + return MODEACTION_DENY; - return MODEACTION_DENY; + ext.unset(channel); + channel->SetModeParam('f', ""); + return MODEACTION_ALLOW; + } } }; |