+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain@chatspike.net>
+ * <Craig@chatspike.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
#include "inspircd.h"
#include "inspircd_io.h"
#include "inspircd_util.h"
extern int MODCOUNT;
extern vector<Module*> modules;
extern vector<ircd_module*> factory;
+extern std::vector<std::string> module_names;
+
extern int LogLevel;
extern char ServerName[MAXBUF];
break;
default:
- log(DEBUG,"Preprocessing custom mode %c",modechar);
+ log(DEBUG,"Preprocessing custom mode %c: modelist: %s",modechar,chan->custom_modes);
string_list p;
p.clear();
if (((!strchr(chan->custom_modes,modechar)) && (!mdir)) || ((strchr(chan->custom_modes,modechar)) && (mdir)))
bool handled = false;
if (param>=pcnt)
{
- log(DEBUG,"Not enough parameters for module-mode %c",modechar);
// we're supposed to have a parameter, but none was given... so dont handle the mode.
if (((ModeDefinedOn(modechar,MT_CHANNEL)>0) && (mdir)) || ((ModeDefinedOff(modechar,MT_CHANNEL)>0) && (!mdir)))
{
+ log(DEBUG,"Not enough parameters for module-mode %c",modechar);
handled = true;
param++;
}
}
}
}
+ else
+ {
+ WriteServ(user->fd,"472 %s %c :is unknown mode char to me",user->nick,modechar);
+ }
break;
}
{
if (modules[i]->OnExtendedMode(source,(void*)dest,umode,MT_CLIENT,adding,p))
{
- log(DEBUG,"Module claims umode %c",umode);
+ log(DEBUG,"Module %s claims umode %c",module_names[i].c_str(),umode);
return true;
}
}
if ((dest) && (pcnt == 1))
{
- WriteServ(user->fd,"221 %s :+%s",user->nick,user->modes);
+ WriteServ(user->fd,"221 %s :+%s",dest->nick,dest->modes);
return;
}
}
}
- if ((cstatus(user,Ptr) < STATUS_HOP) && (Ptr))
- {
- WriteServ(user->fd,"482 %s %s :You must be at least a half-operator to change modes on this channel",user->nick, Ptr->name);
+ int MOD_RESULT = 0;
+ FOREACH_RESULT(OnAccessCheck(user,NULL,Ptr,AC_GENERAL_MODE));
+
+ if (MOD_RESULT == ACR_DENY)
return;
+ if (MOD_RESULT == ACR_DEFAULT)
+ {
+ if ((cstatus(user,Ptr) < STATUS_HOP) && (Ptr))
+ {
+ WriteServ(user->fd,"482 %s %s :You must be at least a half-operator to change modes on this channel",user->nick, Ptr->name);
+ return;
+ }
}
process_modes(parameters,user,Ptr,cstatus(user,Ptr),pcnt,false,false,false);