[IRCServices] 5.1 InspIRCd protocol

Andrew Church achurch at achurch.org
Mon Sep 10 21:48:11 PDT 2007


>Our MODE command does not take a timestamp parameter.
>
>FMODE does, but will reject any timestamp of 0.
>
>(basically, use MODE, but with no timestamp)

Hm.  Not sure why it worked for me anyway, but try the following patch:

Index: modules/protocol/inspircd.c
===================================================================
RCS file: /var/local/cvsroot/ircservices/modules/protocol/inspircd.c,v
retrieving revision 2.9
diff -u -r2.9 inspircd.c
--- modules/protocol/inspircd.c	3 Sep 2007 11:26:34 -0000	2.9
+++ modules/protocol/inspircd.c	10 Sep 2007 12:48:07 -0000
@@ -332,8 +332,16 @@
             User *u = get_user(av[2]);
             if (c && u)
                 clear_channel(c, CLEAR_BANS, u);
-        } else {
-            do_cmode(source, ac, av);
+        } else if (ac >= 3) {
+            char modestr[BUFSIZE];
+            av[1] = av[0];  /* Remove the timestamp parameter */
+            if (av[2][0] != '+' && av[2][0] != '-') {
+                /* InspIRCd seems to omit the leading '+' when sending
+                 * initial modes for the channel */
+                snprintf(modestr, sizeof(modestr), "+%s", av[2]);
+                av[2] = modestr;
+            }
+            do_cmode(source, ac-1, av+1);
         }
     } else {
         if (ac < 2)
@@ -1030,7 +1038,7 @@
 {
     protocol_name     = "InspIRCd";
     protocol_version  = "1.1+";
-    protocol_features = PF_SZLINE | PF_SVSJOIN | PF_MODETS_FIRST;
+    protocol_features = PF_SZLINE | PF_SVSJOIN;
     protocol_nickmax  = 30;
 
     if (!register_messages(inspircd_messages)) {

  --Andrew Church
    achurch at achurch.org
    http://achurch.org/