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

Merge branch 'restart-loses-nick'

* restart-loses-nick:
  * Fix restart causing bot to change nick (this was a regression in jupenick)
Bryan Drewery преди 16 години
родител
ревизия
275b9ea9ef
променени са 6 файла, в които са добавени 7 реда и са изтрити 3 реда
  1. 1 0
      doc/UPDATES
  2. 1 0
      src/misc.c
  3. 0 1
      src/mod/irc.mod/irc.c
  4. 1 1
      src/mod/server.mod/server.c
  5. 1 1
      src/mod/server.mod/server.h
  6. 3 0
      src/mod/share.mod/share.c

+ 1 - 0
doc/UPDATES

@@ -46,6 +46,7 @@
 * Add 'chanset +rbl' which uses list of servers from 'set rbl-servers'. Only +r bots will enforce this.
 * Add 'chanset +rbl' which uses list of servers from 'set rbl-servers'. Only +r bots will enforce this.
 * Fix segfault with /KNOCK on csircd
 * Fix segfault with /KNOCK on csircd
 * SHELLHASH and Owner passwords in the PackConfig can now be salted-sha1. '+' + RAND(5) + '$' + SHA1(RAND(5) + 'password')
 * SHELLHASH and Owner passwords in the PackConfig can now be salted-sha1. '+' + RAND(5) + '$' + SHA1(RAND(5) + 'password')
+* Fix restart causing bot to change nick (this was a regression in jupenick)
 
 
 1.2.16.1
 1.2.16.1
 * Fix linux compile errors
 * Fix linux compile errors

+ 1 - 0
src/misc.c

@@ -659,6 +659,7 @@ readsocks(const char *fname)
       simple_snprintf(nserv, sizeof(nserv), "%s:%d", dcc[servidx].host, dcc[servidx].port);
       simple_snprintf(nserv, sizeof(nserv), "%s:%d", dcc[servidx].host, dcc[servidx].port);
       add_server(nserv);
       add_server(nserv);
       curserv = 0;
       curserv = 0;
+      keepnick = 0; /* Wait to change nicks until relinking, fixes nick/jupenick switching issues during restart */
       rehash_server(dcc[servidx].host, nick);
       rehash_server(dcc[servidx].host, nick);
       if (cached_005)
       if (cached_005)
         replay_cache(servidx, NULL);
         replay_cache(servidx, NULL);

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

@@ -82,7 +82,6 @@ bool use_354 = 0;                /* Use ircu's short 354 /who
                                  * responses. */
                                  * responses. */
 static bool kick_fun = 0;
 static bool kick_fun = 0;
 static bool ban_fun = 1;
 static bool ban_fun = 1;
-static bool keepnick = 1;        /* Keep nick */
 static bool prevent_mixing = 1;  /* To prevent mixing old/new modes */
 static bool prevent_mixing = 1;  /* To prevent mixing old/new modes */
 static bool include_lk = 1;      /* For correct calculation
 static bool include_lk = 1;      /* For correct calculation
                                  * in real_add_mode. */
                                  * in real_add_mode. */

+ 1 - 1
src/mod/server.mod/server.c

@@ -69,7 +69,7 @@ char botuserhost[UHOSTLEN] = "";	/* bot's user@host (refreshed whenever the bot
 					/* may not be correct user@host BUT it's how the server sees it */
 					/* may not be correct user@host BUT it's how the server sees it */
 char botuserip[UHOSTLEN] = "";		/* bot's user@host with the ip. */
 char botuserip[UHOSTLEN] = "";		/* bot's user@host with the ip. */
 
 
-static bool keepnick = 1;		/* keep trying to regain my intended
+bool keepnick = 1;		/* keep trying to regain my intended
 				   nickname? */
 				   nickname? */
 static bool nick_juped = 0;	/* True if origbotname is juped(RPL437) (dw) */
 static bool nick_juped = 0;	/* True if origbotname is juped(RPL437) (dw) */
 static bool jnick_juped = 0;    /* True if jupenick is juped */
 static bool jnick_juped = 0;    /* True if jupenick is juped */

+ 1 - 1
src/mod/server.mod/server.h

@@ -48,7 +48,7 @@ enum {
 
 
 extern bind_table_t	*BT_ctcp, *BT_ctcr, *BT_msgc;
 extern bind_table_t	*BT_ctcp, *BT_ctcr, *BT_msgc;
 extern size_t		nick_len;
 extern size_t		nick_len;
-extern bool		trigger_on_ignore, floodless, tried_jupenick;
+extern bool		trigger_on_ignore, floodless, tried_jupenick, keepnick;
 extern int 		servidx, ctcp_mode, answer_ctcp, serv, curserv, default_alines;
 extern int 		servidx, ctcp_mode, answer_ctcp, serv, curserv, default_alines;
 extern unsigned int     rolls;
 extern unsigned int     rolls;
 extern port_t		default_port, newserverport, curservport;
 extern port_t		default_port, newserverport, curservport;

+ 3 - 0
src/mod/share.mod/share.c

@@ -1423,6 +1423,9 @@ static void share_read_stream(int idx, bd::Stream& stream) {
   updatebot(-1, dcc[idx].nick, '+', 0, 0, 0, NULL);
   updatebot(-1, dcc[idx].nick, '+', 0, 0, 0, NULL);
   send_sysinfo();
   send_sysinfo();
 
 
+  if (restarting && !keepnick)
+    keepnick = 1;
+
   /* Prevents the server connect from dumping JOIN #chan */
   /* Prevents the server connect from dumping JOIN #chan */
   restarting = 0;
   restarting = 0;