* restart-loses-nick: * Fix restart causing bot to change nick (this was a regression in jupenick)
@@ -46,6 +46,7 @@
* Add 'chanset +rbl' which uses list of servers from 'set rbl-servers'. Only +r bots will enforce this.
* Fix segfault with /KNOCK on csircd
* 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
* Fix linux compile errors
@@ -659,6 +659,7 @@ readsocks(const char *fname)
simple_snprintf(nserv, sizeof(nserv), "%s:%d", dcc[servidx].host, dcc[servidx].port);
add_server(nserv);
curserv = 0;
+ keepnick = 0; /* Wait to change nicks until relinking, fixes nick/jupenick switching issues during restart */
rehash_server(dcc[servidx].host, nick);
if (cached_005)
replay_cache(servidx, NULL);
@@ -82,7 +82,6 @@ bool use_354 = 0; /* Use ircu's short 354 /who
* responses. */
static bool kick_fun = 0;
static bool ban_fun = 1;
-static bool keepnick = 1; /* Keep nick */
static bool prevent_mixing = 1; /* To prevent mixing old/new modes */
static bool include_lk = 1; /* For correct calculation
* in real_add_mode. */
@@ -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 */
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? */
static bool nick_juped = 0; /* True if origbotname is juped(RPL437) (dw) */
static bool jnick_juped = 0; /* True if jupenick is juped */
@@ -48,7 +48,7 @@ enum {
extern bind_table_t *BT_ctcp, *BT_ctcr, *BT_msgc;
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 unsigned int rolls;
extern port_t default_port, newserverport, curservport;
@@ -1423,6 +1423,9 @@ static void share_read_stream(int idx, bd::Stream& stream) {
updatebot(-1, dcc[idx].nick, '+', 0, 0, 0, NULL);
send_sysinfo();
+ if (restarting && !keepnick)
+ keepnick = 1;
+
/* Prevents the server connect from dumping JOIN #chan */
restarting = 0;