From d46f8e0684a4891dc0a6b7b49174db919b1bfb79 Mon Sep 17 00:00:00 2001 From: w00t Date: Wed, 15 Feb 2006 02:09:57 +0000 Subject: - Use IsValidChannelName() in SAJOIn git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3201 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_sajoin.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp index 602a7c3c2..acd7b03a2 100644 --- a/src/modules/m_sajoin.cpp +++ b/src/modules/m_sajoin.cpp @@ -39,23 +39,13 @@ class cmd_sajoin : public command_t userrec* dest = Srv->FindNick(std::string(parameters[0])); if (dest) { - /* might be nicer to make checking valid channel names an api function sometime --w00t */ - if (parameters[1][0] != '#') + if (!IsValidChannelName(parameters[1])) { /* we didn't need to check this for each character ;) */ Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+" :*** Invalid characters in channel name"); return; } - for (unsigned int x = 0; x < strlen(parameters[1]); x++) - { - if ((parameters[1][x] == ' ') || (parameters[1][x] == ',')) - { - Srv->SendTo(NULL,user,"NOTICE "+std::string(user->nick)+" :*** Invalid characters in channel name"); - return; - } - } - Srv->SendOpers(std::string(user->nick)+" used SAJOIN to make "+std::string(dest->nick)+" join "+parameters[1]); Srv->JoinUserToChannel(dest,std::string(parameters[1]),std::string(dest->nick)); } -- cgit v1.2.3