class PermChannel : public ModeHandler
{
public:
- PermChannel(InspIRCd* Instance) : ModeHandler(Instance, 'P', 0, 0, false, MODETYPE_CHANNEL, false) { }
+ PermChannel(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'P', 0, 0, false, MODETYPE_CHANNEL, false) { }
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool sm)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding)
{
if (!source->HasPrivPermission("channels/set-permanent"))
{
{
if (channel->IsModeSet('P'))
{
- if (channel->GetUserCounter() == 0 && !sm)
+ if (channel->GetUserCounter() == 0 && !IS_FAKE(source))
{
/*
* ugh, ugh, UGH!
PermChannel p;
public:
- ModulePermanentChannels(InspIRCd* Me) : Module(Me), p(Me)
+ ModulePermanentChannels(InspIRCd* Me) : Module(Me), p(Me, this)
{
if (!ServerInstance->Modes->AddMode(&p))
throw ModuleException("Could not add new modes!");
return Version("$Id$",VF_COMMON|VF_VENDOR,API_VERSION);
}
- virtual int OnChannelPreDelete(Channel *c)
+ virtual ModResult OnChannelPreDelete(Channel *c)
{
if (c->IsModeSet('P'))
- return 1;
+ return MOD_RES_DENY;
- return 0;
+ return MOD_RES_PASSTHRU;
}
};