-
-/** Handles the +P channel mode
- */
-class PermChannel : public ModeHandler
-{
- public:
- PermChannel(Module* Creator) : ModeHandler(Creator, "permanent", 'P', PARAM_NONE, MODETYPE_CHANNEL) { oper = true; }
-
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding)
- {
- if (adding)
- {
- if (!channel->IsModeSet('P'))
- {
- channel->SetMode('P',true);
- return MODEACTION_ALLOW;
- }
- }
- else
- {
- if (channel->IsModeSet('P'))
- {
- channel->SetMode(this,false);
- channel->CheckDestroy();
- return MODEACTION_ALLOW;
- }
- }
-
- return MODEACTION_DENY;
- }
-};
-