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

* Port [3437] to 1.2.14
* Remove chanset 'idle-kick'


svn: 3438

Bryan Drewery 19 лет назад
Родитель
Сommit
2bb8058fa2

+ 1 - 1
doc/UPDATES

@@ -38,7 +38,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Add chanset 'flood-lock-time' to control how long to keep the channel locked during drone floods.
 * Add chanset 'flood-lock-time' to control how long to keep the channel locked during drone floods.
 * chanset flood-join now also counts PARTs as flooding.
 * chanset flood-join now also counts PARTs as flooding.
 * Fix segfault in cmd_channel during splits.
 * Fix segfault in cmd_channel during splits.
-* Remove chanflag 'protectops'
+* Remove chanflag 'protectops' and 'idle-kick'
 * Fix bot not checking +e/+I modes when opped sometimes.
 * Fix bot not checking +e/+I modes when opped sometimes.
 * Fix chanset flag 'userbans' not being saved correctly. (may cause warnings on upgrade)
 * Fix chanset flag 'userbans' not being saved correctly. (may cause warnings on upgrade)
 * Fix authing on non-chathubs (fixes #356)
 * Fix authing on non-chathubs (fixes #356)

+ 1 - 3
misc/help.txt

@@ -353,8 +353,6 @@ See also: link
      It shows any of the following:
      It shows any of the following:
         $bchanmode$b   These modes are enforced on the channel. Both + and -
         $bchanmode$b   These modes are enforced on the channel. Both + and -
                    modes can be enforced.
                    modes can be enforced.
-        $bidle-kick$b  Kick idle users that are not +f or above on the channel
-                   after how many minutes (set this to 0 to disable).
 %{+m|m}
 %{+m|m}
         $blimit$b             If this is set, the +l bot will raise the limit 
         $blimit$b             If this is set, the +l bot will raise the limit 
                           to the users in the channel + this ammount. Set to 
                           to the users in the channel + this ammount. Set to 
@@ -591,7 +589,7 @@ See also: console
    the channel after the attributes:
    the channel after the attributes:
       .chattr Usagi -m+dk-o #blah
       .chattr Usagi -m+dk-o #blah
    Changing global and channel specific flags within the same command line is
    Changing global and channel specific flags within the same command line is
-   also possible (global +f, +o #lamer):
+   also possible (global +o #lamer):
       .chattr Bill f|o #lamer
       .chattr Bill f|o #lamer
    Whether or not you change any flags, it will show you the user's attributes
    Whether or not you change any flags, it will show you the user's attributes
    afterwards. To get a list of all possible flags, see $b'%dhelp whois'$b.
    afterwards. To get a list of all possible flags, see $b'%dhelp whois'$b.

+ 0 - 1
src/chan.h

@@ -179,7 +179,6 @@ struct chanset_t {
  *int temp;
  *int temp;
  */
  */
   int flood_exempt_mode;
   int flood_exempt_mode;
-  int idle_kick;
 #ifdef REVENGE
 #ifdef REVENGE
   int revenge_mode;
   int revenge_mode;
 #endif
 #endif

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

@@ -34,7 +34,6 @@
 static bool 			use_info = 1;
 static bool 			use_info = 1;
 static char 			glob_chanmode[64] = "nt";		/* Default chanmode (drummer,990731) */
 static char 			glob_chanmode[64] = "nt";		/* Default chanmode (drummer,990731) */
 //static int 			global_revenge_mode = 3;
 //static int 			global_revenge_mode = 3;
-static int 			global_idle_kick;		/* Default idle-kick setting. */
 static time_t 			global_ban_time;
 static time_t 			global_ban_time;
 static time_t			global_exempt_time;
 static time_t			global_exempt_time;
 static time_t 			global_invite_time;
 static time_t 			global_invite_time;
@@ -877,9 +876,6 @@ void channels_report(int idx, int details)
           i += my_strcpy(s + i, "private ");
           i += my_strcpy(s + i, "private ");
 
 
 	dprintf(idx, "      Options: %s\n", s);
 	dprintf(idx, "      Options: %s\n", s);
-	if (chan->idle_kick)
-	  dprintf(idx, "      Kicking idle users after %d min\n",
-		  chan->idle_kick);
         if (chan->limitraise)
         if (chan->limitraise)
           dprintf(idx, "      Raising limit +%d every 2 minutes\n", chan->limitraise);
           dprintf(idx, "      Raising limit +%d every 2 minutes\n", chan->limitraise);
 /*
 /*

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

@@ -1246,7 +1246,6 @@ static void cmd_chaninfo(int idx, char *par)
     SHOW_INT("Exempt-time: ", chan->exempt_time, NULL, "Forever");
     SHOW_INT("Exempt-time: ", chan->exempt_time, NULL, "Forever");
     SHOW_INT("Flood-exempt: ", chan->flood_exempt_mode, F_STR, "None");
     SHOW_INT("Flood-exempt: ", chan->flood_exempt_mode, F_STR, "None");
     SHOW_INT("Flood-lock-time: ", chan->flood_lock_time, NULL, "Don't");
     SHOW_INT("Flood-lock-time: ", chan->flood_lock_time, NULL, "Don't");
-    SHOW_INT("Idle Kick after (idle-kick): ", chan->idle_kick, "", "Don't!");
     SHOW_INT("Invite-time: ", chan->invite_time, NULL, "Forever");
     SHOW_INT("Invite-time: ", chan->invite_time, NULL, "Forever");
     SHOW_INT("Limit raise (limit): ", chan->limitraise, NULL, "Disabled");
     SHOW_INT("Limit raise (limit): ", chan->limitraise, NULL, "Disabled");
     deflag = chan->manop;
     deflag = chan->manop;

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

@@ -341,14 +341,6 @@ int channel_modify(char *result, struct chanset_t *chan, int items, char **item,
 	return ERROR;
 	return ERROR;
       }
       }
       chan->added_ts = atoi(item[i]);
       chan->added_ts = atoi(item[i]);
-    } else if (!strcmp(item[i], "idle-kick")) {
-      i++;
-      if (i >= items) {
-	if (result)
-	  simple_snprintf(result, RESULT_LEN, "channel idle-kick needs argument");
-	return ERROR;
-      }
-      chan->idle_kick = atoi(item[i]);
     } else if (!strcmp(item[i], "limit")) {
     } else if (!strcmp(item[i], "limit")) {
       i++;
       i++;
       if (i >= items) {
       if (i >= items) {
@@ -358,8 +350,6 @@ int channel_modify(char *result, struct chanset_t *chan, int items, char **item,
       }
       }
       chan->limitraise = atoi(item[i]);
       chan->limitraise = atoi(item[i]);
       chan->limit_prot = 0;
       chan->limit_prot = 0;
-    } else if (!strcmp(item[i], "dont-idle-kick")) {
-      chan->idle_kick = 0;
 /*
 /*
     } else if (!strcmp(item[i], "revenge-mode")) {
     } else if (!strcmp(item[i], "revenge-mode")) {
       i++;
       i++;
@@ -903,7 +893,6 @@ int channel_add(char *result, char *newname, char *options)
     chan->flood_mjoin_thr = 6;
     chan->flood_mjoin_thr = 6;
     chan->flood_mjoin_time = 1;
     chan->flood_mjoin_time = 1;
 //    chan->revenge_mode = global_revenge_mode;
 //    chan->revenge_mode = global_revenge_mode;
-    chan->idle_kick = global_idle_kick;
     chan->limitraise = 20;
     chan->limitraise = 20;
     chan->ban_time = global_ban_time;
     chan->ban_time = global_ban_time;
     chan->exempt_time = global_exempt_time;
     chan->exempt_time = global_exempt_time;

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

@@ -726,7 +726,7 @@ bool write_chans(FILE *f, int idx)
       inactive = PLSMNS(channel_inactive(chan));
       inactive = PLSMNS(channel_inactive(chan));
 
 
     if (lfprintf(f, "\
     if (lfprintf(f, "\
-+ channel add %s { chanmode { %s } addedby %s addedts %lu idle-kick %d \
++ channel add %s { chanmode { %s } addedby %s addedts %lu \
 bad-cookie %d manop %d mdop %d mop %d limit %d \
 bad-cookie %d manop %d mdop %d mop %d limit %d \
 flood-chan %d:%lu flood-ctcp %d:%lu flood-join %d:%lu \
 flood-chan %d:%lu flood-ctcp %d:%lu flood-join %d:%lu \
 flood-kick %d:%lu flood-deop %d:%lu flood-nick %d:%lu flood-mjoin %d:%lu \
 flood-kick %d:%lu flood-deop %d:%lu flood-nick %d:%lu flood-mjoin %d:%lu \
@@ -745,7 +745,6 @@ flood-exempt %d flood-lock-time %lu \
  *      temp,
  *      temp,
  * also include temp %s in dprintf.
  * also include temp %s in dprintf.
  */
  */
-	chan->idle_kick, /* idle-kick 0 is same as dont-idle-kick (lcode)*/
 	chan->bad_cookie,
 	chan->bad_cookie,
 	chan->manop,
 	chan->manop,
 	chan->mdop,
 	chan->mdop,
@@ -828,7 +827,7 @@ bool write_chans_compat(FILE *f, int idx)
       inactive = PLSMNS(channel_inactive(chan));
       inactive = PLSMNS(channel_inactive(chan));
 
 
     if (lfprintf(f, "\
     if (lfprintf(f, "\
-+ channel add %s { chanmode { %s } addedby %s addedts %lu idle-kick %d \
++ channel add %s { chanmode { %s } addedby %s addedts %lu \
 bad-cookie %d manop %d mdop %d mop %d limit %d \
 bad-cookie %d manop %d mdop %d mop %d limit %d \
 flood-chan %d:%lu flood-ctcp %d:%lu flood-join %d:%lu \
 flood-chan %d:%lu flood-ctcp %d:%lu flood-join %d:%lu \
 flood-kick %d:%lu flood-deop %d:%lu flood-nick %d:%lu \
 flood-kick %d:%lu flood-deop %d:%lu flood-nick %d:%lu \
@@ -846,7 +845,6 @@ exempt-time %lu invite-time %lu voice-non-ident %d \
  *      temp,
  *      temp,
  * also include temp %s in dprintf.
  * also include temp %s in dprintf.
  */
  */
-	chan->idle_kick, /* idle-kick 0 is same as dont-idle-kick (lcode)*/
 	chan->bad_cookie,
 	chan->bad_cookie,
 	chan->manop,
 	chan->manop,
 	chan->mdop,
 	chan->mdop,

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

@@ -1440,16 +1440,7 @@ check_expired_chanstuff(struct chanset_t *chan)
       }
       }
 
 
       if (me_op(chan)) {
       if (me_op(chan)) {
-        if (chan->idle_kick) {
-          if (now - m->last >= chan->idle_kick * 60 && !match_my_nick(m->nick) && !chan_issplit(m)) {
-            simple_sprintf(s, "%s!%s", m->nick, m->userhost);
-            get_user_flagrec(m->user ? m->user : get_user_by_host(s), &fr, chan->dname);
-            if (!(glob_bot(fr) || chk_op(fr, chan))) {
-              dprintf(DP_SERVER, "KICK %s %s :%sidle %d min\n", chan->name, m->nick, kickprefix, chan->idle_kick);
-              m->flags |= SENTKICK;
-            }
-          }
-        } else if (dovoice(chan) && !loading) {      /* autovoice of +v users if bot is +y */
+        if (dovoice(chan) && !loading) {      /* autovoice of +v users if bot is +y */
           if (!chan_hasop(m) && !chan_hasvoice(m)) {
           if (!chan_hasop(m) && !chan_hasvoice(m)) {
             if (!m->user && !m->tried_getuser) {
             if (!m->user && !m->tried_getuser) {
               simple_sprintf(s, "%s!%s", m->nick, m->userhost);
               simple_sprintf(s, "%s!%s", m->nick, m->userhost);