summaryrefslogtreecommitdiff
path: root/src/modules.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules.cpp')
-rw-r--r--src/modules.cpp32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index af3ef5303..339374ae2 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -619,22 +619,30 @@ Admin Server::GetAdmin()
bool Server::AddExtendedMode(char modechar, int type, bool requires_oper, int params_when_on, int params_when_off)
{
- if (type == MT_SERVER)
+ if (((modechar >= 'A') && (modechar <= 'Z')) || ((modechar >= 'a') && (modechar <= 'z')))
{
- log(DEBUG,"*** API ERROR *** Modes of type MT_SERVER are reserved for future expansion");
- return false;
- }
- if (((params_when_on>0) || (params_when_off>0)) && (type == MT_CLIENT))
- {
- log(DEBUG,"*** API ERROR *** Parameters on MT_CLIENT modes are not supported");
- return false;
+ if (type == MT_SERVER)
+ {
+ log(DEBUG,"*** API ERROR *** Modes of type MT_SERVER are reserved for future expansion");
+ return false;
+ }
+ if (((params_when_on>0) || (params_when_off>0)) && (type == MT_CLIENT))
+ {
+ log(DEBUG,"*** API ERROR *** Parameters on MT_CLIENT modes are not supported");
+ return false;
+ }
+ if ((params_when_on>1) || (params_when_off>1))
+ {
+ log(DEBUG,"*** API ERROR *** More than one parameter for an MT_CHANNEL mode is not yet supported");
+ return false;
+ }
+ return DoAddExtendedMode(modechar,type,requires_oper,params_when_on,params_when_off);
}
- if ((params_when_on>1) || (params_when_off>1))
+ else
{
- log(DEBUG,"*** API ERROR *** More than one parameter for an MT_CHANNEL mode is not yet supported");
- return false;
+ log(DEBUG,"*** API ERROR *** Muppet modechar detected.");
}
- return DoAddExtendedMode(modechar,type,requires_oper,params_when_on,params_when_off);
+ return false;
}
bool Server::AddExtendedListMode(char modechar)