summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/m_sajoin.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp
index 76c568ea7..f82bba203 100644
--- a/src/modules/m_sajoin.cpp
+++ b/src/modules/m_sajoin.cpp
@@ -31,9 +31,17 @@ void handle_sajoin(char **parameters, int pcnt, userrec *user)
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] != '#')
+ {
+ /* 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][0] != '#') || (parameters[1][x] == ' ') || (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;