Просмотр исходного кода

* Changed var 'voice-non-ident' to chanint:
* Added chanint 'voice-non-ident' which can be used to not voice non-idented clients with +voice.
(Default: 1)


svn: 2203

Bryan Drewery 21 лет назад
Родитель
Сommit
dee7b97b1e
8 измененных файлов с 19 добавлено и 8 удалено
  1. 1 1
      doc/UPDATES
  2. 4 3
      misc/help.txt
  3. 1 0
      src/chan.h
  4. 1 0
      src/mod/channels.mod/cmdschan.c
  5. 9 0
      src/mod/channels.mod/tclchan.c
  6. 2 1
      src/mod/channels.mod/userchan.c
  7. 0 2
      src/set.c
  8. 1 1
      src/set.h

+ 1 - 1
doc/UPDATES

@@ -60,7 +60,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Added rate vars 'flood-msg' and 'flood-ctcp' to control how quickly a bot ignores on flood.
 * Added rate var 'flood-g' which will set +g for 60 seconds after this many msgs:sec has been detected. (#74)
 * Added bool var 'mean-kicks' which enables offensive/mean kick msgs.
-* Added bool var 'voice-non-ident' which can be used to not voice non-idented clients with +voice.
+* Added chanint 'voice-non-ident' which can be used to not voice non-idented clients with +voice.
 * Optimized WHO parsing more to alieviate some cpu usage in large chans
 * Binary writing is now a bit faster as the hash is calculated on the fly now.
 * Rewrote how logs are shared over botnet, now uses much less bw and resources. (#31)

+ 4 - 3
misc/help.txt

@@ -397,6 +397,9 @@ See also: link
                           channel is set to +i. Once the channel is -i then the
                           invite will be removed the next time the bot checks.
                           Please note that this is an IRCnet feature.
+        $bvoice-non-ident$b   If channel is +voice, clients without an ident will 
+                          be voiced. Set to 0 to not voice clients without ident.
+
      The following options chose how to respond to specific events.
         Each can be set as any of the specified options.
         ignore/0           Ignore
@@ -1545,9 +1548,7 @@ See also: reload, backup
                           If set to 0, a random script will be used.
                           1=plain bitchx, 2=crackrock, 3=neonapple, 4=tunnelvision, 
                           5=argon, 6=evolver, 7=prevail 8=cypress 9=mIRC
- 
-[B]  $bvoice-non-ident$b  If channel is +voice, clients without an ident will be voiced.
-                          Set to 0 to not voice clients without ident.
+
  
 See also: botset
 ::sha1

+ 1 - 0
src/chan.h

@@ -161,6 +161,7 @@ struct chanset_t {
   int manop;
   int mdop;
   int mop;
+  int voice_non_ident;
 /* Chanint template 
  *int temp;
  */

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

@@ -1237,6 +1237,7 @@ static void cmd_chaninfo(int idx, char *par)
     SHOW_INT("Mop: ", chan->mop, P_STR, "Ignore");
     SHOW_INT("Revenge-mode: ", chan->revenge_mode, NULL, NULL);
     SHOW_INT("Stopnethack-mode: ", chan->stopnethack_mode, "", "Don't!");
+    SHOW_INT("Voice-non-ident: ", chan->voice_non_ident, "", "Don't!");
 
     dprintf(idx, "Flood settings:   chan ctcp join kick deop nick\n");
     dprintf(idx, "  number:          %3d  %3d  %3d  %3d  %3d  %3d\n",

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

@@ -424,6 +424,14 @@ int channel_modify(char *result, struct chanset_t *chan, int items, char **item)
         return ERROR;
       }
       chan->closed_private = atoi(item[i]);
+    } else if (!strcmp(item[i], "voice-non-ident")) {
+      i++;
+      if (i >= items) {
+        if (result)
+          simple_sprintf(result, "channel voice-ident needs argument");
+        return ERROR;
+      }
+      chan->voice_non_ident = atoi(item[i]);
     } else if (!strcmp(item[i], "bad-cookie")) {
       i++;
       if (i >= items) {
@@ -789,6 +797,7 @@ int channel_add(char *result, char *newname, char *options)
     chan->closed_ban = 0;
     chan->closed_private = 1;
     chan->closed_invite = 1;
+    chan->voice_non_ident = 1;
 /* Chanint template
  *  chan->temp = 0;
  */

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

@@ -714,7 +714,7 @@ bad-cookie %d 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-invite %d closed-private %d ban-time %lu \
-exempt-time %lu invite-time %lu \
+exempt-time %lu invite-time %lu voice-non-ident %d \
 %cenforcebans %cdynamicbans %cuserban %cbitch %cprotectops %crevenge \
 %crevengebot %cprivate %ccycle %cinactive %cdynamicexempts %cuserexempts \
 %cdynamicinvites %cuserinvites %cnodesynch %cclosed %cvoice \
@@ -751,6 +751,7 @@ exempt-time %lu invite-time %lu \
         chan->ban_time,
         chan->exempt_time,
         chan->invite_time,
+        chan->voice_non_ident,
  	PLSMNS(channel_enforcebans(chan)),
 	PLSMNS(channel_dynamicbans(chan)),
 	PLSMNS(!channel_nouserbans(chan)),

+ 0 - 2
src/set.c

@@ -47,7 +47,6 @@ char process_list[1024] = "";
 int promisc = DET_WARN;
 int trace = DET_WARN;
 bool offensive_bans = 1;
-bool voice_non_ident = 1;
 
 static variable_t vars[] = {
  {"alias",		alias,			sizeof(alias),			VAR_STRING|VAR_LIST|VAR_NOLOC|VAR_PERM, NULL, NULL},
@@ -86,7 +85,6 @@ static variable_t vars[] = {
  {"servers6",		&serverlist,		0,				VAR_SERVERS|VAR_LIST|VAR_SHUFFLE|VAR_NOLHUB, NULL, NULL},
  {"server-port",	&default_port,		0,				VAR_INT|VAR_NOLHUB, NULL, NULL},
  {"trace",		&trace,			0,				VAR_INT|VAR_DETECTED, NULL, NULL},
- {"voice-non-ident",	&voice_non_ident,	0,				VAR_INT|VAR_BOOL|VAR_NOLHUB, NULL, NULL},
  {NULL,			NULL,			0,				0, NULL, NULL}
 };
 

+ 1 - 1
src/set.h

@@ -52,7 +52,7 @@ typedef struct rate_b {
 
 extern char		auth_key[], auth_prefix[2], motd[], *def_chanset, alias[],
 			msgident[], msginvite[], msgop[], msgpass[], process_list[];
-extern bool		dccauth, auth_obscure, offensive_bans, voice_non_ident;
+extern bool		dccauth, auth_obscure, offensive_bans;
 extern int		cloak_script, fight_threshold, fork_interval, in_bots, set_noshare, dcc_autoaway,
 			kill_threshold, lag_threshold, op_bots, badprocess, hijack, login, promisc, trace;
 extern rate_t		op_requests, close_threshold;