Browse Source

Merge branch 'nick_delay-altnick-switching' into maint

* nick_delay-altnick-switching:
  * Update docs
  * Don't reset altchars when attempting to grab a juped nick

Conflicts:
	doc/UPDATES
Bryan Drewery 14 years ago
parent
commit
fe9f567ab9
2 changed files with 6 additions and 3 deletions
  1. 1 0
      doc/UPDATES
  2. 5 3
      src/mod/server.mod/servmsg.c

+ 1 - 0
doc/UPDATES

@@ -1,6 +1,7 @@
 maint
   * Fix various compile warnings with newer GCC
   * Fix bot getting confused when changing to long nicks
+  * Fix case where nick would rotate to NICK1 when already on NICK2 and NICK was unavailable
 
 1.3.3 - http://wraith.botpack.net/milestone/1.3.3
   * Fix --disable-ipv6 compiling

+ 5 - 3
src/mod/server.mod/servmsg.c

@@ -923,11 +923,13 @@ static void nick_available(bool is_jupe, bool is_orig) {
     // Don't switch to the nick if already on jupenick
   } else if (is_orig && !match_my_nick(origbotname) && (!jupenick[0] || !match_my_nick(jupenick))) {
     if (!tried_nick || ((now - tried_nick) > 2)) {
-      altnick_char = rolls = 0;
       tried_nick = now;
-      dprintf(DP_MODE_NEXT, "NICK %s\n", origbotname);
-      if (!nick_juped)
+      if (!nick_juped) {
+        // Only reset altnick if the nick isn't juped - perfectly fine staying on rotated nick if nick_delay is in effect
+        altnick_char = rolls = 0;
         putlog(LOG_MISC, "*", "Switching back to nick '%s'", origbotname);
+      }
+      dprintf(DP_MODE_NEXT, "NICK %s\n", origbotname);
     }
   }
 }