diff -uNrd operstats-1.0.0.dist/NOTES operstats-1.0.0/NOTES
--- operstats-1.0.0.dist/NOTES	Wed Dec 31 19:00:00 1969
+++ operstats-1.0.0/NOTES	Fri Jul 12 19:16:06 2002
@@ -0,0 +1,39 @@
+Options 6 and 7 in configure will use the Hybrid code.  Option 7 will enable
+  certain Hybrid 7 extensions that are otherwise disabled.
+
+GLINE/AKILL will only function in Hybrid 7 mode.  It also requires each
+  server on the network to add a shared block in their ircd.conf files
+  allowing services to set klines remotely.
+
+shared {
+  name = "services.network.tld";
+};
+
+We never attempt to remove a GLINE/AKILL, as it would depend on all servers
+  running lmh.diff (in Hybrid 7's contrib/ directory) for remote UNKLINE.
+  Since we have to assume stock code, we cannot depend on this.
+
+If there are any CSr servers on the network, you will likely have trouble
+  with a lot of the functionality.
+
+Channel counts MIGHT be off, I haven't traced this down yet.
+
+It doesn't support QS (Quit Storm Removal) yet, so it will use more network
+  bandwidth on splits than other servers.
+
+SnoopChan must be -n if the services are not joining it (like ircu).
+
+It will not forcefully take ops in the JoinChan.  If there are users in it,
+  the services will join like normal users and will not be "server opped".
+
+It doesn't yet support Hybrid 7's EOB indicator (End of Burst).
+
+SecuritySetting must be None on Hybrid 7 if you wish to access services when
+  you are not /oper'ed.
+
+I have not tested clone protection.  I'm testing this on the Hybrid 7 Test
+  network, so clone kills would be extremely disruptive to the debugging
+  and testing that I and others are doing.
+
+/msg operserv akill add blah doesn't work yet (it wouldn't work for ircu
+  either)
diff -uNrd operstats-1.0.0.dist/TODO operstats-1.0.0/TODO
--- operstats-1.0.0.dist/TODO	Wed Dec 31 19:00:00 1969
+++ operstats-1.0.0/TODO	Fri Jul 12 19:16:31 2002
@@ -0,0 +1,6 @@
+username@server instead of nick@server (though H7 has it broken)
+Documentation
+Attempt to get QS code working (as it can also be used on Bahamut, Unreal,
+  and others that use NOQUIT)
+Support Hybrid 7's EOB
+TEST TEST TEST
diff -uNrd operstats-1.0.0.dist/configure operstats-1.0.0/configure
--- operstats-1.0.0.dist/configure	Fri Jul 12 19:13:33 2002
+++ operstats-1.0.0/configure	Fri Jul 12 19:18:49 2002
@@ -251,6 +251,8 @@
 echo "    3) UnrealIRCd 3.1+"
 echo "    4) Bahamut"
 echo "    5) IRCu (P9)"
+echo "    6) Hybrid 6/csircd"
+echo "    7) Hybrid 7"
 while [ $ok -eq 0 ] ; do
 	echo2 "[$IRCD] "
 	if read INPUT ; then : ; else echo "" ; exit 1 ; fi
@@ -278,6 +280,12 @@
 		5)
 			ok=1
 			;;
+		6)
+			ok=1
+			;;
+		7)
+			ok=1
+			;;
 		*)
 			echo "Please choose one of the options listed above."
 			;;
@@ -590,6 +598,17 @@
 
 if [ $IRCD -eq 5 ] ; then cat <<_EOT_ >>inc/sysconf.h
 #define IRCUP9
+_EOT_
+fi
+
+if [ $IRCD -eq 6 ] ; then cat <<_EOT_ >>inc/sysconf.h
+#define HYBRID
+_EOT_
+fi
+
+if [ $IRCD -eq 7 ] ; then cat <<_EOT_ >>inc/sysconf.h
+#define HYBRID
+#define HYB7_EXT
 _EOT_
 fi
 
diff -uNrd operstats-1.0.0.dist/inc/extern.h operstats-1.0.0/inc/extern.h
--- operstats-1.0.0.dist/inc/extern.h	Fri Jul 12 19:13:32 2002
+++ operstats-1.0.0/inc/extern.h	Fri Jul 12 19:19:23 2002
@@ -147,7 +147,7 @@
 E int countusermask (const char *mask);
 E User *findusermask (const char *mask, int matchno);
 E void delete_user (User * user);
-#if defined (BAHAMUT) || defined (PROMETHEUS)
+#if defined (BAHAMUT) || defined (PROMETHEUS) || defined (HYBRID)
 E void do_sjoin (const char *source, int ac, char **av);
 #endif
 
diff -uNrd operstats-1.0.0.dist/src/function.c operstats-1.0.0/src/function.c
--- operstats-1.0.0.dist/src/function.c	Fri Jul 12 19:13:32 2002
+++ operstats-1.0.0/src/function.c	Fri Jul 12 19:20:32 2002
@@ -180,8 +180,13 @@
     char buf[2048];
      
     va_start (args, fmt);
-#ifdef IRCUP9
+#if defined(IRCUP9) || defined(HYBRID)
     /* IRCu doesn't have GlobOps. We'll use wallops. */
+    /* Hybrid note...if there are any CSr servers on the network,
+    ** and this function is called with a client as the sender, the WALLOPS
+    ** will fail to pass through the CSr server.  They are obsolete so
+    ** I don't see any real harm in doing it this way. -Hwy
+    */
     snprintf (buf, sizeof (buf), "WALLOPS :%s", fmt);
 #else
     snprintf (buf, sizeof (buf), "%s :%s", me.token ? "]" : "GLOBOPS", fmt);
diff -uNrd operstats-1.0.0.dist/src/main.c operstats-1.0.0/src/main.c
--- operstats-1.0.0.dist/src/main.c	Fri Jul 12 19:13:32 2002
+++ operstats-1.0.0/src/main.c	Fri Jul 12 19:24:47 2002
@@ -236,6 +236,8 @@
 		"Bahamut");
 #elif defined (IRCUP9)
 		"IRCu (P9)");
+#elif defined (HYBRID)
+                "Hybrid");
 #else
 		"DreamForge");
 #endif
@@ -323,11 +325,22 @@
 
 #ifdef UNREAL3
 	send_cmd (NULL, "PROTOCTL TOKEN NICKv2 UMODE2 VL");
-#elif !defined (BAHAMUT) && !defined (IRCUP9) && !defined (UNREAL3) && !defined (PROMETHEUS)
+#elif !defined (BAHAMUT) && !defined (IRCUP9) && !defined (UNREAL3) && !defined (PROMETHEUS) && !defined(HYBRID)
 	send_cmd (NULL, "PROTOCTL TOKEN");
 #endif
 
-#if defined (BAHAMUT) || defined (PROMETHEUS)
+#ifdef HYBRID
+#ifdef HYB7_EXT
+        /* Force us to be a hub and support Hybrid 7's remote KLINE and
+        ** half-ops capabilities
+        */
+        send_cmd (NULL, "CAPAB KLN HOPS HUB");
+#else
+        /* Otherwise we don't do anything with CAPAB (right now) */
+#endif
+#endif
+
+#if defined (BAHAMUT) || defined (PROMETHEUS) || defined (HYBRID)
 	send_cmd (NULL, "PASS %s :TS", me.pass);
 #else
 	send_cmd (NULL, "PASS :%s", me.pass);
@@ -346,6 +359,11 @@
 #if defined (BAHAMUT) || defined (PROMETHEUS)
 	send_cmd (NULL, "SVINFO 3 3 0 :%lu", time (NULL));
 	send_cmd (NULL, "CAPAB TS3");
+#elif defined (HYBRID)
+        /* Modern EFnet daemons since Sept. 2001 have required TS5
+        ** by default.  Call ourselves TS5 to avoid rejection
+        */
+        send_cmd (NULL, "SVINFO 5 3 0 :%lu", time (NULL));
 #endif
 
 	sgets2 (inbuf, sizeof (inbuf), servsock);
@@ -556,6 +574,10 @@
 #elif defined (BAHAMUT) || defined (PROMETHEUS)
     send_cmd (NULL, "NICK %s 1 %lu %s %s %s %s 0 :%s", nick, time (NULL),
 	modes, user, host, me.name, real);
+#elif defined (HYBRID)
+    /* No services stamp in Hybrid */
+    send_cmd (NULL, "NICK %s 1 %lu %s %s %s %s :%s", nick, time (NULL),
+        modes, user, host, me.name, real);
 #elif defined (IRCUP9)
     send_cmd (NULL, "NICK %s 1 %lu %s %s %s :%s", nick, time (NULL), user, host,
 	me.name, real);
@@ -576,10 +598,19 @@
 #if defined (BAHAMUT) || defined (PROMETHEUS)
 	send_cmd (nick, "SJOIN %ld %ld %s + :%s", time (NULL), time (NULL),
 	    joinchan, nick);
+#elif defined (HYBRID)
+        /* XXX - Optimally, we wait until we know the timestamp of the channel
+        ** and SJOIN in that way.  An alternative as long as there are no
+        ** CSr servers on the network is to create a user that is never in
+        ** a channel to set modes.
+        */
+        send_cmd (me.name, "SJOIN %ld %s + :@%s", time (NULL), joinchan, nick);
 #else
 	send_cmd (nick, "JOIN %s", joinchan);
 #endif
+#ifndef HYBRID
 	send_cmd (nick, "MODE %s +o %s", joinchan, nick);
+#endif
     }
 }
 
diff -uNrd operstats-1.0.0.dist/src/process.c operstats-1.0.0/src/process.c
--- operstats-1.0.0.dist/src/process.c	Fri Jul 12 19:13:32 2002
+++ operstats-1.0.0/src/process.c	Fri Jul 12 19:27:42 2002
@@ -264,7 +264,7 @@
     do_join (source, ac, av);
 }
 
-#if defined (BAHAMUT) || defined (PROMETHEUS)
+#if defined (BAHAMUT) || defined (PROMETHEUS) || defined (HYBRID)
 /* Handle an SJOIN command. */
 static void m_sjoin (char *source, int ac, char **av)
 {
@@ -1522,6 +1522,15 @@
 #elif defined (BAHAMUT) || defined (PROMETHEUS)
 		send_cmd (me.name, "AKILL %s %s 0 %s %ld :%s", hostname,
 		    username, s_OperServ, time (NULL), akill->reason);
+#elif defined (HYB7_EXT)
+                /* If you have Hybrid 6, we could ATTEMPT to do fake GLINE's
+                ** but they are extremely limited.  csircd servers have no
+                ** option at all
+                */
+                send_cmd (s_OperServ, "KLINE * %d %s %s :%s", akill->expires,
+                    username, hostname, akill->reason);
+#elif defined (HYBRID) && !defined (HYB7_EXT)
+                /* Sorry... */
 #else
 		send_cmd (me.name, "%s %s %s :%s", me.token ? "V" : "AKILL",
 		    hostname, username, akill->reason);
@@ -1595,7 +1604,7 @@
     {"UMODE2",	m_umode2},
 #endif
 
-#if defined (BAHAMUT) || defined (PROMETHEUS)
+#if defined (BAHAMUT) || defined (PROMETHEUS) || defined (HYBRID)
     {"SJOIN",	m_sjoin},
 #endif
 
diff -uNrd operstats-1.0.0.dist/src/server.c operstats-1.0.0/src/server.c
--- operstats-1.0.0.dist/src/server.c	Fri Jul 12 19:13:32 2002
+++ operstats-1.0.0/src/server.c	Fri Jul 12 19:31:32 2002
@@ -139,6 +139,15 @@
 #elif defined (BAHAMUT) || defined (PROMETHEUS)
 		send_cmd (me.name, "AKILL %s * 0 %s %ld :%s", u->host,
 		    s_OperServ, time (NULL), akill->reason);
+#elif defined (HYB7_EXT)
+                /* If you have Hybrid 6, we could ATTEMPT to do fake GLINE's
+                ** but they are extremely limited.  csircd servers have no
+                ** option at all
+                */
+                send_cmd (s_OperServ, "KLINE * %d * %s :%s", akill->expires,
+                    u->host, akill->reason);
+#elif defined (HYBRID) && !defined (HYB7_EXT)
+                /* Sorry... */
 #else
 		send_cmd (me.name, "%s %s * :%s", me.token ? "V" : "AKILL",
 		    u->host, akill->reason);
@@ -239,6 +248,12 @@
 		av[6] = server
 		av[7] = servicestamp
 		av[8] = realname
+           Hybrid:
+                av[3] = modes
+                av[4] = username
+                av[5] = hostname
+                av[6] = server
+                av[7] = realname
 	   Unreal:
 		av[3] = username
 		av[4] = hostname
@@ -269,6 +284,9 @@
 #if defined (BAHAMUT) || defined (PROMETHEUS)
 	if (check_akill (av[0], av[4], av[5], av[8]))
 	    return;
+#elif defined (HYBRID)
+        if (check_akill (av[0], av[4], av[5], av[7]))
+            return;
 #elif defined (IRCUP9)
 	if (check_akill (av[0], av[3], av[4], av[6]))
 	    return;
@@ -287,6 +305,14 @@
 
 	av[1] = av[3];
 	do_umode (av[0], 2, av);
+#elif defined (HYBRID)
+        user->user      = sstrdup (av[4]);
+        user->host      = sstrdup (av[5]);
+        user->server    = sstrdup (av[6]);
+        user->real      = sstrdup (av[7]);
+
+        av[1] = av[3];
+        do_umode (av[0], 2, av);
 #elif defined (IRCUP9)
 	user->user	= sstrdup (av[3]);
 	user->host	= sstrdup (av[4]);
@@ -700,10 +726,15 @@
 #if defined (BAHAMUT) || defined (PROMETHEUS)
 	    send_cmd (av[1], "SJOIN %ld %ld %s + :%s", time (NULL), time (NULL),
 		joinchan, av[1]);
+#elif defined (HYBRID)
+            send_cmd (av[1], "SJOIN %ld %s + :@%s", time (NULL),
+                joinchan, av[1]);
 #else
 	    send_cmd (av[1], "JOIN %s", joinchan);
 #endif
+#ifndef HYBRID
 	    send_cmd (av[1], "MODE %s +o %s", joinchan, av[1]);
+#endif
 	}
 	return;
     }
@@ -1009,7 +1040,7 @@
     free (av[0]);
 }
 
-#if defined (BAHAMUT) || defined (PROMETHEUS)
+#if defined (BAHAMUT) || defined (PROMETHEUS) || defined (HYBRID)
 /* Handle an SJOIN command. - Borrowed from IRCServices
 	Bahamut:
 	    av[0] = TS3 timestamp
@@ -1019,6 +1050,13 @@
 	    av[4] = limit / key (depends on modes in av[3])
 	    av[5] = limit / key (depends on modes in av[3])
 	    av[4|5|6] = nickname(s), with modes, joining channel
+        Hybrid:
+            av[0] = TS5 timestamp (creation time if a new channel)
+            av[1] = channel
+            av[2] = channel modes
+            av[3] = limit / key (depends on modes in av[2])
+            av[4] = limit / key (depends on modes in av[2])
+            av[3|4|5] = nickname(s), with modes, joining channel
  */
 void do_sjoin (const char *source, int ac, char **av)
 {
