From aef3ee694d623901d2d6c4039b5f746969264e30 Mon Sep 17 00:00:00 2001 From: w00t Date: Mon, 13 Feb 2006 01:14:16 +0000 Subject: Make use of IsValidChannelName() - as a side note, we perhaps shouldn't be returning 403 in CBAN... git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3184 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_cban.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'src') diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index cd8ad2283..ce01804ef 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -49,7 +49,6 @@ std::string EncodeCBan(const CBan &ban); CBan DecodeCBan(const std::string &data); bool CBanComp(const CBan &ban1, const CBan &ban2); void ExpireBans(); -bool IsValidChan(const char* cname); extern time_t TIME; typedef std::vector cbanlist; @@ -93,7 +92,7 @@ class cmd_cban : public command_t else if (pcnt >= 2) { /* full form to add a CBAN */ - if(IsValidChan(parameters[0])) + if (IsValidChannelName(parameters[0])) { // parameters[0] = #channel // parameters[1] = 1h3m2s @@ -240,21 +239,6 @@ void ExpireBans() } } -bool IsValidChan(const char* cname) -{ - if(!cname) - return false; - - if(cname[0] != '#') - return false; - - for(unsigned int i = 0; i < strlen(cname); i++) - if((cname[i] == ' ') || (cname[i] == '\7') || (cname[i] == ',')) - return false; - - return true; -} - class ModuleCBanFactory : public ModuleFactory { public: -- cgit v1.2.3