]> jfr.im git - irc/quakenet/newserv.git/commitdiff
More cleanups.
authorsplidge <redacted>
Fri, 7 Mar 2008 19:19:34 +0000 (19:19 +0000)
committersplidge <redacted>
Fri, 7 Mar 2008 19:19:34 +0000 (19:19 +0000)
Fixed BANLIST (was trying to list bans on non-existent channel)
Added some sanity checking to TEMPBAN's duration parameter.
Added some help text.

13 files changed:
chanserv/chancmds/addchan.c
chanserv/chancmds/adduser.c
chanserv/chancmds/autolimit.c
chanserv/chancmds/banclear.c
chanserv/chancmds/bandel.c
chanserv/chancmds/banlist.c
chanserv/chancmds/bantimer.c
chanserv/chancmds/chanlev.c
chanserv/chancmds/commandlist.c
chanserv/chancmds/op.c
chanserv/chancmds/tempban.c
chanserv/chanserv.h
chanserv/database/chanservdb_messages.c

index cdd04b7dddd9a114fcbb1e505b714923a5201c20..3d7b24e8430dd1bbdccc19626ed2c832e5ee25b1 100644 (file)
@@ -7,6 +7,13 @@
  * CMDDESC: Adds a new channel to the bot.
  * CMDFUNC: csc_doaddchan
  * CMDPROTO: int csc_doaddchan(void *source, int cargc, char **cargv);
+ * CMDHELP: Usage: addchan <channel> [<owner> [<flags> [<type>]]]
+ * CMDHELP: Adds the given channel to the bot, where:
+ * CMDHELP: owner - can be either nickname on the network or #authname.  If not supplied,
+ * CMDHELP:         the channel will belong to the user issuing the ADDCHAN command.
+ * CMDHELP: flags - can be any valid chanflags (see CHANFLAGS).  If not specified this 
+ * CMDHELP:         defaults to +j.
+ * CMDHELP: type  - is a channel type as per old Q and is now obsolete.
  */
 
 #include "../chanserv.h"
@@ -54,7 +61,7 @@ int csc_doaddchan(void *source, int cargc, char **cargv) {
     flags=0;
     setflags(&flags, QCFLAG_ALL, cargv[2], rcflags, REJECT_NONE);    
   } else {
-    flags = (QCFLAG_JOINED | QCFLAG_BITCH | QCFLAG_PROTECT | QCFLAG_ENFORCE);
+    flags = (QCFLAG_JOINED);
   }
   
   /* Pick up the chantype */
@@ -105,7 +112,7 @@ int csc_doaddchan(void *source, int cargc, char **cargv) {
   rcp->banstyle=0;
   
   rcp->created=rcp->lastactive=rcp->statsreset=rcp->ostatsreset=time(NULL);
-  rcp->banduration=1800;
+  rcp->banduration=0;
   rcp->autoupdate=0;
   rcp->lastbancheck=0;
   
index 965d032a160c0ba94fa6139b3cec5d0832453305..e0276b9466b304f5d5fe32bafa2c2e8f4b12ec2e 100644 (file)
@@ -7,6 +7,13 @@
  * CMDDESC: Adds one or more users to a channel as +aot.
  * CMDFUNC: csc_doadduser
  * CMDPROTO: int csc_doadduser(void *source, int cargc, char **cargv);
+ * CMDHELP: Usage: ADDUSER <channel> <user1> [<user2> [<user3> [...]]]
+ * CMDHELP: Adds the named user(s) to the channel with +aot chanlev flags (see CHANLEV).  
+ * CMDHELP: Where:
+ * CMDHELP: channel - the channel to use
+ * CMDHELP: user<n> - either a user's current nickname on the network or #accountname. Up to
+ * CMDHELP:           18 users can be specified.
+ * CMDHELP: ADDUSER requires master (+m) access on the named channel.
  */
 
 #include "../chanserv.h"
index 6427017cff98a94f46532d4b33f7fa1b50c702b2..044ec18513c87b04e054acda155477406c982a2b 100644 (file)
@@ -7,6 +7,14 @@
  * CMDDESC: Shows or changes the autolimit threshold on a channel.
  * CMDFUNC: csc_doautolimit
  * CMDPROTO: int csc_doautolimit(void *source, int cargc, char **cargv);
+ * CMDHELP: Usage: AUTOLIMIT <channel> [<threshold>]
+ * CMDHELP: This command shows or changes the number of free slots to keep on the channel
+ * CMDHELP: when autolimit (see CHANFLAGS) is enabled.  Where:
+ * CMDHELP: channel   - the channel to use.
+ * CMDHELP: threshold - specifies the new threshold.  If not specified, the current threshold 
+ * CMDHELP:             is displayed.
+ * CMDHELP: Viewing the current threshold requires operator (+o) access on the named channel.
+ * CMDHELP: Updating the threshold requires master (+m) access on the named channel.
  */
 
 #include "../chanserv.h"
index 9024e480eb86475b0b509cafa75acda2c50cc753..f883519a4bf1b9524e7e71c709453e599975ba85 100644 (file)
@@ -7,6 +7,10 @@
  * CMDDESC: Removes all bans from a channel including persistent bans.
  * CMDFUNC: csc_dobanclear
  * CMDPROTO: int csc_dobanclear(void *source, int cargc, char **cargv);
+ * CMDHELP: Usage: BANCLEAR <channel>
+ * CMDHELP: Removes all temporary and persistent bans from a channel, where:
+ * CMDHELP: channel - the channel to use
+ * CMDHELP: BANCLEAR requires master (+m) access on the named channel.
  */
 
 #include "../chanserv.h"
index 3361be90c9533a64f915d10f799287c5de2a91d7..0d53a41707764bb3eec5da4f481de3d70e83d595 100644 (file)
@@ -7,6 +7,12 @@
  * CMDDESC: Removes a single ban from a channel.
  * CMDFUNC: csc_dobandel
  * CMDPROTO: int csc_dobandel(void *source, int cargc, char **cargv);
+ * CMDHELP: Usage: BANDEL <channel> <ban>
+ * CMDHELP: Removes the specified persistent or channel ban, where:
+ * CMDHELP: channel - the channel to use
+ * CMDHELP: ban     - either a ban mask (nick!user@host), or #number (see BANLIST)
+ * CMDHELP: Removing channel bans requires operator (+o) access on the named channel.
+ * CMDHELP: Removing persistent bans requires master (+m) access on the named channel.
  */
 
 #include "../chanserv.h"
index e442e1d2539d644ac158a288d1d81226778623e9..a705eee57bac4cd359edb03c2c09aad41e9f0700 100644 (file)
@@ -7,6 +7,13 @@
  * CMDDESC: Displays all persistent bans on a channel.
  * CMDFUNC: csc_dobanlist
  * CMDPROTO: int csc_dobanlist(void *source, int cargc, char **cargv);
+ * CMDHELP: Usage: BANLIST <channel>
+ * CMDHELP: Displays a list of persistent and channel bans on the named channel.  Each ban
+ * CMDHELP: is identified by a number which can be passed to a subsequent BANDEL command.
+ * CMDHELP: Note that the numbers can change if bans are added to or removed from the 
+ * CMDHELP: chennel. Where:
+ * CMDHELP: channel - the channel to use
+ * CMDHELP: BANLIST requires operator (+o) access on the named channel.
  */
 
 #include "../chanserv.h"
@@ -49,20 +56,22 @@ int csc_dobanlist(void *source, int cargc, char **cargv) {
                          rup?rup->username:"<unknown>",
                          rbp->reason?rbp->reason->content:"");
     }
-    for (cbp=cip->channel->bans;cbp;cbp=cbp->next) {
-      for (rbp=rcp->bans;rbp;rbp=rbp->next) {
-       if (banequal(rbp->cbp, cbp))
-         break;
-      }
-      if (!rbp) {
-       if (rcp->banduration) {
-         exp=(cbp->timeset + rcp->banduration) - time(NULL);
-       } else {
-         exp=0;
-       } 
-       chanservsendmessage(sender, " #%-2d %-29s %-18s %-15s",++i,bantostring(cbp),
-                           exp ? longtoduration(exp,0) : "Permanent",
-                           "(channel ban)");
+    if (cip->channel) {
+      for (cbp=cip->channel->bans;cbp;cbp=cbp->next) {
+        for (rbp=rcp->bans;rbp;rbp=rbp->next) {
+          if (banequal(rbp->cbp, cbp))
+           break;
+        }
+        if (!rbp) {
+         if (rcp->banduration) {
+           exp=(cbp->timeset + rcp->banduration) - time(NULL);
+          } else {
+           exp=0;
+          } 
+          chanservsendmessage(sender, " #%-2d %-29s %-18s %-15s",++i,bantostring(cbp),
+                             exp ? longtoduration(exp,0) : "Permanent",
+                             "(channel ban)");
+        }
       }
     }
     chanservstdmessage(sender, QM_ENDOFLIST);
index 204d9d55bd8ef0b4b8e1c4d01be9d25e9e8c9900..e45f48e93deb48626a0cfd35e4bd32f50f0ab592 100644 (file)
@@ -7,6 +7,16 @@
  * CMDDESC: Shows or changes the time after which bans are removed.
  * CMDFUNC: csc_dobantimer
  * CMDPROTO: int csc_dobantimer(void *source, int cargc, char **cargv);
+ * CMDHELP: Usage: BANTIMER <channel> [<duration>]
+ * CMDHELP: To help keep channels clear of the clutter of too many bans, Q can automatically
+ * CMDHELP: remove channel bans after a specified time.  This command is used to alter that
+ * CMDHELP: time period, disable the feature, or show the current setting, where:
+ * CMDHELP: channel  - the channel to use
+ * CMDHELP: duration - how long to remove channel bans after.  If duration is 0 then channel
+ * CMDHELP:            bans will not be automatically removed.  If duration is not specified,
+ * CMDHELP:            the current setting will be displayed.
+ * CMDHELP: Viewing the current setting requires operator (+o) access on the named channel.
+ * CMDHELP: Changing the setting requires master (+m) access on the named channel.
  */
 
 #include "../chanserv.h"
index 536fecae8fd42511e58502e07f82bec9719cde94..119dabeb1cad88ce926f8184ae9c5ec561617ad1 100644 (file)
@@ -7,13 +7,24 @@
  * CMDDESC: Shows or modifies user access on a channel.
  * CMDFUNC: csc_dochanlev
  * CMDPROTO: int csc_dochanlev(void *source, int cargc, char **cargv);
- * CMDHELP: Usage: chanlev <#channel> [<user> [<flag change>]]
- * CMDHELP:  where <user> is either nickname on the network or #accountname.
- * CMDHELP: If only a channel name is supplied, list registered users on the channel.
- * CMDHELP: If a user is also specified, shows that user's access on the channel.
- * CMDHELP: If a change string is specified, the flags for that user are changed, provided
- * CMDHELP: you have sufficient access on the channel to do so.  This can be used to add or
- * CMDHELP: remove users from the channel.
+ * CMDHELP: Usage: CHANLEV <channel> [<user> [<change>]]
+ * CMDHELP: Displays or alters the access of known users on a channel, where:
+ * CMDHELP: channel - the channel to use
+ * CMDHELP: user    - the user to list or modify.  user can be specified as either an active
+ * CMDHELP:           nickname on the network or #accountname.  If user is not specified then
+ * CMDHELP:           all known users are listed.
+ * CMDHELP: change  - lists the flags to add or remove, with + to add or - to remove.  For
+ * CMDHELP:           example, +ao to add a and o flags, or -gv to remove g and v flags.  This 
+ * CMDHELP:           can be used to add or remove users from the channel.  If change is not
+ * CMDHELP:           specified then the current access of the named user is displayed.
+ * CMDHELP: Displaying known user information requires you to be known (+k) on the named channel.
+ * CMDHELP: Adjusting flags for other users requires master (+m) access on the named channel.
+ * CMDHELP: Adding or removing the +m flag for other users requires owner (+n) access on the 
+ * CMDHELP:  named channel.
+ * CMDHELP: You may always remove your own flags, except +qdb flags (which are not visible to you).
+ * CMDHELP: Adding or removing personal flags requires you to be known (+k) on the named channel.
+ * CMDHELP: Note that channel owners (+n) can grant +n to channel masters but they must use 
+ * CMDHELP: the GIVEOWNER command for this.
  * CMDHELP: Valid flags are:
  * CMDHELP: Access level flags - these control your overall privilege level on the channel:
  * CMDHELP:  +n OWNER     Can add or remove masters and all other flags (except personal flags)
  * CMDHELP:               that status, they will be reopped/voiced if deopped/voiced
  * CMDHELP:  +t TOPIC     Can use SETTOPIC to alter the topic on the channel
  * CMDHELP: Personal flags - these control user personal preferences and can only be changed
- * CMDHELP:                  by the user concerned.  You need to be known on the channel (hold +k, 
- * CMDHELP:                  +v, +o, +m or +n) in order to set personal flags.
+ * CMDHELP:                  by the user concerned.  They are not visible to other users.
  * CMDHELP:  +w NOWELCOME Prevents the welcome message being sent when you join the channel.
  * CMDHELP:  +j AUTOINV   Invites you to the channel automatically when you authenticate.
- * CMDHELP: Note that channel owners (+n) can grant +n to channel masters but they must use 
- * CMDHELP: the the GIVEOWNER command for this.
- * CMDHELP: Non-sensible combinations of flags are not allowed.
+ * CMDHELP: Note that non-sensible combinations of flags are not allowed.  After making a 
+ * CMDHELP: change the current status of the named user on the channel will be confirmed.
  */
 
 #include "../chanserv.h"
@@ -106,7 +115,7 @@ int csc_dochanlev(void *source, int cargc, char **cargv) {
              QCUFLAG_AUTOOP | QCUFLAG_TOPIC | QCUFLAG_PROTECT | QCUFLAG_KNOWN);
   
   /* masters and above can see everything except personal flags */
-  if (CUHasMasterPriv(rcup)) {
+  if (rcup && CUHasMasterPriv(rcup)) {
     flagmask = QCUFLAG_ALL & ~QCUFLAGS_PERSONAL;
     showtimes=1;
   }
index 8aa4b3eae421ecf1a28e2f898bee9003c058c2d4..514093460f71fef63718dc69a844d6987bd00b2d 100644 (file)
@@ -43,15 +43,15 @@ int csc_dovoice(void *source, int cargc, char **cargv);
 int csc_dowelcome(void *source, int cargc, char **cargv);
 
 void _init() {
-  chanservaddcommand("addchan", QCMD_OPER, 4, csc_doaddchan, "Adds a new channel to the bot.", "");
-  chanservaddcommand("adduser", QCMD_AUTHED, 20, csc_doadduser, "Adds one or more users to a channel as +aot.", "");
-  chanservaddcommand("autolimit", QCMD_AUTHED, 2, csc_doautolimit, "Shows or changes the autolimit threshold on a channel.", "");
-  chanservaddcommand("banclear", QCMD_AUTHED, 1, csc_dobanclear, "Removes all bans from a channel including persistent bans.", "");
-  chanservaddcommand("bandel", QCMD_AUTHED, 2, csc_dobandel, "Removes a single ban from a channel.", "");
-  chanservaddcommand("banlist", QCMD_AUTHED, 1, csc_dobanlist, "Displays all persistent bans on a channel.", "");
-  chanservaddcommand("bantimer", QCMD_AUTHED, 2, csc_dobantimer, "Shows or changes the time after which bans are removed.", "");
+  chanservaddcommand("addchan", QCMD_OPER, 4, csc_doaddchan, "Adds a new channel to the bot.", "Usage: addchan <channel> [<owner> [<flags> [<type>]]]\nAdds the given channel to the bot, where:\nowner - can be either nickname on the network or #authname.  If not supplied,\n        the channel will belong to the user issuing the ADDCHAN command.\nflags - can be any valid chanflags (see CHANFLAGS).  If not specified this \n        defaults to +j.\ntype  - is a channel type as per old Q and is now obsolete.\n");
+  chanservaddcommand("adduser", QCMD_AUTHED, 20, csc_doadduser, "Adds one or more users to a channel as +aot.", "Usage: ADDUSER <channel> <user1> [<user2> [<user3> [...]]]\nAdds the named user(s) to the channel with +aot chanlev flags (see CHANLEV).  \nWhere:\nchannel - the channel to use\nuser<n> - either a user's current nickname on the network or #accountname. Up to\n          18 users can be specified.\nADDUSER requires master (+m) access on the named channel.\n");
+  chanservaddcommand("autolimit", QCMD_AUTHED, 2, csc_doautolimit, "Shows or changes the autolimit threshold on a channel.", "Usage: AUTOLIMIT <channel> [<threshold>]\nThis command shows or changes the number of free slots to keep on the channel\nwhen autolimit (see CHANFLAGS) is enabled.  Where:\nchannel   - the channel to use.\nthreshold - specifies the new threshold.  If not specified, the current threshold \n            is displayed.\nViewing the current threshold requires operator (+o) access on the named channel.\nUpdating the threshold requires master (+m) access on the named channel.\n");
+  chanservaddcommand("banclear", QCMD_AUTHED, 1, csc_dobanclear, "Removes all bans from a channel including persistent bans.", "Usage: BANCLEAR <channel>\nRemoves all temporary and persistent bans from a channel, where:\nchannel - the channel to use\nBANCLEAR requires master (+m) access on the named channel.\n");
+  chanservaddcommand("bandel", QCMD_AUTHED, 2, csc_dobandel, "Removes a single ban from a channel.", "Usage: BANDEL <channel> <ban>\nRemoves the specified persistent or channel ban, where:\nchannel - the channel to use\nban     - either a ban mask (nick!user@host), or #number (see BANLIST)\nRemoving channel bans requires operator (+o) access on the named channel.\nRemoving persistent bans requires master (+m) access on the named channel.\n");
+  chanservaddcommand("banlist", QCMD_AUTHED, 1, csc_dobanlist, "Displays all persistent bans on a channel.", "Usage: BANLIST <channel>\nDisplays a list of persistent and channel bans on the named channel.  Each ban\nis identified by a number which can be passed to a subsequent BANDEL command.\nNote that the numbers can change if bans are added to or removed from the \nchennel. Where:\nchannel - the channel to use\nBANLIST requires operator (+o) access on the named channel.\n");
+  chanservaddcommand("bantimer", QCMD_AUTHED, 2, csc_dobantimer, "Shows or changes the time after which bans are removed.", "Usage: BANTIMER <channel> [<duration>]\nTo help keep channels clear of the clutter of too many bans, Q can automatically\nremove channel bans after a specified time.  This command is used to alter that\ntime period, disable the feature, or show the current setting, where:\nchannel  - the channel to use\nduration - how long to remove channel bans after.  If duration is 0 then channel\n           bans will not be automatically removed.  If duration is not specified,\n           the current setting will be displayed.\nViewing the current setting requires operator (+o) access on the named channel.\nChanging the setting requires master (+m) access on the named channel.\n");
   chanservaddcommand("chanflags", QCMD_AUTHED, 2, csc_dochanflags, "Shows or changes the flags on a channel.", "");
-  chanservaddcommand("chanlev", QCMD_AUTHED, 3, csc_dochanlev, "Shows or modifies user access on a channel.", "Usage: chanlev <#channel> [<user> [<flag change>]]\n where <user> is either nickname on the network or #accountname.\nIf only a channel name is supplied, list registered users on the channel.\nIf a user is also specified, shows that user's access on the channel.\nIf a change string is specified, the flags for that user are changed, provided\nyou have sufficient access on the channel to do so.  This can be used to add or\nremove users from the channel.\nValid flags are:\nAccess level flags - these control your overall privilege level on the channel:\n +n OWNER     Can add or remove masters and all other flags (except personal flags)\n +m MASTER    Can add or remove all access except master or owner\n +o OP        Can get ops on the channel\n +v VOICE     Can get voice on the channel\n +k KNOWN     Known on the channel - can get invites to the channel via INVITE\n +q DEVOICE   Not allowed to be voiced on the channel\n +d DEOP      Not allowed to be opped on the channel\n +b BANNED    Banned from the channel\nExtra flags - these control specific behaviour on the channel:\n +a AUTOOP    Ops the user automatically when they join the channel (the user \n              must also hold +o in order to have this flag)\n +g AUTOVOICE Voices the user automatically when they join the channel (the \n              user must also hold +v in order to have this flag)\n +p PROTECT   If the user has +o or +v, this makes sure they will always have\n              that status, they will be reopped/voiced if deopped/voiced\n +t TOPIC     Can use SETTOPIC to alter the topic on the channel\nPersonal flags - these control user personal preferences and can only be changed\n                 by the user concerned.  You need to be known on the channel (hold +k, \n                 +v, +o, +m or +n) in order to set personal flags.\n +w NOWELCOME Prevents the welcome message being sent when you join the channel.\n +j AUTOINV   Invites you to the channel automatically when you authenticate.\nNote that channel owners (+n) can grant +n to channel masters but they must use \nthe the GIVEOWNER command for this.\nNon-sensible combinations of flags are not allowed.\n");
+  chanservaddcommand("chanlev", QCMD_AUTHED, 3, csc_dochanlev, "Shows or modifies user access on a channel.", "Usage: CHANLEV <channel> [<user> [<change>]]\nDisplays or alters the access of known users on a channel, where:\nchannel - the channel to use\nuser    - the user to list or modify.  user can be specified as either an active\n          nickname on the network or #accountname.  If user is not specified then\n          all known users are listed.\nchange  - lists the flags to add or remove, with + to add or - to remove.  For\n          example, +ao to add a and o flags, or -gv to remove g and v flags.  This \n          can be used to add or remove users from the channel.  If change is not\n          specified then the current access of the named user is displayed.\nDisplaying known user information requires you to be known (+k) on the named channel.\nAdjusting flags for other users requires master (+m) access on the named channel.\nAdding or removing the +m flag for other users requires owner (+n) access on the \n named channel.\nYou may always remove your own flags, except +qdb flags (which are not visible to you).\nAdding or removing personal flags requires you to be known (+k) on the named channel.\nNote that channel owners (+n) can grant +n to channel masters but they must use \nthe GIVEOWNER command for this.\nValid flags are:\nAccess level flags - these control your overall privilege level on the channel:\n +n OWNER     Can add or remove masters and all other flags (except personal flags)\n +m MASTER    Can add or remove all access except master or owner\n +o OP        Can get ops on the channel\n +v VOICE     Can get voice on the channel\n +k KNOWN     Known on the channel - can get invites to the channel via INVITE\n +q DEVOICE   Not allowed to be voiced on the channel\n +d DEOP      Not allowed to be opped on the channel\n +b BANNED    Banned from the channel\nExtra flags - these control specific behaviour on the channel:\n +a AUTOOP    Ops the user automatically when they join the channel (the user \n              must also hold +o in order to have this flag)\n +g AUTOVOICE Voices the user automatically when they join the channel (the \n              user must also hold +v in order to have this flag)\n +p PROTECT   If the user has +o or +v, this makes sure they will always have\n              that status, they will be reopped/voiced if deopped/voiced\n +t TOPIC     Can use SETTOPIC to alter the topic on the channel\nPersonal flags - these control user personal preferences and can only be changed\n                 by the user concerned.  They are not visible to other users.\n +w NOWELCOME Prevents the welcome message being sent when you join the channel.\n +j AUTOINV   Invites you to the channel automatically when you authenticate.\nNote that non-sensible combinations of flags are not allowed.  After making a \nchange the current status of the named user on the channel will be confirmed.\n");
   chanservaddcommand("chanlevhistory", QCMD_HELPER, 2, csc_dochanlevhistory, "View user access changes on a channel.", "");
   chanservaddcommand("chanmode", QCMD_AUTHED, 4, csc_dochanmode, "Shows which modes are forced or denied on a channel.", "");
   chanservaddcommand("channelcomment", QCMD_OPER, 2, csc_dochannelcomment, "Shows or changes the staff comment for a channel.", "");
index 36afc98c7e21bd24951908101bcbf3fc5f665608..752178aed38bfd9891a0637b263588d4785c56d7 100644 (file)
@@ -30,6 +30,8 @@ int csc_doop(void *source, int cargc, char **cargv) {
   unsigned long *lp;
   int i;
   modechanges changes;
+  int donotice=0;
+  char buf[512], bufpos=0;
 
   if (!rup)
     return CMD_ERROR;
@@ -79,8 +81,8 @@ int csc_doop(void *source, int cargc, char **cargv) {
   }
 
   /* You've got to be a master to 'silently' op other people */
-  if (!cs_checkaccess(sender, NULL, CA_MASTERPRIV, cip, "op", 0, 0))
-    return CMD_ERROR;
+  if (!cs_checkaccess(sender, NULL, CA_MASTERPRIV, cip, "op", 0, 1))
+    donotice=1;
 
   /* Set up the modes */
   localsetmodeinit(&changes, cip->channel, chanservnick);
@@ -113,9 +115,14 @@ int csc_doop(void *source, int cargc, char **cargv) {
       continue;
     }
 
+    bufpos += sprintf(buf+bufpos,"%s%s",bufpos?", ":"",np->nick);
     localdosetmode_nick(&changes, np, MC_OP);
   }
 
+  if (donotice && bufpos) {
+    sendopnoticetochannel(chanservnick, cip->channel, "%s opped %s", sender, buf);
+  }
+      
   localsetmodeflush(&changes, 1);
   chanservstdmessage(sender, QM_DONE);
 
index 194a0b94c0d5d1968b1f8b2ac6d8b56d29d3f0e4..aa23caa1f8aee3d65d4c23390ab50637c7f6eb7f 100644 (file)
@@ -39,6 +39,10 @@ int csc_dotempban(void *source, int cargc, char **cargv) {
   rcp=cip->exts[chanservext];
 
   duration=durationtolong(cargv[2]);
+  if (duration > 400000000) {
+    chanservstdmessage(sender, QM_DURATIONTOOLONG, cargv[2]);
+    return CMD_ERROR;
+  }
   
   rbp=getregban();
   rbp->ID=++lastbanID;
index 2ffd5400031974ef41a5f522b103f3f11bc8cba5..bdaaec4dc04106cc2e2296e6e0d3df84f3ff256a 100644 (file)
 #define QM_PWDONTMATCH              85
 #define QM_PWTOSHORT                86
 #define QM_PWCHANGED                87
-#define UNUSED_1                    88
+#define QM_DURATIONTOOLONG          88
 #define QM_EMAILCHANGED             89
 #define QM_EMAILDONTMATCH           90
 #define QM_INVALIDEMAIL             91
index ddb235dc127aa0860a4b8b590482e2c21483d225..66f0e88446ec25a9b0f7f58cb754e58e6a19a58f 100644 (file)
@@ -96,7 +96,7 @@ char *defaultmessages[MAXMESSAGES] = {
   /* 85 */ "Sorry, but passwords do not match",
   /* 86 */ "Sorry, but new password is to short",
   /* 87 */ "Ok, password changed",
-  /* 88 */ "UNUSED_1",
+  /* 88 */ "Duration too long or invalid: %s",
   /* 89 */ "Ok, email changed to \"%s\"",
   /* 90 */ "Sorry, but first and second email addresses don't match",
   /* 91 */ "%s is not a valid email address",