Przeglądaj źródła

* Port [3369] to 1.2.14
* Remove chanflag 'protectops'



svn: 3370

Bryan Drewery 19 lat temu
rodzic
commit
cefc1d8682

+ 1 - 0
doc/UPDATES

@@ -38,6 +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'
 
 
 1.2.13 - http://wraith.shatow.net/milestone/1.2.13
 1.2.13 - http://wraith.shatow.net/milestone/1.2.13
 * Fix cmd_chanset accepting invalid flags
 * Fix cmd_chanset accepting invalid flags

+ 0 - 2
misc/help.txt

@@ -454,8 +454,6 @@ See also: link
                        Users who lose access to a channel because of this setting
                        Users who lose access to a channel because of this setting
                        will see no reference to it over the botnet in any place.
                        will see no reference to it over the botnet in any place.
                        The +o restriction goes for +v as well.
                        The +o restriction goes for +v as well.
-        $bprotectops$b     Re-op a user with the +o flag if they get deopped?
-                       DON'T USE THIS.
         $btake$b           Once a bot is opped, it will mass op all other bots
         $btake$b           Once a bot is opped, it will mass op all other bots
                        in the channel. After that, they will all attempt to 
                        in the channel. After that, they will all attempt to 
                        mass deop in hopes 'taking' the channel. :)
                        mass deop in hopes 'taking' the channel. :)

+ 1 - 2
src/chan.h

@@ -224,7 +224,7 @@ struct chanset_t {
 #define CHAN_CLOSED         BIT3	/* Only users +o can join */
 #define CHAN_CLOSED         BIT3	/* Only users +o can join */
 #define CHAN_BITCH          BIT4	/* be a tightwad with ops             */
 #define CHAN_BITCH          BIT4	/* be a tightwad with ops             */
 #define CHAN_TAKE 	    BIT5	/* When a bot gets opped, take the chan */
 #define CHAN_TAKE 	    BIT5	/* When a bot gets opped, take the chan */
-#define CHAN_PROTECTOPS     BIT6	/* re-op any +o people who get deop'd */
+//#define CHAN_UNUSED     BIT6	/* re-op any +o people who get deop'd */
 #define CHAN_BOTBITCH       BIT7        /* only let bots be opped? */
 #define CHAN_BOTBITCH       BIT7        /* only let bots be opped? */
 #define CHAN_BACKUP         BIT8	/* Join the BOT_BACKUP bots when set */
 #define CHAN_BACKUP         BIT8	/* Join the BOT_BACKUP bots when set */
 #define CHAN_SECRET         BIT9	/* don't advertise channel on botnet  */
 #define CHAN_SECRET         BIT9	/* don't advertise channel on botnet  */
@@ -273,7 +273,6 @@ struct chanset_t *findchan_by_dname(const char *name);
 #define channel_enforcebans(chan) (chan->status & CHAN_ENFORCEBANS)
 #define channel_enforcebans(chan) (chan->status & CHAN_ENFORCEBANS)
 #define channel_dynamicbans(chan) (chan->status & CHAN_DYNAMICBANS)
 #define channel_dynamicbans(chan) (chan->status & CHAN_DYNAMICBANS)
 #define channel_nouserbans(chan) (chan->status & CHAN_NOUSERBANS)
 #define channel_nouserbans(chan) (chan->status & CHAN_NOUSERBANS)
-#define channel_protectops(chan) (chan->status & CHAN_PROTECTOPS)
 #define channel_secret(chan) (chan->status & CHAN_SECRET)
 #define channel_secret(chan) (chan->status & CHAN_SECRET)
 #define channel_cycle(chan) (chan->status & CHAN_CYCLE)
 #define channel_cycle(chan) (chan->status & CHAN_CYCLE)
 #define channel_inactive(chan) (chan->status & CHAN_INACTIVE)
 #define channel_inactive(chan) (chan->status & CHAN_INACTIVE)

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

@@ -831,8 +831,6 @@ void channels_report(int idx, int details)
 	  i += my_strcpy(s + i, "userbans ");
 	  i += my_strcpy(s + i, "userbans ");
 	if (channel_bitch(chan))
 	if (channel_bitch(chan))
 	  i += my_strcpy(s + i, "bitch ");
 	  i += my_strcpy(s + i, "bitch ");
-	if (channel_protectops(chan))
-	  i += my_strcpy(s + i, "protectops ");
 /*
 /*
 	if (channel_revenge(chan))
 	if (channel_revenge(chan))
 	  i += my_strcpy(s + i, "revenge ");
 	  i += my_strcpy(s + i, "revenge ");

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

@@ -1212,7 +1212,6 @@ static void cmd_chaninfo(int idx, char *par)
     SHOW_FLAG("nodesynch",	channel_nodesynch(chan));
     SHOW_FLAG("nodesynch",	channel_nodesynch(chan));
     SHOW_FLAG("nomassjoin",	channel_nomassjoin(chan));
     SHOW_FLAG("nomassjoin",	channel_nomassjoin(chan));
     SHOW_FLAG("private",	channel_privchan(chan));
     SHOW_FLAG("private",	channel_privchan(chan));
-    SHOW_FLAG("protectops",	channel_protectops(chan));
 //    SHOW_FLAG("revenge",	channel_revenge(chan));
 //    SHOW_FLAG("revenge",	channel_revenge(chan));
 //    SHOW_FLAG("revengebot",	channel_revengebot(chan));
 //    SHOW_FLAG("revengebot",	channel_revengebot(chan));
     if (HAVE_TAKE)
     if (HAVE_TAKE)

+ 3 - 5
src/mod/channels.mod/tclchan.c

@@ -521,10 +521,6 @@ int channel_modify(char *result, struct chanset_t *chan, int items, char **item,
       chan->status |= CHAN_NODESYNCH;
       chan->status |= CHAN_NODESYNCH;
     else if (!strcmp(item[i], "-nodesynch"))
     else if (!strcmp(item[i], "-nodesynch"))
       chan->status &= ~CHAN_NODESYNCH;
       chan->status &= ~CHAN_NODESYNCH;
-    else if (!strcmp(item[i], "+protectops"))
-      chan->status |= CHAN_PROTECTOPS;
-    else if (!strcmp(item[i], "-protectops"))
-      chan->status &= ~CHAN_PROTECTOPS;
     else if (!strcmp(item[i], "+inactive"))
     else if (!strcmp(item[i], "+inactive"))
       chan->status |= CHAN_INACTIVE;
       chan->status |= CHAN_INACTIVE;
     else if (!strcmp(item[i], "-inactive"))
     else if (!strcmp(item[i], "-inactive"))
@@ -596,7 +592,7 @@ int channel_modify(char *result, struct chanset_t *chan, int items, char **item,
     else if (!strcmp(item[i], "+fastop"))
     else if (!strcmp(item[i], "+fastop"))
       chan->status |= CHAN_FASTOP;
       chan->status |= CHAN_FASTOP;
     else if (!strcmp(item[i], "-fastop"))
     else if (!strcmp(item[i], "-fastop"))
-      chan->status &= ~(CHAN_FASTOP | CHAN_PROTECTOPS);
+      chan->status &= ~CHAN_FASTOP;
     else if (!strcmp(item[i], "+private"))
     else if (!strcmp(item[i], "+private"))
       chan->status |= CHAN_PRIVATE;
       chan->status |= CHAN_PRIVATE;
     else if (!strcmp(item[i], "-private"))
     else if (!strcmp(item[i], "-private"))
@@ -625,6 +621,8 @@ int channel_modify(char *result, struct chanset_t *chan, int items, char **item,
     else if (!cmd && !strcmp(item[i], "-nomdop"))  ;
     else if (!cmd && !strcmp(item[i], "-nomdop"))  ;
     else if (!cmd && !strcmp(item[i], "+protectfriends"))  ;
     else if (!cmd && !strcmp(item[i], "+protectfriends"))  ;
     else if (!cmd && !strcmp(item[i], "-protectfriends"))  ;
     else if (!cmd && !strcmp(item[i], "-protectfriends"))  ;
+    else if (!cmd && !strcmp(item[i], "+protectops"))  ;
+    else if (!cmd && !strcmp(item[i], "-protectops"))  ;
     else if (!cmd && !strcmp(item[i], "+punish"))  ;
     else if (!cmd && !strcmp(item[i], "+punish"))  ;
     else if (!cmd && !strcmp(item[i], "-punish"))  ;
     else if (!cmd && !strcmp(item[i], "-punish"))  ;
     else if (!cmd && !strcmp(item[i], "+seen"))  ;
     else if (!cmd && !strcmp(item[i], "+seen"))  ;

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

@@ -733,7 +733,7 @@ flood-kick %d:%lu flood-deop %d:%lu flood-nick %d:%lu flood-mjoin %d:%lu \
 closed-ban %d closed-invite %d closed-private %d ban-time %lu \
 closed-ban %d closed-invite %d closed-private %d ban-time %lu \
 exempt-time %lu invite-time %lu voice-non-ident %d \
 exempt-time %lu invite-time %lu voice-non-ident %d \
 flood-exempt %d flood-lock-time %d \
 flood-exempt %d flood-lock-time %d \
-%cenforcebans %cdynamicbans %cuserban %cbitch %cprotectops \
+%cenforcebans %cdynamicbans %cuserban %cbitch \
 %cprivate %ccycle %cinactive %cdynamicexempts %cuserexempts \
 %cprivate %ccycle %cinactive %cdynamicexempts %cuserexempts \
 %cdynamicinvites %cuserinvites %cnodesynch %cclosed %cvoice \
 %cdynamicinvites %cuserinvites %cnodesynch %cclosed %cvoice \
 %cfastop %cautoop %cbotbitch %cbackup %cnomassjoin %c%s}\n",
 %cfastop %cautoop %cbotbitch %cbackup %cnomassjoin %c%s}\n",
@@ -775,7 +775,6 @@ flood-exempt %d flood-lock-time %d \
 	PLSMNS(channel_dynamicbans(chan)),
 	PLSMNS(channel_dynamicbans(chan)),
 	PLSMNS(!channel_nouserbans(chan)),
 	PLSMNS(!channel_nouserbans(chan)),
 	PLSMNS(channel_bitch(chan)),
 	PLSMNS(channel_bitch(chan)),
-	PLSMNS(channel_protectops(chan)),
 	PLSMNS(channel_privchan(chan)),
 	PLSMNS(channel_privchan(chan)),
 	PLSMNS(channel_cycle(chan)),
 	PLSMNS(channel_cycle(chan)),
         inactive,
         inactive,

+ 2 - 13
src/mod/irc.mod/mode.c

@@ -514,7 +514,7 @@ got_key(struct chanset_t *chan, char *key)
 {
 {
   if (((reversing) && !(chan->key_prot[0])) ||
   if (((reversing) && !(chan->key_prot[0])) ||
       ((chan->mode_mns_prot & CHANKEY) && !(glob_master(user) || glob_bot(user) || chan_master(user)))) {
       ((chan->mode_mns_prot & CHANKEY) && !(glob_master(user) || glob_bot(user) || chan_master(user)))) {
-    if (strlen(key) != 0) {
+    if (key && key[0]) {
       add_mode(chan, '-', 'k', key);
       add_mode(chan, '-', 'k', key);
     } else {
     } else {
       add_mode(chan, '-', 'k', "");
       add_mode(chan, '-', 'k', "");
@@ -646,21 +646,10 @@ got_deop(struct chanset_t *chan, memberlist *m, memberlist *mv, char *isserver)
 
 
   /* Deop'd someone on my oplist? */
   /* Deop'd someone on my oplist? */
   if (me_op(chan)) {
   if (me_op(chan)) {
-    bool ok = 1;
-
-    /* if they aren't d|d then check if they are something we should protect */
-    if (!glob_deop(victim) && !chan_deop(victim)) {
-      if (channel_protectops(chan) && (glob_master(victim) || chan_master(victim) ||
-                                       glob_op(victim) || chan_op(victim)))
-        ok = 0;
-    }
-
     /* do we want to reop victim? */
     /* do we want to reop victim? */
-    if ((reversing || !ok) && 
+    if ((reversing) && 
         ((m && !match_my_nick(m->nick) && rfc_casecmp(mv->nick, m->nick)) || (!m)) && 
         ((m && !match_my_nick(m->nick) && rfc_casecmp(mv->nick, m->nick)) || (!m)) && 
         !match_my_nick(mv->nick) &&
         !match_my_nick(mv->nick) &&
-        /* Is the deopper NOT a master or bot? */
-        !glob_master(user) && !chan_master(user) && !glob_bot(user) &&
         (chk_op(victim, chan) || !chan_bitch(chan)))
         (chk_op(victim, chan) || !chan_bitch(chan)))
       /* Then we'll bless the victim */
       /* Then we'll bless the victim */
       do_op(mv->nick, chan, 0, 0);
       do_op(mv->nick, chan, 0, 0);

+ 1 - 1
src/set.c

@@ -31,7 +31,7 @@ int badprocess = DET_IGNORE;
 char process_list[1024] = "";
 char process_list[1024] = "";
 #endif
 #endif
 bool dccauth = 0;
 bool dccauth = 0;
-char *def_chanset = "+enforcebans +dynamicbans +userbans -bitch -protectops +cycle -inactive +userexempts -dynamicexempts +userinvites -dynamicinvites -nodesynch -closed -take -voice -private -fastop";
+char *def_chanset = "+enforcebans +dynamicbans +userbans -bitch +cycle -inactive +userexempts -dynamicexempts +userinvites -dynamicinvites -nodesynch -closed -take -voice -private -fastop";
 int dcc_autoaway;
 int dcc_autoaway;
 int cloak_script = 0;
 int cloak_script = 0;
 rate_t close_threshold;
 rate_t close_threshold;