Explorar el Código

Merge branch 'maint'

* maint:
  Fallback to ISON if the server falsely claims to support MONITOR.
Bryan Drewery hace 10 años
padre
commit
2ded27ef0c
Se han modificado 2 ficheros con 19 adiciones y 0 borrados
  1. 1 0
      doc/UPDATES.md
  2. 18 0
      src/mod/server.mod/servmsg.cc

+ 1 - 0
doc/UPDATES.md

@@ -10,6 +10,7 @@
   * Use FreeBSD 10's procctl(PROC_TRACE_CTL) to disable core dumps and tracing.
   * Fix binary compat issue causing ptrace permission errors on Linux 3.4+
   * Fix ban/exempt/invite masking not working with 10-char idents.
+  * Fallback to ISON if the server falsely claims to support MONITOR.
 
 # 1.4.6
   * Disable demo TCL support by default to prevent confusion during build.

+ 18 - 0
src/mod/server.mod/servmsg.cc

@@ -1152,6 +1152,23 @@ static void got303(char *from, char *msg)
     nicks_available(msg, ' ', 0);
 }
 
+/*
+ * :<server> 421 <nick> <command> :Unknown command
+ */
+static void got421(char *from, char *msg)
+{
+  char *command = NULL;
+
+  newsplit(&msg);	/* nick */
+  command = newsplit(&msg);
+
+  if (use_monitor && !strcasecmp(command, "MONITOR")) {
+    /* The command doesn't work despite 005 claiming to have it.
+     * Disable MONITOR usage to fallback on ISON. */
+    use_monitor = 0;
+  }
+}
+
 /* 432 : Bad nickname (RESV)
  */
 static int got432(char *from, char *msg)
@@ -1988,6 +2005,7 @@ static cmd_t my_raw_binds[] =
   {"005",	"",	(Function) got005,		NULL, LEAF},
   {"302",       "",     (Function) got302,		NULL, LEAF},
   {"303",	"",	(Function) got303,		NULL, LEAF},
+  {"421",	"",	(Function) got421,		NULL, LEAF},
   {"432",	"",	(Function) got432,		NULL, LEAF},
   {"433",	"",	(Function) got433,		NULL, LEAF},
   {"437",	"",	(Function) got437,		NULL, LEAF},