Parcourir la source

* Add chanset '+/-voicebitch' for a +bitch style enforcement over voices.

Bryan Drewery il y a 16 ans
Parent
commit
87e7a86fd8

+ 1 - 0
doc/UPDATES

@@ -1,4 +1,5 @@
 * Fix case where bot would not get the +e and +I lists when getting opped.
+* Add chanset '+/-voicebitch' for a +bitch style enforcement over voices.
 
 1.3 - http://wraith.botpack.net/milestone/1.3
 * Binary / shell / startup changes

+ 3 - 0
doc/help.txt

@@ -496,6 +496,9 @@ See also: link
                        unless they are +q globally or +q for the channel.
                        If a botnet master devoices them, they will remain 
                        devoiced no matter who voices them.
+        $bvoicebitch$b     Enforce voices in a +bitch style. Only +v users
+                       will be allowed to be voiced. This does take +private
+                       into mind as well.
         $bdynamicbans$b    Only activate bans on the channel when necessary?
                        This keeps the channel's ban list from getting
                        excessively long. The bot still remembers every ban,

+ 2 - 0
src/chan.h

@@ -249,6 +249,7 @@ struct chanset_t {
 #define CHAN_FLAGGED        BIT22	/* flagged during rehash for delete   */
 #define CHAN_AUTOOP         BIT23
 #define CHAN_MEANKICKS      BIT24	/* use mean/offensive kicks/bans */
+#define CHAN_VOICEBITCH     BIT25
 
 #define CHAN_ASKED_EXEMPTS  BIT0
 #define CHAN_ASKED_INVITES  BIT1
@@ -308,6 +309,7 @@ struct chanset_t *findchan_by_dname(const char *name);
 #define channel_nomassjoin(chan) (chan->status & CHAN_NOMASSJOIN)
 #define channel_meankicks(chan) (chan->status & CHAN_MEANKICKS)
 #define channel_rbl(chan) (chan->status & CHAN_RBL)
+#define channel_voicebitch(chan) (chan->status & CHAN_VOICEBITCH)
 /* Chanflag template
  *#define channel_temp(chan) (chan->status & CHAN_PRIVATE)
  */

+ 2 - 0
src/mod/channels.mod/channels.c

@@ -883,6 +883,8 @@ void channels_report(int idx, int details)
           i += my_strcpy(s + i, "meankicks ");
         if (channel_rbl(chan))
           i += my_strcpy(s + i, "rbl ");
+        if (channel_voicebitch(chan))
+          i += my_strcpy(s + i, "voicebitch ");
 /* Chanflag template
  *	if (channel_temp(chan))
  *	  i += my_strcpy(s + i, "temp ");

+ 1 - 0
src/mod/channels.mod/cmdschan.c

@@ -1255,6 +1255,7 @@ static void cmd_chaninfo(int idx, char *par)
     if (HAVE_TAKE)
       SHOW_FLAG("take",		channel_take(chan));
     SHOW_FLAG("voice",		channel_voice(chan));
+    SHOW_FLAG("voicebitch",		channel_voicebitch(chan));
     SHOW_FLAG("", 0);
     SHOW_FLAG("dynamicbans",	channel_dynamicbans(chan));
     SHOW_FLAG("userbans",	!channel_nouserbans(chan));

+ 4 - 0
src/mod/channels.mod/tclchan.c

@@ -642,6 +642,10 @@ int channel_modify(char *result, struct chanset_t *chan, int items, char **item,
       chan->status |= CHAN_RBL;
     else if (!strcmp(item[i], "-rbl"))
       chan->status &= ~CHAN_RBL;
+    else if (!strcmp(item[i], "+voicebitch"))
+      chan->status |= CHAN_VOICEBITCH;
+    else if (!strcmp(item[i], "-voicebitch"))
+      chan->status &= ~CHAN_VOICEBITCH;
 /* Chanflag template
  *  else if (!strcmp(item[i], "+temp"))
  *    chan->status |= CHAN_TEMP;

+ 2 - 1
src/mod/channels.mod/userchan.c

@@ -734,7 +734,7 @@ flood-exempt %d flood-lock-time %d knock %d \
 %cmeankicks %cenforcebans %cdynamicbans %cuserbans %cbitch \
 %cprivate %ccycle %cinactive %cdynamicexempts %cuserexempts \
 %cdynamicinvites %cuserinvites %cnodesynch %cclosed %cvoice \
-%cfastop %cautoop %cbotbitch %cbackup %cnomassjoin %crbl %c%s",
+%cfastop %cautoop %cbotbitch %cbackup %cnomassjoin %crbl %cvoicebitch %c%s",
 	w,
 /* Chanchar template
  *      temp,
@@ -789,6 +789,7 @@ flood-exempt %d flood-lock-time %d knock %d \
         PLSMNS(channel_backup(chan)),
         PLSMNS(channel_nomassjoin(chan)),
         PLSMNS(channel_rbl(chan)),
+        PLSMNS(channel_voicebitch(chan)),
 	HAVE_TAKE ? PLSMNS(channel_take(chan)) : ' ',
         HAVE_TAKE ? "take " : " "
 /* Chanflag template