MODE_NOFLOOD (+f [!][+@]<count>:<time>) added (prevents users from flooding the channel)
[ircu2.10.12-pk.git] / ircd / ircd_relay.c
index 701c639f7d9960ea824feebf9a4277f1d42805f2..d62761edd2e9ecfa286aebf787fe879c5d31d7e7 100644 (file)
@@ -104,6 +104,11 @@ void relay_channel_message(struct Client* sptr, const char* name, const char* te
     send_reply(sptr, ERR_CANNOTSENDTOCHAN, chptr->chname);
     return;
   }
+  
+  if(!IsXtraOp(sptr) && ext_noflood_block(sptr, chptr)) {
+    send_reply(sptr, ERR_CANNOTSENDTOCHAN, chptr->chname);
+    return;
+  }
 
   /*
    * This first: Almost never a server/service
@@ -169,7 +174,12 @@ void relay_channel_notice(struct Client* sptr, const char* name, const char* tex
    */
   if(!IsXtraOp(sptr) && !HasPriv(sptr, PRIV_NOAMSG_OVERRIDE) && ext_amsg_block(sptr, chptr, text))
     return;
-       
+
+  if(!IsXtraOp(sptr) && ext_noflood_block(sptr, chptr)) {
+    send_reply(sptr, ERR_CANNOTSENDTOCHAN, chptr->chname);
+    return;
+  }
+
   /* Now we check if the channel has the NONOTICE mode
    * If NONOTICE is set only XtraOPS or ColorOverride users can send notices!
    */