- if (c->IsModeSet(m2) && !is_registered && res != MOD_RES_ALLOW)
- {
- // 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");
- return MOD_RES_DENY;
- }
+ if (!targchan->IsModeSet(m2) || 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");
+ return MOD_RES_DENY;