+ ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) CXX11_OVERRIDE
+ {
+ // Allow sending if forcenotice is off, the user is not a bot, or if the message is a notice.
+ if (!forcenotice || !user->IsModeSet(bm) || details.type == MSG_NOTICE)
+ return MOD_RES_PASSTHRU;
+
+ // Allow sending PRIVMSGs to services pseudoclients.
+ if (target.type == MessageTarget::TYPE_USER && target.Get<User>()->server->IsULine())
+ return MOD_RES_PASSTHRU;
+
+ // Force the message to be broadcast as a NOTICE.
+ details.type = MSG_NOTICE;
+ return MOD_RES_PASSTHRU;
+ }
+