aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_messageflood.cpp
diff options
context:
space:
mode:
authorGravatar Attila Molnar2014-01-08 12:52:07 +0100
committerGravatar Attila Molnar2014-01-08 12:52:07 +0100
commit833ae95adc3d8e0b7ba0e82af4cbd173bb98431e (patch)
tree572ed0df4e949a343ad51731eba42936151544bb /src/modules/m_messageflood.cpp
parentRead uline state in spanningtree; remove ConfigReader::ulines (diff)
downloadinspircd++-833ae95adc3d8e0b7ba0e82af4cbd173bb98431e.tar.gz
inspircd++-833ae95adc3d8e0b7ba0e82af4cbd173bb98431e.tar.bz2
inspircd++-833ae95adc3d8e0b7ba0e82af4cbd173bb98431e.zip
Remove PreText()-like functions
Do processing in OnUserPreMessage()
Diffstat (limited to 'src/modules/m_messageflood.cpp')
-rw-r--r--src/modules/m_messageflood.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp
index 70ba8bd78..e2d752d18 100644
--- a/src/modules/m_messageflood.cpp
+++ b/src/modules/m_messageflood.cpp
@@ -124,8 +124,12 @@ class ModuleMsgFlood : public Module
{
}
- ModResult ProcessMessages(User* user,Channel* dest, const std::string &text)
+ ModResult OnUserPreMessage(User* user, void* voiddest, int target_type, std::string& text, char status, CUList& exempt_list, MessageType msgtype) CXX11_OVERRIDE
{
+ if (target_type != TYPE_CHANNEL)
+ return MOD_RES_PASSTHRU;
+
+ Channel* dest = static_cast<Channel*>(voiddest);
if ((!IS_LOCAL(user)) || !dest->IsModeSet(mf))
return MOD_RES_PASSTHRU;
@@ -160,14 +164,6 @@ class ModuleMsgFlood : public Module
return MOD_RES_PASSTHRU;
}
- ModResult OnUserPreMessage(User* user, void* dest, int target_type, std::string& text, char status, CUList& exempt_list, MessageType msgtype) CXX11_OVERRIDE
- {
- if (target_type == TYPE_CHANNEL)
- return ProcessMessages(user,(Channel*)dest,text);
-
- return MOD_RES_PASSTHRU;
- }
-
void Prioritize()
{
// we want to be after all modules that might deny the message (e.g. m_muteban, m_noctcp, m_blockcolor, etc.)