diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_sajoin.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
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)); } |