+ }
+ if (target_type == TYPE_USER)
+ {
+ userrec* u = (userrec*)dest;
+ if ((strchr(u->modes,'R')) && (!strchr(user->modes,'r')))
+ {
+ if ((Srv->IsUlined(user->nick)) || (Srv->IsUlined(user->server)))
+ {
+ // user is ulined, can speak regardless
+ return 0;
+ }
+ // user messaging a +R user and is not registered
+ Srv->SendServ(user->fd,"477 "+std::string(user->nick)+" "+std::string(u->nick)+" :You need a registered nickname to message this user");
+ return 1;
+ }
+ }
+ return 0;
+ }
+
+ virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text)
+ {
+ if (target_type == TYPE_CHANNEL)
+ {
+ chanrec* c = (chanrec*)dest;
+ if ((c->IsCustomModeSet('M')) && (!strchr(user->modes,'r')))