-#include "inspircd.h"
-
-/* $ModDesc: Provides support for channel mode +N which prevents nick changes on channel */
-
-class NoNicks : public ModeHandler
-{
- public:
- NoNicks(InspIRCd* Instance) : ModeHandler(Instance, 'N', 0, 0, false, MODETYPE_CHANNEL, false) { }
-
- ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool)
- {
- if (adding)
- {
- if (!channel->IsModeSet('N'))
- {
- channel->SetMode('N',true);
- return MODEACTION_ALLOW;
- }
- }
- else
- {
- if (channel->IsModeSet('N'))
- {
- channel->SetMode('N',false);
- return MODEACTION_ALLOW;
- }
- }