فهرست منبع

* New channels are now closed-private 1 by default
* Added closed-invite to allow disabling +i for +closed chans


svn: 1425

Bryan Drewery 21 سال پیش
والد
کامیت
f1faf738b8
8فایلهای تغییر یافته به همراه21 افزوده شده و 4 حذف شده
  1. 2 0
      doc/UPDATES
  2. 2 0
      misc/help.txt
  3. 1 0
      src/chan.h
  4. 2 1
      src/mod/channels.mod/channels.c
  5. 1 0
      src/mod/channels.mod/cmdschan.c
  6. 10 1
      src/mod/channels.mod/tclchan.c
  7. 2 1
      src/mod/channels.mod/userchan.c
  8. 1 1
      src/mod/irc.mod/chan.c

+ 2 - 0
doc/UPDATES

@@ -55,6 +55,8 @@ This is a summary of ChangeLog basically.
 * After changing conf with -C, binary is now moved to binpath/binname.
 * 'strict-host' is now '1'; ident is now parsed CORRECTLY, *!ident@host will no longer match *!~ident@host.
 * cmd_su allowed su'ing to a permanent owner.
+* New channels are now default closed-private = 1
+* Added chanint closed-invite, when set to 0, channel will NOT be +i.
 
 1.1.9
 

+ 2 - 0
misc/help.txt

@@ -386,6 +386,8 @@ See also: link
         $bclosed-ban$b        Set this to 1 to ban users who join +closed 
                           channels. This is probably not needed though, as
                           +closed maintains +i.
+        $bclosed-invite$b     If a channel is set +closed and this is set
+                          force the channel to always be +i, otherwise don't.
         $bclosed-private$b    If a channel is set +closed, the bots will
                           enforce +p as well. The point is to notice the chan
                           and bots when an /invite is done. This is useful in 

+ 1 - 0
src/chan.h

@@ -154,6 +154,7 @@ struct chanset_t {
   int limitraise;
   int closed_ban;
   int closed_private;
+  int closed_invite;
   int bad_cookie;
   time_t cookie_time_slack;
   int manop;

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

@@ -776,7 +776,8 @@ void channels_report(int idx, int details)
 	strcpy(s, MISC_LURKING);
       get_mode_protect(chan, s2);
       if (channel_closed(chan)) {
-        strcat(s2, "i");
+        if (chan->closed_invite)
+          strcat(s2, "i");
         if (chan->closed_private)
           strcat(s2, "p");
       }

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

@@ -1271,6 +1271,7 @@ static void cmd_chaninfo(int idx, char *par)
     SHOW_INT("Bad-cookie:" , chan->bad_cookie, P_STR, "Ignore");
     SHOW_INT("Ban-time: ", chan->ban_time, NULL, "Forever");
     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!");
     deflag = chan->cookie_time_slack;
     SHOW_INT("Cookie-time-slack:", chan->cookie_time_slack, P_STR, "Ignore");

+ 10 - 1
src/mod/channels.mod/tclchan.c

@@ -409,6 +409,14 @@ int channel_modify(char *result, struct chanset_t *chan, int items, char **item)
         return ERROR;
       }
       chan->closed_ban = atoi(item[i]);
+    } else if (!strcmp(item[i], "closed-invite")) {
+      i++;
+      if (i >= items) {
+        if (result)
+          sprintf(result, "channel closed-invite needs argument");
+        return ERROR;
+      }
+      chan->closed_invite = atoi(item[i]);
     } else if (!strcmp(item[i], "closed-private")) {
       i++;
       if (i >= items) {
@@ -783,7 +791,8 @@ int channel_add(char *result, char *newname, char *options)
     chan->limit_prot = 0;
     chan->limit = 0;
     chan->closed_ban = 0;
-    chan->closed_private = 0;
+    chan->closed_private = 1;
+    chan->closed_invite = 1;
 /* Chanint template
  *  chan->temp = 0;
  */

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

@@ -1000,7 +1000,7 @@ bool write_chans(FILE *f, int idx)
 bad-cookie %d cookie-time-slack %lu manop %d mdop %d mop %d \
 limit %d stopnethack-mode %d revenge-mode %d flood-chan %d:%lu \
 flood-ctcp %d:%lu flood-join %d:%lu flood-kick %d:%lu flood-deop %d:%lu \
-flood-nick %d:%lu closed-ban %d closed-private %d ban-time %lu \
+flood-nick %d:%lu closed-ban %d closed-invite %d closed-private %d ban-time %lu \
 exempt-time %lu invite-time %lu \
 %cenforcebans %cdynamicbans %cuserban %cbitch %cprotectops %crevenge \
 %crevengebot %cprivate %ccycle %cinactive %cdynamicexempts %cuserexempts \
@@ -1034,6 +1034,7 @@ exempt-time %lu invite-time %lu \
  *      chan->temp,
  * also include temp %d in dprintf
  */
+        chan->closed_invite,
         chan->closed_private,
         chan->ban_time,
         chan->exempt_time,

+ 1 - 1
src/mod/irc.mod/chan.c

@@ -986,7 +986,7 @@ void enforce_closed(struct chanset_t *chan) {
 
   char buf[1024] = "";
 
-  if (!(chan->channel.mode & CHANINV))
+  if (chan->closed_invite && !(chan->channel.mode & CHANINV))
     strcat(buf, "i");
   if (chan->closed_private && !(chan->channel.mode & CHANPRIV))
     strcat(buf, "p");