Sfoglia il codice sorgente

* Add 'cookies_disabled' to allow disabling cookies for upgrading/ircu/unreal

Bryan Drewery 16 anni fa
parent
commit
e94f5718ee
4 ha cambiato i file con 5 aggiunte e 4 eliminazioni
  1. 1 0
      src/chanprog.c
  2. 1 1
      src/chanprog.h
  3. 1 1
      src/mod/irc.mod/cmdsirc.c
  4. 2 2
      src/mod/irc.mod/mode.c

+ 1 - 0
src/chanprog.c

@@ -62,6 +62,7 @@ char                    jupenick[NICKLEN] = "";
 char 			botname[NICKLEN + 1] = "";	/* IRC nickname */
 port_t     		my_port = 0;
 bool			reset_chans = 0;
+bool                    cookies_disabled = 0;
 char s2_4[3] = "",s1_6[3] = "",s1_11[3] = "";
 
 /* Remove leading and trailing whitespaces.

+ 1 - 1
src/chanprog.h

@@ -35,6 +35,6 @@ void setup_HQ(int);
 extern struct chanset_t		*chanset;
 extern char			admin[], origbotnick[NICKLEN + 1], origbotname[NICKLEN + 1], jupenick[NICKLEN], botname[NICKLEN + 1];
 extern port_t			my_port;
-extern bool			reset_chans;
+extern bool			reset_chans, cookies_disabled;
 
 #endif /* !_CHANPROG_H */

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

@@ -677,7 +677,7 @@ static void cmd_mmode(int idx, char *par)
     return;
   }
 
-  if (mode[0] == '+' && mode[1] == 'o' && !channel_fastop(chan)) {
+  if (mode[0] == '+' && mode[1] == 'o' && !channel_fastop(chan) && !cookies_disabled) {
     dprintf(idx, STR("Error: This channel is currently set -fastop.\n"));
     dprintf(idx, STR("Mass opping would result in missing op cookies.\n"));
     dprintf(idx, STR("Please chanset the channel +fastop first.\n"));

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

@@ -103,7 +103,7 @@ do_op(char *nick, struct chanset_t *chan, bool delay, bool force)
     m->flags |= SENTOP;
   }
 
-  if (channel_fastop(chan) || channel_take(chan)) {
+  if (channel_fastop(chan) || channel_take(chan) || cookies_disabled) {
     add_mode(chan, '+', 'o', nick);
   } else {
     add_cookie(chan, nick);
@@ -1117,7 +1117,7 @@ gotmode(char *from, char *msg)
         if (ops) {
           int n = 0;
           /* Check cookies */
-          if (u && m && u->bot && !channel_fastop(chan) && !channel_take(chan)) {
+          if (u && m && u->bot && !channel_fastop(chan) && !channel_take(chan) && !cookies_disabled) {
             int isbadop = 0;
             bool failure = 0;