summaryrefslogtreecommitdiff
path: root/src/modules/m_blockcaps.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-02 00:49:36 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-02 00:49:36 +0000
commit86775e2e98f55b3b88befe2daff0ca23f02f3155 (patch)
treecbc3abf3f55ae6fd1112bcf6bf44e02b502ac2d6 /src/modules/m_blockcaps.cpp
parent3d8ec5dbd9cfde34fcbc63ad7b9b1369866f0a33 (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_blockcaps.cpp')
-rw-r--r--src/modules/m_blockcaps.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp
index 6ce1cecc5..ca1bc5a2b 100644
--- a/src/modules/m_blockcaps.cpp
+++ b/src/modules/m_blockcaps.cpp
@@ -51,21 +51,21 @@ public:
ReadConf();
}
- 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 (target_type == TYPE_CHANNEL)
{
if ((!IS_LOCAL(user)) || (text.length() < minlen))
- return 0;
+ return MOD_RES_PASSTHRU;
Channel* c = (Channel*)dest;
if (CHANOPS_EXEMPT(ServerInstance, 'B') && c->GetStatus(user) == STATUS_OP)
{
- return 0;
+ return MOD_RES_PASSTHRU;
}
- if (c->IsModeSet('B') || c->GetExtBanStatus(user, 'B') < 0)
+ if (!c->GetExtBanStatus(user, 'B').check(!c->IsModeSet('B')))
{
int caps = 0;
const char* actstr = "\1ACTION ";
@@ -87,14 +87,14 @@ public:
if ( ((caps*100)/(int)text.length()) >= percent )
{
user->WriteNumeric(ERR_CANNOTSENDTOCHAN, "%s %s :Your message cannot contain more than %d%% capital letters if it's longer than %d characters", user->nick.c_str(), c->name.c_str(), percent, minlen);
- return 1;
+ return MOD_RES_DENY;
}
}
}
- 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);
}