1
0
Эх сурвалжийг харах

* CTCP bot CHAT will no longer work if the bot does not have an IPV4 IP set.

Bryan Drewery 16 жил өмнө
parent
commit
5f8309a350

+ 1 - 0
doc/UPDATES

@@ -1,4 +1,5 @@
 * Cleanup DCC/Telnet listening so bot only listens on IPV6 if it was specifically given an IPV6 IP.
+* CTCP bot CHAT will no longer work if the bot does not have an IPV4 IP set.
 
 1.3 - http://wraith.botpack.net/milestone/1.3
 * Binary / shell / startup changes

+ 3 - 1
src/mod/ctcp.mod/ctcp.c

@@ -616,7 +616,9 @@ static int ctcp_CHAT(char *nick, char *uhost, struct userrec *u, char *object, c
       if (dcc[i].type && (dcc[i].type->flags & DCT_LISTEN) && (!strcmp(dcc[i].nick, "(telnet)")))
         ix = i;
     }
-    if (dcc_total == max_dcc || (ix < 0 && (ix = listen_all(0, 0, 0)) < 0))
+    if (!iptolong(getmyip())) {
+      simple_snprintf(&ctcp_reply[strlen(ctcp_reply)], sizeof(ctcp_reply) - strlen(ctcp_reply), "\001ERROR no ipv4 ip defined. Use /dcc chat %s\001", botname);
+    } else if (dcc_total == max_dcc || (ix < 0 && (ix = listen_all(0, 0, 0)) < 0))
       strlcat(ctcp_reply, "\001ERROR no telnet port\001", sizeof(ctcp_reply));
     else {
       if (listen_time <= 2)