aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_censor.cpp
diff options
context:
space:
mode:
authorGravatar danieldg2009-09-02 00:49:36 +0000
committerGravatar danieldg2009-09-02 00:49:36 +0000
commit86775e2e98f55b3b88befe2daff0ca23f02f3155 (patch)
treecbc3abf3f55ae6fd1112bcf6bf44e02b502ac2d6 /src/modules/m_censor.cpp
parentRemove "servermode" parameter, replace with IS_FAKE() which is more reliable (diff)
ModResult conversion: Change return type of all module functions
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11634 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_censor.cpp')
-rw-r--r--src/modules/m_censor.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp
index 13527f64a..6050d49ab 100644
--- a/src/modules/m_censor.cpp
+++ b/src/modules/m_censor.cpp
@@ -64,10 +64,10 @@ class ModuleCensor : public Module
}
// format of a config entry is <badword text="shit" replace="poo">
- virtual int OnUserPreMessage(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
+ virtual ModResult OnUserPreMessage(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
if (!IS_LOCAL(user))
- return 0;
+ return MOD_RES_PASSTHRU;
bool active = false;
@@ -79,12 +79,12 @@ class ModuleCensor : public Module
Channel* c = (Channel*)dest;
if (CHANOPS_EXEMPT(ServerInstance, 'G') && c->GetStatus(user) == STATUS_OP)
{
- return 0;
+ return MOD_RES_PASSTHRU;
}
}
if (!active)
- return 0;
+ return MOD_RES_PASSTHRU;
irc::string text2 = text.c_str();
for (censor_t::iterator index = censors.begin(); index != censors.end(); index++)
@@ -94,17 +94,17 @@ class ModuleCensor : public Module
if (index->second.empty())
{
user->WriteNumeric(ERR_WORDFILTERED, "%s %s %s :Your message contained a censored word, and was blocked", user->nick.c_str(), ((Channel*)dest)->name.c_str(), index->first.c_str());
- return 1;
+ return MOD_RES_DENY;
}
SearchAndReplace(text2, index->first, index->second);
}
}
text = text2.c_str();
- return 0;
+ return MOD_RES_PASSTHRU;
}
- virtual int OnUserPreNotice(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
+ virtual ModResult OnUserPreNotice(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
{
return OnUserPreMessage(user,dest,target_type,text,status,exempt_list);
}