- // user messaging a +M channel and is not registered
- user->WriteNumeric(ERR_NEEDREGGEDNICK, c->name, "You need to be identified to a registered account to message this channel");
+ Channel* targchan = target.Get<Channel>();
+
+ if (!targchan->IsModeSet(regmoderatedmode) || is_registered)
+ return MOD_RES_PASSTHRU;
+
+ if (CheckExemption::Call(exemptionprov, user, targchan, "regmoderated") == MOD_RES_ALLOW)
+ return MOD_RES_PASSTHRU;
+
+ // User is messaging a +M channel and is not registered or exempt.
+ user->WriteNumeric(ERR_NEEDREGGEDNICK, targchan->name, "You need to be identified to a registered account to message this channel");