]> jfr.im git - irc/quakenet/newserv.git/blobdiff - chanserv/chancmds/permban.c
CHANSERV: HACK: tempban/permban limits are now 20x normal if founder is an IRC operator
[irc/quakenet/newserv.git] / chanserv / chancmds / permban.c
index c64c5fd4253236ad3a22fab9d74dd3a4b48b7b0b..1cb5285c23fceb100ea7c6f61cab6abd6bca23a6 100644 (file)
@@ -2,16 +2,17 @@
  *
  *
  * CMDNAME: permban
+ * CMDALIASES: ban
  * CMDLEVEL: QCMD_AUTHED
  * CMDARGS: 3
  * CMDDESC: Permanently bans a hostmask on a channel.
  * CMDFUNC: csc_dopermban
  * CMDPROTO: int csc_dopermban(void *source, int cargc, char **cargv);
- * CMDHELP: Usage: PERMBAN <channel> <hostmask> [<reason>]
+ * CMDHELP: Usage: @UCOMMAND@ <channel> <hostmask> [<reason>]
  * CMDHELP: Permanently bans the provided hostmask on the channel.  If the ban is
  * CMDHELP: removed from the channel e.g. by a channel op or the BANTIMER feature, the
  * CMDHELP: ban will be reapplied if a matching user joins the channel.  Bans
- * CMDHELP: set with the PERMBAN command can be removed via BANCLEAR or BANDEL.  Any users
+ * CMDHELP: set with the @UCOMMAND@ command can be removed with BANCLEAR or BANDEL.  Any users
  * CMDHELP: matching the hostmask will be kicked from the channel.
  * CMDHELP: Where:
  * CMDHELP: channel  - channel to set a ban on
@@ -19,7 +20,7 @@
  * CMDHELP: reason   - reason for the ban.  This will be used in kick messages when kicking
  * CMDHELP:            users matching the ban.  If this is not provided the generic message
  * CMDHELP:            \"Banned.\" will be used.
- * CMDHELP: PERMBAN requires master (+m) access on the named channel.
+ * CMDHELP: @UCOMMAND@ requires master (+m) access on the named channel.
  */
 
 #include "../chanserv.h"
@@ -84,9 +85,13 @@ int csc_dopermban(void *source, int cargc, char **cargv) {
   }
 
   if(count >= MAXBANS) {
-    freechanban(b);
-    chanservstdmessage(sender, QM_TOOMANYBANS);
-    return CMD_ERROR;
+    /* HACK: oper founder channels have 20x the ban limit */
+    reguser *founder=findreguserbyID(rcp->founder);
+    if(!founder || !UHasOperPriv(founder) || count >= MAXBANS * 20) {
+      freechanban(b);
+      chanservstdmessage(sender, QM_TOOMANYBANS);
+      return CMD_ERROR;
+    }
   }
 
   if(toreplace) {