From d9f48b75602a6363fc5f50c53bd1fc6d1b96e3bd Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 7 Jul 2006 21:06:25 +0000 Subject: Make +b use CleanMask() git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4146 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modes/cmode_b.cpp | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) (limited to 'src/modes') diff --git a/src/modes/cmode_b.cpp b/src/modes/cmode_b.cpp index 57e13159d..6dc7f4c37 100644 --- a/src/modes/cmode_b.cpp +++ b/src/modes/cmode_b.cpp @@ -45,32 +45,11 @@ std::string& ModeChannelBan::AddBan(userrec *user,std::string &dest,chanrec *cha return dest; } - for (std::string::iterator i = dest.begin(); i != dest.end(); i++) - { - if ((*i < 32) || (*i > 126)) - { - dest = ""; - return dest; - } - else if (*i == '!') - { - toomanyexclamation++; - } - else if (*i == '@') - { - toomanyat++; - } - } - - if (toomanyexclamation != 1 || toomanyat != 1) - { - /* - * this stops sillyness like n!u!u!u@h, though note that most - * ircds don't actually verify banmask validity. --w00t - */ - dest = ""; + /* Attempt to tidy the mask */ + ModeParser::CleanMask(dest); + /* If the mask was invalid, we exit */ + if (dest == "") return dest; - } long maxbans = GetMaxBans(chan->name); if ((unsigned)chan->bans.size() > (unsigned)maxbans) -- cgit v1.2.3