summaryrefslogtreecommitdiff
path: root/src/modules/m_blockcaps.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-09 22:25:00 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-09 22:25:00 +0000
commit3fb96ec5df7d91a263ec9d3cae61b3372c4fddf3 (patch)
tree1697003c686ecec68aca25192b7db258068a821a /src/modules/m_blockcaps.cpp
parentb260458e4d8087b5574a34c1c506100360e29c78 (diff)
If nobody else is going to submit a diff, may as well do it myself. Using your noggin avoids two loops
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9690 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_blockcaps.cpp')
-rw-r--r--src/modules/m_blockcaps.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp
index 3e8fdccc5..88d7ab5f4 100644
--- a/src/modules/m_blockcaps.cpp
+++ b/src/modules/m_blockcaps.cpp
@@ -68,8 +68,16 @@ public:
if (c->IsModeSet('B'))
{
int caps = 0;
+ const char* actstr = "\1ACTION ";
+
for (std::string::iterator i = text.begin(); i != text.end(); i++)
+ {
+ /* Smart fix for suggestion from Jobe, ignore CTCP ACTION (part of /ME) */
+ if (*actstr && *i == *actstr++)
+ continue;
+
caps += capsmap[(unsigned char)*i];
+ }
if ( ((caps*100)/(int)text.length()) >= percent )
{
user->WriteServ( "404 %s %s :Your line cannot be more than %d%% capital letters if it is %d or more letters long", user->nick, c->name, percent, minlen);