diff -uNrd alis-2.4.dist/.depend alis-2.4/.depend
--- alis-2.4.dist/.depend	Tue Aug 14 16:27:05 2001
+++ alis-2.4/.depend	Tue Sep 10 09:21:06 2002
@@ -1,5 +1,4 @@
-alis.o: alis.c servdef.h config.h alis.h list.h hash.h mem.h io.h \
- misc.h
+alis.o: alis.c config.h alis.h list.h hash.h mem.h io.h misc.h
 hash.o: hash.c hash.h list.h
 io.o: io.c io.h config.h
 list.o: list.c list.h mem.h
diff -uNrd alis-2.4.dist/Makefile alis-2.4/Makefile
--- alis-2.4.dist/Makefile	Tue Aug 14 16:27:05 2001
+++ alis-2.4/Makefile	Tue Sep 10 09:21:26 2002
@@ -3,7 +3,7 @@
 
 CC=gcc
 LD=gcc
-CFLAGS=-c -g -O -Wall
+CFLAGS=-c -g -O2 -Wall
 LDFLAGS=
 SRCS=alis.c hash.c io.c list.c misc.c mem.c
 OBJS = ${SRCS:.c=.o}
diff -uNrd alis-2.4.dist/SQUERY alis-2.4/SQUERY
--- alis-2.4.dist/SQUERY	Tue Sep 14 12:51:38 1999
+++ alis-2.4/SQUERY	Wed Dec 31 19:00:00 1969
@@ -1,31 +0,0 @@
-SQUERY listservice list mask* [options]
-
- mask*             channels to search for, * for all
-
-options:
- -min x            minimum users on a channel
- -max x            maximum users on a channel
- -mode (see below) check against channel mode
- -t topic          topic of the channel shall contain word*
- -show [m][t]      show modes (m) and who set the topic (t)
- 
-+tn means channel has tn set
--im means channel has im unset
-=tn means channel is exactly +tn nothing more and nothing less
-
-Examples:
-
-/SQUERY alis list #foo* -min 10 -mode =tn
-
-Lists all channels who contain foo (#foo.int,#foo,...)
-if the mode is exactly = tn.
-
-/SQUERY alis list * -min 10 -topic http
-
-Lists all channels who contain http as word in the topic.
-Examples: "http://www.foo.org","http is cool","my httpd crashed"
-
-/SQUERY alis list * -min 10 -topic http -show mt
-
-Like above, but it will show the modes of the channel
-and the nick who set the topic.
diff -uNrd alis-2.4.dist/TODO alis-2.4/TODO
--- alis-2.4.dist/TODO	Wed Dec 31 19:00:00 1969
+++ alis-2.4/TODO	Tue Sep 10 15:59:01 2002
@@ -0,0 +1,2 @@
+&channels shouldn't be propogated
+support TBURST
diff -uNrd alis-2.4.dist/alis.c alis-2.4/alis.c
--- alis-2.4.dist/alis.c	Thu Aug 15 19:16:30 2002
+++ alis-2.4/alis.c	Tue Sep 10 15:24:06 2002
@@ -22,7 +22,6 @@
 #include <ctype.h>
 #include <unistd.h>
 #include <errno.h>
-#include "servdef.h"
 #include "config.h"
 #include "alis.h"
 #include "list.h"
@@ -31,9 +30,7 @@
 #include "io.h"
 #include "misc.h"
 
-#define SERVICE_VERSION "2.4"
-#define SERVICE_MASK1 SERVICE_WANT_VCHANNEL + SERVICE_WANT_MODE + SERVICE_WANT_TOPIC
-#define SERVICE_MASK2 SERVICE_WANT_VCHANNEL + SERVICE_WANT_MODE + SERVICE_WANT_TOPIC
+#define SERVICE_VERSION "2.4+hybrid_0.1"
 
 #define CTRLBOLD 0x2
 
@@ -126,22 +123,29 @@
     for (i++; i < 15; i++)
 	param[i] = NULL;
 
-    if (param[1] && *param[1] == '2') inburst = 0;
+    /* XXX - This will need to be changed to EOB or PONG */
+    if (param[1])
+    {
+        if (strcmp(param[1],"EOB") == 0)
+            inburst = 0;
+        else if (strcmp(param[1],"PONG") == 0)
+            inburst = 0;
+    }
    
-    if (strcmp(param[0],"CHANNEL") == 0) /* new channel or user number change*/
+    if (strcmp(param[1],"CHANNEL") == 0) /* new channel or user number change*/
     {
        
        /* so we got a new channel, first lets check if he is really new */
        
        isnew = 1;
-	strlwr(param[1]);
+	strlwr(param[2]);
 	if (inburst == 0)
         {
 	    tmp = (struct chaninfo *)find_in_hash_by_name((Hash)chanlist, 
-		    param[1], 0, NULL, channel_hash_func);
+		    param[2], 0, NULL, channel_hash_func);
 	    if (tmp) /* known channel */
 	    {
-		tmp->members = atoi(param[2]);
+		tmp->members = atoi(param[3]);
 		if (!tmp->members)
 		{
 		    totalchannels--;
@@ -156,76 +160,64 @@
 	{
 	    totalchannels++;
 
-	    tmp = (struct chaninfo *)add_to_hash((Hash)chanlist, sizeof(struct chaninfo), param[1], 0, channel_hash_func);
+	    tmp = (struct chaninfo *)add_to_hash((Hash)chanlist, sizeof(struct chaninfo), param[2], 0, channel_hash_func);
 	    
 	    strcpy(tmp->topicnick,"*unknown*");	    
 	    strcpy(tmp->mode,"+");	    
 	    strcpy(tmp->topic,"");
-	    tmp->members = atoi (param[2]);
+	    tmp->members = atoi (param[3]);
 	}
 
 	continue;
     }
 
-    if (strcmp(param[0],"MODE") == 0)
+    if (strcmp(param[1],"MODE") == 0)
     {
-	strlwr(param[1]);
+      if (param[2][0] == '#')
+      {
+	strlwr(param[2]);
 	
-        if (!inburst || strcmp(tmp->name, param[1]))
+        if (!inburst || strcmp(tmp->name, param[2]))
         {
 	    tmp = (struct chaninfo *)find_in_hash_by_name((Hash)chanlist, 
-		    param[1], 0, NULL, channel_hash_func);
+		    param[2], 0, NULL, channel_hash_func);
         }
         
-        if (tmp) strcpy(tmp->mode, param[2]);
+        if (tmp) strcpy(tmp->mode, param[3]);
 	continue;
+      }
     }
     
-    if (strcmp(param[0],"TOPIC") == 0) 
+    if (strcmp(param[1],"TOPIC") == 0) 
     {
-	strlwr(param[1]);
+	strlwr(param[2]);
 	
-        if (!inburst || strcmp(tmp->name, param[1]))
+        if (!inburst || strcmp(tmp->name, param[2]))
         {
 	    tmp = (struct chaninfo *)find_in_hash_by_name((Hash)chanlist, 
-		    param[1], 0, NULL, channel_hash_func);
+		    param[2], 0, NULL, channel_hash_func);
         }
 	
 	if (tmp)
 	{
-            strcpy(tmp->topic, param[2]);
+            strcpy(tmp->topic, param[3]);
 
-            strcpy(tmp->topicnick, "*unknown*");
+            strcpy(tmp->topicnick, param[0]+1);
 	}
 
 
 	continue;
     }
 
-    if (strcmp(param[0],"PING") == 0)
+    /* XXX - Handle remote PING's too */
+    if (strcmp(param[1],"PING") == 0)
     {
-	SockPrintf(sockserv,"PONG %s\n",param[1]);
+	SockPrintf(sockserv,":%s PONG %s :%s\n",SERVICE_HOST,param[2],
+                   SERVICE_HOST);
 	continue;
     }
 
-
-    if (param[1] && strcmp(param[1],"TOPIC") == 0) /* user sets a topic */
-    {
-	strlwr(param[2]);
-	
-	tmp = (struct chaninfo *)find_in_hash_by_name((Hash)chanlist, 
-		    param[2], 0, NULL, channel_hash_func);
-	
-	if (tmp)
-	{
-	    strcpy(tmp->topic, param[3]);
-	    strcpy(tmp->topicnick, (param[0])+1);
-	}
-	continue;
-    }
-    
-        
-    if (param[1] && strcmp(param[1],"SQUERY") == 0) /* someone talks with me */
+    if (param[1] && strcmp(param[1],"PRIVMSG") == 0) /* someone talks with me */
     {
 
 #ifdef LOGSQUERY
@@ -250,10 +242,10 @@
 
 	if (strcmp(param[3],"admin") == 0)
 	{
-	    SockPrintf(sockserv,"NOTICE %s :Administrative info about %s:\n",
-	        param[0],SERVICE_NAME);
-	    SockPrintf(sockserv,"NOTICE %s :%s <%s>\n",
-	        param[0],ADMIN_NAME,ADMIN_EMAIL);
+	    SockPrintf(sockserv,":%s NOTICE %s :Administrative info about %s:\n",
+	        SERVICE_NAME,param[0],SERVICE_NAME);
+	    SockPrintf(sockserv,":%s NOTICE %s :%s <%s>\n",
+	        SERVICE_NAME,param[0],ADMIN_NAME,ADMIN_EMAIL);
 	    continue;
 	
 	}
@@ -264,15 +256,18 @@
 	    if (param[4] && !strcmp(param[4], SERVICE_CTRLPASS))
 	    {
 		char *tmp;
-	        SockPrintf(sockserv,"NOTICE %s :*poof*\n", param[0]);
+	        SockPrintf(sockserv,":%s NOTICE %s :*poof*\n", SERVICE_NAME,
+                           param[0]);
 		tmp = my_calloc(1, 600);
 		sprintf(tmp, "destroyed by %s. good-bye Mr. Anderson!\n", param[0]);
 		die(tmp);
 	    }
 	    else
-		SockPrintf(sockserv,"NOTICE %s :you fool!\n", param[0]);
+		SockPrintf(sockserv,":%s NOTICE %s :you fool!\n", SERVICE_NAME,
+                           param[0]);
 #else
-	    SockPrintf(sockserv,"NOTICE %s :... but i don't want to!\n", param[0]);
+	    SockPrintf(sockserv,":%s NOTICE %s :... but i don't want to!\n",
+                       SERVICE_NAME,param[0]);
 #endif
 	    continue;
 	}
@@ -282,84 +277,85 @@
 	    
 	    if (!param[4] || !(*param[4]))
 	    {
-		SockPrintf(sockserv,"NOTICE %s :Alis help index\n",param[0]);
-		SockPrintf(sockserv,"NOTICE %s :Use /SQUERY %s HELP <topic>\n",param[0], SERVICE_NAME);
-		SockPrintf(sockserv,"NOTICE %s :Available topics: ADMIN, DIE, HASH, INFO, LIST, STATUS, VERSION\n",param[0]);
-		SockPrintf(sockserv,"NOTICE %s :For LIST examples use /SQUERY %s HELP EXAMPLES\n",param[0],SERVICE_NAME);
+		SockPrintf(sockserv,":%s NOTICE %s :Alis help index\n",
+                           SERVICE_NAME,param[0]);
+		SockPrintf(sockserv,":%s NOTICE %s :Use /MSG %s HELP <topic>\n",SERVICE_NAME,param[0], SERVICE_NAME);
+		SockPrintf(sockserv,":%s NOTICE %s :Available topics: ADMIN, DIE, HASH, INFO, LIST, STATUS, VERSION\n",SERVICE_NAME,param[0]);
+		SockPrintf(sockserv,":%s NOTICE %s :For LIST examples use /MSG %s HELP EXAMPLES\n",SERVICE_NAME,param[0],SERVICE_NAME);
 		continue;
 	    }
 	    else
 	    {	
 		if (strcmp(param[4],"admin") == 0)
 		{
-		    SockPrintf(sockserv,"NOTICE %s :Shows administrative information\n",param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :Shows administrative information\n",SERVICE_NAME,param[0]);
 		    continue;
 		}
 		if (strcmp(param[4],"die") == 0)
 		{
-		    SockPrintf(sockserv,"NOTICE %s :don't be silly :P\n",param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :don't be silly :P\n",SERVICE_NAME,param[0]);
 		    continue;
 		}
 		if (strcmp(param[4],"hash") == 0)
 		{
-		    SockPrintf(sockserv,"NOTICE %s :shows hash usage (only to The One)\n",param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :shows hash usage (only to The One)\n",SERVICE_NAME,param[0]);
 		    continue;
 		}
 		if (strcmp(param[4],"info") == 0)
 		{
-		    SockPrintf(sockserv,"NOTICE %s :Shows information about this software\n",param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :Shows information about this software\n",SERVICE_NAME,param[0]);
 		    continue;
 		}
 		if (strcmp(param[4],"status") == 0)
 		{
-		    SockPrintf(sockserv,"NOTICE %s :Shows status information about this software\n",param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :Shows status information about this software\n",SERVICE_NAME,param[0]);
 		    continue;
 		}
 		if (strcmp(param[4],"version") == 0)
 		{
-		    SockPrintf(sockserv,"NOTICE %s :Shows current version\n",param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :Shows current version\n",SERVICE_NAME,param[0]);
 		    continue;
 		}
 		if (strcmp(param[4],"list") == 0)
 		{
-		    SockPrintf(sockserv,"NOTICE %s :Searches for a channel\n",param[0]);
-		    SockPrintf(sockserv,"NOTICE %s :/SQUERY %s LIST mask [-options]\n",param[0], SERVICE_NAME);
-		    SockPrintf(sockserv,"NOTICE %s :  mask               channels to search for, * and ? wildcards accepted\n",param[0]);
-		    SockPrintf(sockserv,"NOTICE %s :  options:\n",param[0]);
-		    SockPrintf(sockserv,"NOTICE %s :   -min x            minimum users on a channel\n",param[0]);
-		    SockPrintf(sockserv,"NOTICE %s :   -max x            maximum users on a channel\n",param[0]);
-		    SockPrintf(sockserv,"NOTICE %s :   -m mode           check against channel mode\n",param[0]);
-		    SockPrintf(sockserv,"NOTICE %s :    +tn means channel has tn set\n",param[0]);
-		    SockPrintf(sockserv,"NOTICE %s :    -im means channel has im unset\n",param[0]);
-		    SockPrintf(sockserv,"NOTICE %s :    =tn means channel is exactly +tn nothing more and nothing less\n",param[0]);
-		    SockPrintf(sockserv,"NOTICE %s :   -mode mode        same as above\n",param[0]);
-		    SockPrintf(sockserv,"NOTICE %s :   -t string         topic of the channel shall contain string\n",param[0]);
-		    SockPrintf(sockserv,"NOTICE %s :   -topic string     same as above\n",param[0]);
-		    SockPrintf(sockserv,"NOTICE %s :   -s [m][t]         show modes (m) and who set the topic (t)\n",param[0]);
-		    SockPrintf(sockserv,"NOTICE %s :   -show [m][t]      same as above\n",param[0]);
-		    SockPrintf(sockserv,"NOTICE %s :See also: HELP EXAMPLES\n",param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :Searches for a channel\n",SERVICE_NAME,param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :/MSG %s LIST mask [-options]\n",SERVICE_NAME,param[0], SERVICE_NAME);
+		    SockPrintf(sockserv,":%s NOTICE %s :  mask               channels to search for, * and ? wildcards accepted\n",SERVICE_NAME,param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :  options:\n",SERVICE_NAME,param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :   -min x            minimum users on a channel\n",SERVICE_NAME,param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :   -max x            maximum users on a channel\n",SERVICE_NAME,param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :   -m mode           check against channel mode\n",SERVICE_NAME,param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :    +tn means channel has tn set\n",SERVICE_NAME,param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :    -im means channel has im unset\n",SERVICE_NAME,param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :    =tn means channel is exactly +tn nothing more and nothing less\n",SERVICE_NAME,param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :   -mode mode        same as above\n",SERVICE_NAME,param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :   -t string         topic of the channel shall contain string\n",SERVICE_NAME,param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :   -topic string     same as above\n",SERVICE_NAME,param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :   -s [m][t]         show modes (m) and who set the topic (t)\n",SERVICE_NAME,param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :   -show [m][t]      same as above\n",SERVICE_NAME,param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :See also: HELP EXAMPLES\n",SERVICE_NAME,param[0]);
 		    continue;
 		}
 		if (strcmp(param[4],"examples") == 0)
 		{
-		    SockPrintf(sockserv,"NOTICE %s :LIST Examples:\n",param[0]);
-		    SockPrintf(sockserv,"NOTICE %s :/SQUERY %s LIST #foo* -min 10 -mode =tn\n",param[0], SERVICE_NAME);
+		    SockPrintf(sockserv,":%s NOTICE %s :LIST Examples:\n",SERVICE_NAME,param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :/MSG %s LIST #foo* -min 10 -mode =tn\n",SERVICE_NAME,param[0], SERVICE_NAME);
 
-		    SockPrintf(sockserv,"NOTICE %s :Lists all channels who contain foo (#foo.int,#foo,...)\n",param[0]);
-		    SockPrintf(sockserv,"NOTICE %s :if the mode is exactly = tn.\n",param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :Lists all channels who contain foo (#foo.int,#foo,...)\n",SERVICE_NAME,param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :if the mode is exactly = tn.\n",SERVICE_NAME,param[0]);
 
-		    SockPrintf(sockserv,"NOTICE %s :/SQUERY %s LIST * -min 10 -t http\n",param[0], SERVICE_NAME);
+		    SockPrintf(sockserv,":%s NOTICE %s :/MSG %s LIST * -min 10 -t http\n",SERVICE_NAME,param[0], SERVICE_NAME);
 
-		    SockPrintf(sockserv,"NOTICE %s :Lists all channels who contain http as word in the topic.\n",param[0]);
-		    SockPrintf(sockserv,"NOTICE %s :Examples: \"http://www.foo.org\",\"http is cool\",\"my httpd crashed\"\n",param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :Lists all channels who contain http as word in the topic.\n",SERVICE_NAME,param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :Examples: \"http://www.foo.org\",\"http is cool\",\"my httpd crashed\"\n",SERVICE_NAME,param[0]);
 
-		    SockPrintf(sockserv,"NOTICE %s :/SQUERY %s LIST * -min 10 -t http -show mt\n",param[0], SERVICE_NAME);
+		    SockPrintf(sockserv,":%s NOTICE %s :/MSG %s LIST * -min 10 -t http -show mt\n",SERVICE_NAME,param[0], SERVICE_NAME);
 
-		    SockPrintf(sockserv,"NOTICE %s :Like above, but it will show the modes of the channel\n",param[0]);
-		    SockPrintf(sockserv,"NOTICE %s :and the nick who set the topic.\n",param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :Like above, but it will show the modes of the channel\n",SERVICE_NAME,param[0]);
+		    SockPrintf(sockserv,":%s NOTICE %s :and the nick who set the topic.\n",SERVICE_NAME,param[0]);
 		    continue;
 		}
-		SockPrintf(sockserv,"NOTICE %s :No such help topic: \"%s\". Use /SQUERY %s HELP\n",param[0],param[4], SERVICE_NAME);
+		SockPrintf(sockserv,":%s NOTICE %s :No such help topic: \"%s\". Use /MSG %s HELP\n",SERVICE_NAME,param[0],param[4], SERVICE_NAME);
 
 	    }
 	    continue;
@@ -367,11 +363,11 @@
 	
 	if (strcmp(param[3],"status") == 0)
 	{
-	    SockPrintf(sockserv,"NOTICE %s :Alis %s status:\n",param[0],SERVICE_VERSION);
-	    SockPrintf(sockserv,"NOTICE %s :totalchannels: %i\n",
-	        param[0],totalchannels); 
-	    SockPrintf(sockserv,"NOTICE %s :SQUERY statistic: %i total requests, %i list requests\n",
-	        param[0],squeries,listqueries);
+	    SockPrintf(sockserv,":%s NOTICE %s :Alis %s status:\n",SERVICE_NAME,param[0],SERVICE_VERSION);
+	    SockPrintf(sockserv,":%s NOTICE %s :totalchannels: %i\n",
+	        SERVICE_NAME,param[0],totalchannels); 
+	    SockPrintf(sockserv,":%s NOTICE %s :MSG statistic: %i total requests, %i list requests\n",
+	        SERVICE_NAME,param[0],squeries,listqueries);
 	    continue;
 	}
 	if (strcmp(param[3],"hash") == 0)
@@ -379,11 +375,11 @@
 #ifdef SERVICE_CTRLPASS
 	    if (param[4] && !strcmp(param[4], SERVICE_CTRLPASS))
 	    {
-	    SockPrintf(sockserv,"NOTICE %s :Alis %s hash usage:\n",param[0],SERVICE_VERSION);
-	    SockPrintf(sockserv,"NOTICE %s :totalchannels: %i\n",
-	        param[0],totalchannels);
-	    SockPrintf(sockserv,"NOTICE %s :hash size: %i\n",
-		param[0],CHANNEL_HASH_SIZE);    
+	    SockPrintf(sockserv,":%s NOTICE %s :Alis %s hash usage:\n",SERVICE_NAME,param[0],SERVICE_VERSION);
+	    SockPrintf(sockserv,":%s NOTICE %s :totalchannels: %i\n",
+	        SERVICE_NAME,param[0],totalchannels);
+	    SockPrintf(sockserv,":%s NOTICE %s :hash size: %i\n",
+		SERVICE_NAME,param[0],CHANNEL_HASH_SIZE);    
 	    hashused = 0;
 	    hashmin = INT_MAX;
 	    hashmax = 0;
@@ -397,42 +393,42 @@
 		if (hashbox > hashmax)
 		    hashmax = hashbox;
 	    }
-	    SockPrintf(sockserv, "NOTICE %s :%i boxes used\n",
-		    param[0], hashused);
-	    SockPrintf(sockserv, "NOTICE %s :smallest box contains %i items\n",
-		    param[0], hashmin);
-	    SockPrintf(sockserv, "NOTICE %s :largest box contains %i items\n",
-		    param[0], hashmax);
-	    SockPrintf(sockserv, "NOTICE %s :average box usage is %f items\n",
-		    param[0], (double) totalchannels / (double) hashused);
-	    SockPrintf(sockserv, "NOTICE %s :optimal box usage should be %f items\n",
-		    param[0], (double) totalchannels / (double) CHANNEL_HASH_SIZE);
+	    SockPrintf(sockserv, ":%s NOTICE %s :%i boxes used\n",
+		    SERVICE_NAME,param[0], hashused);
+	    SockPrintf(sockserv, ":%s NOTICE %s :smallest box contains %i items\n",
+		    SERVICE_NAME,param[0], hashmin);
+	    SockPrintf(sockserv, ":%s NOTICE %s :largest box contains %i items\n",
+		    SERVICE_NAME,param[0], hashmax);
+	    SockPrintf(sockserv, ":%s NOTICE %s :average box usage is %f items\n",
+		    SERVICE_NAME,param[0], (double) totalchannels / (double) hashused);
+	    SockPrintf(sockserv, ":%s NOTICE %s :optimal box usage should be %f items\n",
+		    SERVICE_NAME, param[0], (double) totalchannels / (double) CHANNEL_HASH_SIZE);
 	    }
 	    else
-	    SockPrintf(sockserv, "NOTICE %s :You're not The One so don't play around!\n",
-	            param[0]);
+	    SockPrintf(sockserv, ":%s NOTICE %s :You're not The One so don't play around!\n",
+	            SERVICE_NAME,param[0]);
 	    
 #else
-	    SockPrintf(sockserv, "NOTICE %s :They disabled this command! Those bastards!", param[0]);
+	    SockPrintf(sockserv, ":%s NOTICE %s :They disabled this command! Those bastards!", SERVICE_NAME,param[0]);
 #endif
 	    continue;
 	}
 	if (strcmp(param[3],"info") == 0)
 	{
-	    SockPrintf(sockserv,"NOTICE %s :Information about %s:\n",
-	        param[0],SERVICE_NAME);
-	    SockPrintf(sockserv,"NOTICE %s :Programmed by %s\n",
-	        param[0], AUTHORS);
-	    SockPrintf(sockserv,"NOTICE %s :For more information mail to %s\n",
-	        param[0], ADMIN_EMAIL);
+	    SockPrintf(sockserv,":%s NOTICE %s :Information about %s:\n",
+	        SERVICE_NAME,param[0],SERVICE_NAME);
+	    SockPrintf(sockserv,":%s NOTICE %s :Programmed by %s\n",
+	        SERVICE_NAME,param[0], AUTHORS);
+	    SockPrintf(sockserv,":%s NOTICE %s :For more information mail to %s\n",
+	        SERVICE_NAME,param[0], ADMIN_EMAIL);
 		
 	    continue;
 	
 	}
 	if (strcmp(param[3],"version") == 0)
 	{
-	    SockPrintf(sockserv,"NOTICE %s :%s version %s\n",
-	        param[0],SERVICE_NAME,SERVICE_VERSION);
+	    SockPrintf(sockserv,":%s NOTICE %s :%s version %s\n",
+	        SERVICE_NAME,param[0],SERVICE_NAME,SERVICE_VERSION);
 	    continue;
 	}
 	
@@ -475,7 +471,7 @@
 			if (token[0] == '-') qmodetype = 3;
 			if (!qmodetype)
 			{
-	                    SockPrintf(sockserv,"NOTICE %s :Invalid mode type: %c\n",param[0],token[0]);
+	                    SockPrintf(sockserv,":%s NOTICE %s :Invalid mode type: %c\n",SERVICE_NAME,param[0],token[0]);
 			    bad++;
 			}
 			strcpy(qmode,token);
@@ -503,7 +499,7 @@
 				    shownick = 1;
 				    break;
 				default:
-				    SockPrintf(sockserv,"NOTICE %s :Invalid -SHOW option: %c\n",param[0],*p);
+				    SockPrintf(sockserv,":%s NOTICE %s :Invalid -SHOW option: %c\n",SERVICE_NAME,param[0],*p);
 				    bad++;
 			    }
 			}
@@ -524,14 +520,14 @@
 		    {
 			if (*token == '-')
 			{
-			    SockPrintf(sockserv,"NOTICE %s :Invalid option: %s\n",param[0],token);
+			    SockPrintf(sockserv,":%s NOTICE %s :Invalid option: %s\n",SERVICE_NAME,param[0],token);
 			    bad++;
 			}
 			else
 			{
 			    if (*qchannel)
 			    {
-			        SockPrintf(sockserv,"NOTICE %s :Garbage word: %s\n",param[0],token);
+			        SockPrintf(sockserv,":%s NOTICE %s :Garbage word: %s\n",SERVICE_NAME,param[0],token);
 				bad++;
 			    }
 			    else
@@ -544,18 +540,18 @@
 
 	    if (!*qchannel)
 	    {
-	        SockPrintf(sockserv,"NOTICE %s :You didn't specify a channel mask.\n",param[0]);
+	        SockPrintf(sockserv,":%s NOTICE %s :You didn't specify a channel mask.\n",SERVICE_NAME,param[0]);
 		bad++;
 	    }
 
 	    if (bad)
 	    {
-		SockPrintf(sockserv,"NOTICE %s :Your query contains %i errors. Use /SQUERY %s HELP LIST\n",param[0], bad, SERVICE_NAME);
+		SockPrintf(sockserv,":%s NOTICE %s :Your query contains %i errors. Use /MSG %s HELP LIST\n",SERVICE_NAME,param[0], bad, SERVICE_NAME);
 		continue;
 	    }
 
 	    
-	    SockPrintf(sockserv,"NOTICE %s :Query summary: searching for channels matching \"%s\"", param[0], qchannel);
+	    SockPrintf(sockserv,":%s NOTICE %s :Query summary: searching for channels matching \"%s\"", SERVICE_NAME,param[0], qchannel);
 	    if (qminusers)
 		SockPrintf(sockserv,", min %i users",qminusers);
 	    if (qmaxusers < INT_MAX)
@@ -588,7 +584,7 @@
 
 	    SockPrintf(sockserv, ".\n");
 
-	    SockPrintf(sockserv,"NOTICE %s :Returning a maximum of %i channel names.\n",param[0],MAXREPLY);
+	    SockPrintf(sockserv,":%s NOTICE %s :Returning a maximum of %i channel names.\n",SERVICE_NAME,param[0],MAXREPLY);
 	
 	    replied = 0;
 	    match = 0;
@@ -633,7 +629,8 @@
 			    if (replied < MAXREPLY)
 			    {
 			    
-				SockPrintf(sockserv,"NOTICE %s :",param[0]);
+				SockPrintf(sockserv,":%s NOTICE %s :",
+                                           SERVICE_NAME,param[0]);
 				SockPrintf(sockserv,"%-50s",tmp->name);
 				if (showmode == 1)
 				    SockPrintf(sockserv," %-12s",tmp->mode);
@@ -649,12 +646,12 @@
 		}
 	    }
 
-	    SockPrintf(sockserv,"NOTICE %s :found %i visible channels.\n",
-	    param[0],replied);
+	    SockPrintf(sockserv,":%s NOTICE %s :found %i visible channels.\n",
+	               SERVICE_NAME,param[0],replied);
 	    continue;
 	    
 	}
-	SockPrintf(sockserv,"NOTICE %s :Unrecognized command: \"%s\". Use /SQUERY %s HELP\n",param[0], param[3], SERVICE_NAME);
+	SockPrintf(sockserv,":%s NOTICE %s :Unrecognized command: \"%s\". Use /MSG %s HELP\n",SERVICE_NAME,param[0], param[3], SERVICE_NAME);
     }
 }
 
@@ -696,7 +693,7 @@
 #ifdef SDEBUG
     puts(s);
 #endif
-    SockPrintf(sockserv, "QUIT :%s", s);
+    SockPrintf(sockserv, ":%s QUIT :%s", SERVICE_NAME, s);
     unlink(PID_FILE);
     sleep(10);
     exit(0);
@@ -714,14 +711,17 @@
     }
     printf("Sending password...\n");
     
-    SockPrintf(sockserv,"PASS %s\n", SERVICE_PASS);
+    /* XXX - Add TBURST */
+    SockPrintf(sockserv,"CAPAB :QS ALIS EOB\n");
+    SockPrintf(sockserv,"PASS %s :TS\n", SERVICE_PASS);
     printf("Introducing...\n");
-    SockPrintf(sockserv,"SERVICE %s %s %s %i 0 :%s\n",
-    SERVICE_NAME,SERVICE_HOST,SERVICE_DIST,SERVICE_MASK2,SERVICE_DESC);
-    
-    SockPrintf(sockserv,"SERVSET %i %i\n",SERVICE_MASK1,SERVICE_MASK2);
-
-    SockPrintf(sockserv,"LUSERS\n");
+    SockPrintf(sockserv,"SERVER %s 1 :%s\n",
+               SERVICE_HOST,SERVICE_DESC);
+    SockPrintf(sockserv,"NICK %s 1 %ld + %s %s %s :%s\n",SERVICE_NAME,
+               time(NULL),SERVICE_NAME,SERVICE_HOST,SERVICE_HOST,SERVICE_DESC);
+    SockPrintf(sockserv,":%s EOB\n", SERVICE_HOST);
+    /* A hack for detecting EOB for non EOB servers */
+    SockPrintf(sockserv,"PING :EOB\n");
 }
 
 int main(int argc, char *argv[])
diff -uNrd alis-2.4.dist/config.h alis-2.4/config.h
--- alis-2.4.dist/config.h	Sat Jul 13 21:45:34 2002
+++ alis-2.4/config.h	Tue Sep 10 09:21:00 2002
@@ -6,14 +6,11 @@
 */
 #define SERVICE_PASS     "mypassword"
 #define SERVICE_CTRLPASS "secretpassword" /* important */
-#define SERVICE_NAME     "List"
-#define SERVER_NAME      "127.0.0.1" /* host or IP, IPv4 or IPv6 */
+#define SERVICE_NAME     "ALIS"
+#define SERVER_NAME      "irc.efnet.org"
 #define SERVER_PORT       6667
-#define SERVICE_DIST     "*" /* looks like it works only with "*" (ircd bug) 
-				(8/18/99)<syrk> most bugs are worth patching
-			      */
 #define SERVICE_DESC     "Advanced List Service"
-#define SERVICE_HOST     "127.0.0.2" /* :) */
+#define SERVICE_HOST     "alis.efnet.org" /* :) */
 #define PID_FILE         "alis.pid"
 #define ADMIN_EMAIL      "foo@foo.bar"
 #define ADMIN_NAME       "foobar"
@@ -26,8 +23,8 @@
 
 #define MAXREPLY    60 /* maximum channels a user should be able to list */
 
-#define TOPICLEN        80	/* this value MUST be in sync with your ircd */
-#define CHANNELLEN      50
+#define TOPICLEN        120	/* this value MUST be in sync with your ircd */
+#define CHANNELLEN      200
 #define CHANNEL_HASH_SIZE 10001
 
 
diff -uNrd alis-2.4.dist/servdef.h alis-2.4/servdef.h
--- alis-2.4.dist/servdef.h	Tue Aug 14 16:27:05 2001
+++ alis-2.4/servdef.h	Wed Dec 31 19:00:00 1969
@@ -1,39 +0,0 @@
-/* this is from ircd/service_def.h */
-
-#define	SERVICE_WANT_SERVICE	0x00000001 /* other services signing on/off */
-#define	SERVICE_WANT_OPER	0x00000002 /* operators, included in _UMODE */
-#define	SERVICE_WANT_UMODE	0x00000004 /* user modes, iow + local modes */
-#define	SERVICE_WANT_AWAY	0x00000008 /* away isn't propaged anymore.. */
-#define	SERVICE_WANT_KILL	0x00000010 /* KILLs */
-#define	SERVICE_WANT_NICK	0x00000020 /* all NICKs (new user, change) */
-#define	SERVICE_WANT_USER	0x00000040 /* USER signing on */
-#define	SERVICE_WANT_QUIT	0x00000080 /* all QUITs (users signing off) */
-#define	SERVICE_WANT_SERVER	0x00000100 /* servers signing on */
-#define	SERVICE_WANT_WALLOP	0x00000200 /* wallops */
-#define	SERVICE_WANT_SQUIT	0x00000400 /* servers signing off */
-#define	SERVICE_WANT_RQUIT	0x00000800 /* regular user QUITs (these which
-					   are also sent between servers) */
-#define	SERVICE_WANT_MODE	0x00001000 /* channel modes (not +ov) */
-#define	SERVICE_WANT_CHANNEL	0x00002000 /* channel creations/destructions */
-#define	SERVICE_WANT_VCHANNEL	0x00004000 /* channel joins/parts */
-#define	SERVICE_WANT_TOPIC	0x00008000 /* channel topics */
-
-#define	SERVICE_WANT_ERRORS	0x01000000 /* &ERRORS */
-#define	SERVICE_WANT_NOTICES	0x02000000 /* &NOTICES */
-#define	SERVICE_WANT_LOCAL	0x04000000 /* &LOCAL */
-#define	SERVICE_WANT_NUMERICS	0x08000000 /* &NUMERICS */
-
-#define	SERVICE_WANT_USERLOG	0x10000000 /* FNAME_USERLOG */
-#define	SERVICE_WANT_CONNLOG	0x20000000 /* FNAME_CONNLOG */
-
-/* masks */
-#define	SERVICE_MASK_GLOBAL	0x00007000 /*for these,service must be global*/
-#define	SERVICE_MASK_PREFIX	0x00000FFF /* these actions have a prefix */
-#define	SERVICE_MASK_ALL	0x3F00FFFF /* all possible actions */
-#define	SERVICE_MASK_NUM	(SERVICE_WANT_NICK|SERVICE_WANT_USER|\
-				 SERVICE_WANT_UMODE)
-
-/* options */
-#define	SERVICE_WANT_PREFIX	0x00010000 /* to receive n!u@h instead of n */
-#define	SERVICE_WANT_TOKEN	0x00020000 /* use serv token instead of name */
-#define	SERVICE_WANT_EXTNICK	0x00040000 /* user extended NICK syntax */
