Author: Isomer <isomer@coders.net>
[ircu2.10.12-pk.git] / ircd / send.c
index 6f7e1d3d8bfe4e02a86f0a8523b52dc00f2d64cb..b7014d70eb306b3ac90c7c83da089a79c5b7f91f 100644 (file)
@@ -600,6 +600,27 @@ void sendto_opmask_butone(struct Client *one, unsigned int mask,
   va_end(vl);
 }
 
+/*
+ * Send a server notice to all users subscribing to the indicated <mask>
+ * except for <one> - Ratelimited 1 / 30sec
+ */
+void sendto_opmask_butone_ratelimited(struct Client *one, unsigned int mask,
+                         time_t *rate, const char *pattern, ...)
+{
+  va_list vl;
+
+  if ((CurrentTime - *rate) < 30) 
+    return;
+  else 
+    *rate = CurrentTime;
+
+  va_start(vl, pattern);
+  vsendto_opmask_butone(one, mask, pattern, vl);
+  va_end(vl);
+    
+}
+
+
 /*
  * Same as above, except called with a variable argument list
  */