-#include "users.h"
-#include "channels.h"
-#include "modules.h"
-#include "helperfuncs.h"
-
-/* $ModDesc: Provides support for channel mode +P to block all-CAPS channel messages and notices */
-
-class BlockCaps : public ModeHandler
-{
- public:
- BlockCaps() : ModeHandler('P', 0, 0, false, MODETYPE_CHANNEL, false) { }
-
- ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding)
- {
- if (adding)
- {
- if (!channel->IsModeSet('P'))
- {
- channel->SetCustomMode('P',true);
- return MODEACTION_ALLOW;
- }
- }
- else
- {
- if (channel->IsModeSet('P'))
- {
- channel->SetCustomMode('P',false);
- return MODEACTION_ALLOW;
- }
- }