summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/commands.c35
-rw-r--r--src/core/bs_bot.c1
-rw-r--r--src/core/bs_help.c1
-rw-r--r--src/core/bs_info.c1
4 files changed, 25 insertions, 13 deletions
diff --git a/src/commands.c b/src/commands.c
index 7fe9f829b..034725b31 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -125,28 +125,37 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[], const char *
if (MOD_RESULT == EVENT_STOP)
return;
- if (params.size() > 0 && ircdproto->IsChannelValid(params[0].c_str()))
+ if (params.size() > 0)
{
- if ((ci = cs_findchan(params[0].c_str())))
+ if (ircdproto->IsChannelValid(params[0].c_str()))
{
- if ((ci->flags & CI_FORBIDDEN) && (!c->HasFlag(CFLAG_ALLOW_FORBIDDEN)))
+ if ((ci = cs_findchan(params[0].c_str())))
{
- notice_lang(service, u, CHAN_X_FORBIDDEN, ci->name);
- alog("Access denied for user %s with service %s and command %s because of FORBIDDEN channel %s",
- u->nick, service, cmd, ci->name);
- return;
+ if ((ci->flags & CI_FORBIDDEN) && (!c->HasFlag(CFLAG_ALLOW_FORBIDDEN)))
+ {
+ notice_lang(service, u, CHAN_X_FORBIDDEN, ci->name);
+ alog("Access denied for user %s with service %s and command %s because of FORBIDDEN channel %s",
+ u->nick, service, cmd, ci->name);
+ return;
+ }
+ else if ((ci->flags & CI_SUSPENDED) && (!c->HasFlag(CFLAG_ALLOW_SUSPENDED)))
+ {
+ notice_lang(service, u, CHAN_X_FORBIDDEN, ci->name);
+ alog("Access denied for user %s with service %s and command %s because of SUSPENDED channel %s",
+ u->nick, service, cmd, ci->name);
+ return;
+ }
}
- else if ((ci->flags & CI_SUSPENDED) && (!c->HasFlag(CFLAG_ALLOW_SUSPENDED)))
+ else if (!c->HasFlag(CFLAG_ALLOW_UNREGISTEREDCHANNEL))
{
- notice_lang(service, u, CHAN_X_FORBIDDEN, ci->name);
- alog("Access denied for user %s with service %s and command %s because of SUSPENDED channel %s",
- u->nick, service, cmd, ci->name);
+ notice_lang(service, u, CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
}
- else if (!c->HasFlag(CFLAG_ALLOW_UNREGISTEREDCHANNEL))
+ /* A user not giving a channel name for a param that should be a channel */
+ else if ((cmdTable == CHANSERV || cmdTable == BOTSERV) && !c->HasFlag(CFLAG_STRIP_CHANNEL))
{
- notice_lang(service, u, CHAN_X_NOT_REGISTERED, params[0].c_str());
+ notice_lang(service, u, CHAN_X_INVALID, params[0].c_str());
return;
}
}
diff --git a/src/core/bs_bot.c b/src/core/bs_bot.c
index 9b1fed9a6..96f72c336 100644
--- a/src/core/bs_bot.c
+++ b/src/core/bs_bot.c
@@ -350,6 +350,7 @@ class CommandBSBot : public Command
public:
CommandBSBot() : Command("BOT", 1, 6)
{
+ this->SetFlag(CFLAG_STRIP_CHANNEL);
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
diff --git a/src/core/bs_help.c b/src/core/bs_help.c
index 92a595a1d..dde26b081 100644
--- a/src/core/bs_help.c
+++ b/src/core/bs_help.c
@@ -21,6 +21,7 @@ class CommandBSHelp : public Command
CommandBSHelp() : Command("HELP", 1, 1)
{
this->SetFlag(CFLAG_ALLOW_UNREGISTERED);
+ this->SetFlag(CFLAG_STRIP_CHANNEL);
}
CommandReturn Execute(User *u, std::vector<std::string> &params)
diff --git a/src/core/bs_info.c b/src/core/bs_info.c
index d6c1c9369..e43f264c9 100644
--- a/src/core/bs_info.c
+++ b/src/core/bs_info.c
@@ -49,6 +49,7 @@ class CommandBSInfo : public Command
public:
CommandBSInfo() : Command("INFO", 1, 1)
{
+ this->SetFlag(CFLAG_STRIP_CHANNEL);
}
CommandReturn Execute(User *u, std::vector<std::string> &params)