From 3fb96ec5df7d91a263ec9d3cae61b3372c4fddf3 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 9 May 2008 22:25:00 +0000 Subject: 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 --- src/modules/m_blockcaps.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/modules') 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); -- cgit v1.2.3