فهرست منبع

* Disable cookies on ircu(undernet) and Unreal servers as they do not allow unbanning nonexistant bans.

Bryan Drewery 16 سال پیش
والد
کامیت
c48078de6f
2فایلهای تغییر یافته به همراه30 افزوده شده و 0 حذف شده
  1. 2 0
      doc/UPDATES
  2. 28 0
      src/mod/server.mod/servmsg.c

+ 2 - 0
doc/UPDATES

@@ -1,3 +1,5 @@
+* Disable cookies on ircu(undernet) and Unreal servers as they do not allow unbanning nonexistant bans.
+
 1.2.17 - http://wraith.botpack.net/milestone/1.2.17
 * Binary pass prompt has been changed to be more clear.
 * Fix uname checking on NetBSD and OpenBSD

+ 28 - 0
src/mod/server.mod/servmsg.c

@@ -234,6 +234,32 @@ static int got001(char *from, char *msg)
   return 0;
 }
 
+/* <server> 004 <to> <servername> <version> <user modes> <channel modes> */
+static int
+got004(char *from, char *msg)
+{
+  char *tmp = NULL;
+
+  newsplit(&msg); /* nick */
+  newsplit(&msg); /* server */
+
+  //Cache the results for later parsing if needed (after a restart)
+  //Sending 'VERSION' does not work on all servers, plus this speeds
+  //up a restart by removing the need to wait for the information
+  if (!replaying_cache)
+    dprintf(DP_CACHE, ":%s 004 . . %s", from, msg);
+
+  tmp = newsplit(&msg);
+
+  /* cookies won't work on ircu or Unreal or snircd */
+  if (strstr(tmp, "u2.") || strstr(tmp, "Unreeal") || strstr(tmp, "snircd")) {
+    putlog(LOG_DEBUG, "*", "Disabling cookies as they are not supported on %s", cursrvname);
+    cookies_disabled = true;
+  }
+
+  return 0;
+}
+
 /* <server> 005 <to> <option> <option> <... option> :are supported by this server */
 static int
 got005(char *from, char *msg)
@@ -1099,6 +1125,7 @@ static void disconnect_server(int idx, int dolost)
   serv = -1;
   servidx = -1;
   server_online = 0;
+  cookies_disabled = false;
   floodless = 0;
   botuserhost[0] = 0;
   botuserip[0] = 0; 
@@ -1565,6 +1592,7 @@ static cmd_t my_raw_binds[] =
   {"PONG",	"",	(Function) gotpong,		NULL, LEAF},
   {"WALLOPS",	"",	(Function) gotwall,		NULL, LEAF},
   {"001",	"",	(Function) got001,		NULL, LEAF},
+  {"004",	"",	(Function) got004,		NULL, LEAF},
   {"005",	"",	(Function) got005,		NULL, LEAF},
   {"303",	"",	(Function) got303,		NULL, LEAF},
   {"432",	"",	(Function) got432,		NULL, LEAF},