* +------------------------------------+
*
* InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
*
* This program is free but copyrighted software; see
* the file COPYING for details.
class OperPrefixMode : public ModeHandler
{
public:
- OperPrefixMode(InspIRCd* Instance, char pfx) : ModeHandler(Instance, 'y', 1, 1, true, MODETYPE_CHANNEL, false, pfx) { }
+ OperPrefixMode(InspIRCd* Instance, Module* Creator, char pfx) : ModeHandler(Instance, Creator, 'y', 1, 1, true, MODETYPE_CHANNEL, false, pfx, pfx, TR_NICK) { }
unsigned int GetPrefixRank()
{
return OPERPREFIX_VALUE;
}
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool servermode)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding)
{
- if (servermode || (source && ServerInstance->ULine(source->server)))
+ if (IS_FAKE(source) || (source && ServerInstance->ULine(source->server)))
return MODEACTION_ALLOW;
else
{
ConfigReader Conf(ServerInstance);
std::string pfx = Conf.ReadValue("operprefix", "prefix", "!", 0, false);
- opm = new OperPrefixMode(ServerInstance, pfx[0]);
+ opm = new OperPrefixMode(ServerInstance, this, pfx[0]);
if ((!ServerInstance->Modes->AddMode(opm)))
throw ModuleException("Could not add a new mode!");
}
// XXX: is there a better way to do this?
- virtual int OnRawMode(User* user, Channel* chan, const char mode, const std::string ¶m, bool adding, int pcnt, bool servermode)
+ virtual int OnRawMode(User* user, Channel* chan, const char mode, const std::string ¶m, bool adding, int pcnt)
{
/* force event propagation to its ModeHandler */
- if (!servermode && chan && (mode == 'y'))
+ if (!IS_FAKE(user) && chan && (mode == 'y'))
return ACR_ALLOW;
return 0;
}