Преглед на файлове

* Added ability to +chan/chanset flood-* x:n (#69)

svn: 2081
Bryan Drewery преди 21 години
родител
ревизия
9fa7406471
променени са 3 файла, в които са добавени 12 реда и са изтрити 6 реда
  1. 1 0
      doc/UPDATES
  2. 1 0
      misc/help.txt
  3. 10 6
      src/mod/channels.mod/tclchan.c

+ 1 - 0
doc/UPDATES

@@ -115,6 +115,7 @@ Lines prefixxed with '-' were disabled before release and are not finishsed, or
 * Only auto-op a user if they have a password set. (#52)
 * Made cmd_addlog o|o
 * Several cmds were not saving userfile: -/+chrec|ban|exempt|invite, [un]stick, chinfo (#68)
+* Added ability to +chan/chanset flood-* x:n (#69)
 
 1.2.2
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.

+ 1 - 0
misc/help.txt

@@ -537,6 +537,7 @@ See also: link
         $bflood-nick$b   Set here how many nick changes in how many seconds from
                     one host constitutes a flood. Setting this to 0 or 0:0
                     disables nick flood protection for the channel.
+     These can all be changed simultaneously with $bflood-*$b
  
 See also: %{-}%{+n}+chan, -chan%{-}%{+m|m}, chanset%{-}
 :leaf:channel

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

@@ -583,23 +583,27 @@ int channel_modify(char *result, struct chanset_t *chan, int items, char **item)
       int *pthr = NULL;
       time_t *ptime = NULL;
       char *p = NULL;
+      bool all = 0;
 
-      if (!strcmp(item[i] + 6, "chan")) {
+      if (!strcmp(item[i] + 6, "*"))
+        all = 1;
+
+      if (all || !strcmp(item[i] + 6, "chan")) {
 	pthr = &chan->flood_pub_thr;
 	ptime = &chan->flood_pub_time;
-      } else if (!strcmp(item[i] + 6, "join")) {
+      } else if (all || !strcmp(item[i] + 6, "join")) {
 	pthr = &chan->flood_join_thr;
 	ptime = &chan->flood_join_time;
-      } else if (!strcmp(item[i] + 6, "ctcp")) {
+      } else if (all || !strcmp(item[i] + 6, "ctcp")) {
 	pthr = &chan->flood_ctcp_thr;
 	ptime = &chan->flood_ctcp_time;
-      } else if (!strcmp(item[i] + 6, "kick")) {
+      } else if (all || !strcmp(item[i] + 6, "kick")) {
 	pthr = &chan->flood_kick_thr;
 	ptime = &chan->flood_kick_time;
-      } else if (!strcmp(item[i] + 6, "deop")) {
+      } else if (all || !strcmp(item[i] + 6, "deop")) {
 	pthr = &chan->flood_deop_thr;
 	ptime = &chan->flood_deop_time;
-      } else if (!strcmp(item[i] + 6, "nick")) {
+      } else if (all || !strcmp(item[i] + 6, "nick")) {
 	pthr = &chan->flood_nick_thr;
 	ptime = &chan->flood_nick_time;
       } else {