summaryrefslogtreecommitdiff
path: root/src/modules/m_sajoin.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-15 02:09:57 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-15 02:09:57 +0000
commitd46f8e0684a4891dc0a6b7b49174db919b1bfb79 (patch)
tree3889a4b85b371fc8d7e5d9815ad531da1be4ac5e /src/modules/m_sajoin.cpp
parent3d82a9502730b2e473d6eecb598d5d0e544daeff (diff)
- Use IsValidChannelName() in SAJOIn
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3201 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_sajoin.cpp')
-rw-r--r--src/modules/m_sajoin.cpp12
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));
}