+ Channel_r(Module* Creator) : ModeHandler(Creator, "c_registered", 'r', PARAM_NONE, MODETYPE_CHANNEL) { }
+
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string& parameter, bool adding) CXX11_OVERRIDE
+ {
+ // Only a U-lined server may add or remove the +r mode.
+ if (!IS_LOCAL(source))
+ {
+ // Only change the mode if it's not redundant
+ if ((adding != channel->IsModeSet(this)))
+ {
+ channel->SetMode(this, adding);
+ return MODEACTION_ALLOW;
+ }
+ }
+ else
+ {
+ source->WriteNumeric(ERR_NOPRIVILEGES, "Only a server may modify the +r channel mode");
+ }
+ return MODEACTION_DENY;
+ }