Ver código fonte

* Add chanint 'ban-type' with a default of 3

Bryan Drewery 17 anos atrás
pai
commit
41580f2af3

+ 2 - 0
doc/UPDATES

@@ -1,3 +1,5 @@
+* Add new channel setting 'ban-type' which support mIRC style ban types (adapted from recent eggdrop patch)
+
 1.2.17 - http://wraith.botpack.net/milestone/1.2.17
 * Binary pass prompt has been changed to be more clear.
 * Fix uname checking on NetBSD and OpenBSD

+ 1 - 0
src/chan.h

@@ -175,6 +175,7 @@ struct chanset_t {
   int mdop;
   int mop;
   int voice_non_ident;
+  int ban_type;
   interval_t auto_delay;
 /* Chanint template 
  *int temp;

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

@@ -1250,6 +1250,7 @@ static void cmd_chaninfo(int idx, char *par)
     SHOW_INT("Auto-delay: ", chan->auto_delay, NULL, "None");
     SHOW_INT("Bad-cookie:" , chan->bad_cookie, P_STR, "Ignore");
     SHOW_INT("Ban-time: ", chan->ban_time, NULL, "Forever");
+    SHOW_INT("Ban-type: ", chan->ban_type, NULL, "3");
     SHOW_INT("Closed-ban: ", chan->closed_ban, NULL, "Don't!");
     SHOW_INT("Closed-invite:", chan->closed_invite, NULL, "Don't!");
     SHOW_INT("Closed-Private:", chan->closed_private, NULL, "Don't!");

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

@@ -508,6 +508,14 @@ int channel_modify(char *result, struct chanset_t *chan, int items, char **item,
         return ERROR;
       }
       chan->auto_delay = atoi(item[i]);
+    } else if (!strcmp(item[i], "ban-type")) {
+      i++;
+      if (i >= items) {
+        if (result)
+          strlcpy(result, "channel ban-type needs argument", RESULT_LEN);
+        return ERROR;
+      }
+      chan->ban_type = atoi(item[i]);
      
 
 /* Chanint template
@@ -918,6 +926,7 @@ int channel_add(char *result, char *newname, char *options)
     chan->closed_invite = 1;
     chan->voice_non_ident = 1;
     chan->auto_delay = 5;
+    chan->ban_type = 3;
 /* Chanint template
  *  chan->temp = 0;
  */

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

@@ -748,7 +748,7 @@ bool write_chans(FILE *f, int idx)
 
     if (lfprintf(f, "\
 + channel add %s { chanmode { %s } addedby %s addedts %li \
-bad-cookie %d manop %d mdop %d mop %d limit %d \
+bad-cookie %d manop %d mdop %d mop %d limit %d ban-type %d \
 flood-chan %d:%d flood-ctcp %d:%d flood-join %d:%d \
 flood-kick %d:%d flood-deop %d:%d flood-nick %d:%d flood-mjoin %d:%d \
 closed-ban %d closed-invite %d closed-private %d ban-time %d \
@@ -771,6 +771,7 @@ flood-exempt %d flood-lock-time %d \
 	chan->mdop,
 	chan->mop,
         chan->limitraise,
+        chan->ban_type,
 	chan->flood_pub_thr, chan->flood_pub_time,
         chan->flood_ctcp_thr, chan->flood_ctcp_time,
         chan->flood_join_thr, chan->flood_join_time,

+ 1 - 1
src/set.c

@@ -37,7 +37,7 @@ int dcc_autoaway;
 bool irc_autoaway;
 bool link_cleartext;
 bool dccauth = 0;
-char *def_chanset = "+enforcebans +dynamicbans +userbans -bitch +cycle -inactive +userexempts -dynamicexempts +userinvites -dynamicinvites -nodesynch -closed -take -voice -private -fastop +meankicks";
+char *def_chanset = "+enforcebans +dynamicbans +userbans -bitch +cycle -inactive +userexempts -dynamicexempts +userinvites -dynamicinvites -nodesynch -closed -take -voice -private -fastop +meankicks ban-type 3";
 int cloak_script = 0;
 rate_t close_threshold;
 int fight_threshold;