+/** Handles the +c channel mode
+ */
+class BlockColor : public ModeHandler
+{
+ public:
+ BlockColor(InspIRCd* Instance) : ModeHandler(Instance, 'c', 0, 0, false, MODETYPE_CHANNEL, false) { }
+
+ ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding)
+ {
+ if (adding)
+ {
+ if (!channel->IsModeSet('c'))
+ {
+ channel->SetMode('c',true);
+ return MODEACTION_ALLOW;
+ }
+ }
+ else
+ {
+ if (channel->IsModeSet('c'))
+ {
+ channel->SetMode('c',false);
+ return MODEACTION_ALLOW;
+ }
+ }
+
+ return MODEACTION_DENY;
+ }
+};
+