diff -urN anope-1.5.14/Changes anope-1.5.15/Changes
--- anope-1.5.14/Changes	2004-02-19 13:51:04.000000000 -0500
+++ anope-1.5.15/Changes	2004-03-14 16:37:38.000000000 -0500
@@ -1,3 +1,19 @@
+Anope Version 1.5.15
+--------------------
+Provided by Anope Dev.  <dev@anope.org>
+2004/03/14  Fixed LogBot and LogChan issue                            (0000437)
+2004/03/14  Fixed tiny bug in french lang file                        (0000465)
+2004/03/14  Fixed chanmode +r not being removed.		      (0000462)
+2004/03/12  Fixed MySQL limited data fields                           (0000434)
+2004/03/12  Fixed a cosmetic typo                                     (0000440)
+2004/03/14  Fixed mysql (null) values 				      (0000450)
+2004/03/06  Fixed module duplicate functions                          (0000431)
+2004/03/06  Fixed module unload issue                                 (0000432)
+2004/03/13  Fixed missing channel fields on MySQL schema
+2004/03/13  Fixed MySQL calls even when disabled.
+2004/03/07  Fixed a malformed mode crash for some ircd's
+2004/03/13  Added db save on startup
+
 Anope Version 1.5.14
 --------------------
 Provided by Anope Dev.  <dev@anope.org>
diff -urN anope-1.5.14/Changes.conf anope-1.5.15/Changes.conf
--- anope-1.5.14/Changes.conf	2004-02-19 13:51:04.000000000 -0500
+++ anope-1.5.15/Changes.conf	2004-03-14 16:37:38.000000000 -0500
@@ -1,3 +1,11 @@
+Anope Version 1.5.15
+--------------------
+** ADDED    CONFIGURATION DIRECTIVES **
+
+** MODIFIED CONFIGURATION DIRECTIVES **
+
+** DELETED  CONFIGURATION DIRECTIVES **
+
 Anope Version 1.5.14
 --------------------
 ** ADDED    CONFIGURATION DIRECTIVES **
diff -urN anope-1.5.14/Changes.lang anope-1.5.15/Changes.lang
--- anope-1.5.14/Changes.lang	2004-02-19 13:51:04.000000000 -0500
+++ anope-1.5.15/Changes.lang	2004-03-14 16:37:38.000000000 -0500
@@ -1,3 +1,11 @@
+Anope Version 1.5.15
+--------------------
+New Strings:
+
+Modified strings (need to be re-translated):
+
+Deleted strings:
+
 Anope Version 1.5.14
 --------------------
 New Strings:
diff -urN anope-1.5.14/botserv.c anope-1.5.15/botserv.c
--- anope-1.5.14/botserv.c	2004-01-11 10:14:43.000000000 -0500
+++ anope-1.5.15/botserv.c	2004-03-14 09:15:34.000000000 -0500
@@ -8,7 +8,7 @@
  * Based on the original code of Epona by Lara.
  * Based on the original code of Services by Andy Church. 
  * 
- * $Id: botserv.c,v 1.45 2004/01/11 15:14:43 ribosome Exp $
+ * $Id: botserv.c,v 1.46 2004/03/14 14:15:34 certus Exp $
  *
  */
 
@@ -2467,7 +2467,7 @@
         if (text[0] != '\001') {
             send_cmd(ci->bi->nick, "PRIVMSG %s :%s", ci->name, text);
             ci->bi->lastmsg = time(NULL);
-            if (LogChannel && LogBot)
+            if (logchan && LogBot)
                 send_cmd(ci->bi->nick, "PRIVMSG %s :SAY %s %s %s",
                          LogChannel, u->nick, ci->name, text);
         } else {
@@ -2502,7 +2502,7 @@
         send_cmd(ci->bi->nick, "PRIVMSG %s :%cACTION %s%c", ci->name, 1,
                  text, 1);
         ci->bi->lastmsg = time(NULL);
-        if (LogChannel && LogBot)
+        if (logchan && LogBot)
             send_cmd(ci->bi->nick, "PRIVMSG %s :ACT %s %s %s", LogChannel,
                      u->nick, ci->name, text);
     }
diff -urN anope-1.5.14/channels.c anope-1.5.15/channels.c
--- anope-1.5.14/channels.c	2003-11-17 16:34:33.000000000 -0500
+++ anope-1.5.15/channels.c	2004-03-11 11:50:01.000000000 -0500
@@ -8,7 +8,7 @@
  * Based on the original code of Epona by Lara.
  * Based on the original code of Services by Andy Church. 
  * 
- * $Id: channels.c,v 1.35 2003/11/17 21:34:33 dane Exp $
+ * $Id: channels.c,v 1.36 2004/03/11 16:50:01 rob Exp $
  *
  */
 
@@ -566,6 +566,12 @@
             continue;
         }
 
+        if (((int) mode) < 0) {
+            if (debug)
+                alog("Debug: Malformed mode detected on %s.", chan->name);
+            continue;
+        }
+
         if ((cum = &cumodes[(int) mode])->status != 0) {
             User *user;
 
diff -urN anope-1.5.14/chanserv.c anope-1.5.15/chanserv.c
--- anope-1.5.14/chanserv.c	2004-02-14 17:50:32.000000000 -0500
+++ anope-1.5.15/chanserv.c	2004-03-14 12:24:52.000000000 -0500
@@ -8,7 +8,7 @@
  * Based on the original code of Epona by Lara.
  * Based on the original code of Services by Andy Church. 
  * 
- * $Id: chanserv.c,v 1.51 2004/02/14 22:50:32 dane Exp $ 
+ * $Id: chanserv.c,v 1.53 2004/03/14 17:24:52 keeper Exp $ 
  *
  */
 
@@ -1959,6 +1959,13 @@
                     }
                 } else {
                     alog("%s: Deleting channel %s owned by deleted nick %s", s_ChanServ, ci->name, nc->display);
+#ifndef IRC_HYBRID
+                    if (ci->c->mode & CMODE_r) {
+                        ci->c->mode &= ~CMODE_r;
+                        send_cmd(whosends(ci), "MODE %s -r", ci->name);
+                    }
+#endif
+
                     delchan(ci);
                     continue;
                 }
@@ -2691,7 +2698,7 @@
         ci->bi = NULL;
         ci->botflags = BSDefFlags;
         ci->founder->channelcount++;
-        alog("%s: Channel %s registered by %s!%s@%s", s_ChanServ, chan,
+        alog("%s: Channel '%s' registered by %s!%s@%s", s_ChanServ, chan,
              u->nick, u->username, GetHost(u));
         notice_lang(s_ChanServ, u, CHAN_REGISTERED, chan, u->nick);
 #ifndef USE_ENCRYPTION
diff -urN anope-1.5.14/data/tables.sql anope-1.5.15/data/tables.sql
--- anope-1.5.14/data/tables.sql	2003-11-03 11:22:15.000000000 -0500
+++ anope-1.5.15/data/tables.sql	2004-03-13 08:55:59.000000000 -0500
@@ -4,9 +4,9 @@
 CREATE TABLE anope_bs_core (
   bs_id int(11) NOT NULL auto_increment,
   nick varchar(255) NOT NULL default '',
-  user varchar(255) NOT NULL default '',
-  host varchar(255) NOT NULL default '',
-  rname varchar(255) NOT NULL default '',
+  user text NOT NULL default '',
+  host text NOT NULL default '',
+  rname text NOT NULL default '',
   flags int(11) NOT NULL default '0',
   created int(11) NOT NULL default '0',
   chancount int(11) NOT NULL default '0',
@@ -32,7 +32,7 @@
 CREATE TABLE anope_cs_badwords (
   cw_id int(11) NOT NULL auto_increment,
   channel varchar(255) NOT NULL default '',
-  word varchar(255) NOT NULL default '',
+  word text NOT NULL default '',
   type int(11) NOT NULL default '0',
   PRIMARY KEY  (cw_id)
 ) TYPE=MyISAM;
@@ -43,9 +43,9 @@
   ck_id int(11) NOT NULL auto_increment,
   channel varchar(255) NOT NULL default '',
   flags int(11) NOT NULL default '0',
-  dmask varchar(255) NOT NULL default '',
-  reason varchar(255) NOT NULL default '',
-  creator varchar(255) NOT NULL default '',
+  dmask text NOT NULL default '',
+  reason text NOT NULL default '',
+  creator text NOT NULL default '',
   addtime int(11) NOT NULL default '0',
   PRIMARY KEY  (ck_id)
 ) TYPE=MyISAM;
@@ -55,32 +55,34 @@
 CREATE TABLE anope_cs_info (
   ci_id int(11) NOT NULL auto_increment,
   name varchar(255) NOT NULL default '',
-  founder varchar(255) NOT NULL default '',
-  successor varchar(255) NOT NULL default '',
+  founder text NOT NULL default '',
+  successor text NOT NULL default '',
   founderpass tinyblob NOT NULL default '',
-  descr varchar(255) NOT NULL default '',
-  url varchar(255) NOT NULL default '',
-  email varchar(255) NOT NULL default '',
+  descr text NOT NULL default '',
+  url text NOT NULL default '',
+  email text NOT NULL default '',
   time_registered int unsigned NOT NULL default '0',
   last_used int unsigned NOT NULL default '0',
-  last_topic varchar(255) NOT NULL default '',
-  last_topic_setter varchar(255) NOT NULL default '',
+  last_topic text NOT NULL default '',
+  last_topic_setter text NOT NULL default '',
   last_topic_time int unsigned NOT NULL default '0',
   flags int unsigned NOT NULL default '0',
-  forbidby varchar(255) NOT NULL default '',
-  forbidreason varchar(255) NOT NULL default '',
+  forbidby text NOT NULL default '',
+  forbidreason text NOT NULL default '',
   bantype smallint NOT NULL default '0',
   accesscount smallint NOT NULL default '0',
   akickcount smallint NOT NULL default '0',
   mlock_on int unsigned NOT NULL default '0',
   mlock_off int unsigned NOT NULL default '0',
   mlock_limit int unsigned NOT NULL default '0',
-  mlock_key varchar(255) NOT NULL default '',
-  mlock_flood varchar(255) NOT NULL default '',
-  mlock_redirect varchar(255) NOT NULL default '',
-  entry_message varchar(255) NOT NULL default '',
+  mlock_key text NOT NULL default '',
+  mlock_flood text NOT NULL default '',
+  mlock_redirect text NOT NULL default '',
+  entry_message text NOT NULL default '',
+  memomax smallint unsigned NOT NULL default '0',
   botnick varchar(255) NOT NULL default '',
   botflags int unsigned NOT NULL default '0',
+  ttb smallint NOT NULL default '0',
   bwcount smallint NOT NULL default '0',
   capsmin smallint NOT NULL default '0',
   capspercent smallint NOT NULL default '0',
@@ -107,11 +109,11 @@
 DROP TABLE IF EXISTS anope_ms_info;
 CREATE TABLE anope_ms_info (
   nm_id int(11) NOT NULL auto_increment,
-  receiver varchar(255) NOT NULL default '',
+  receiver text NOT NULL default '',
   number int(11) NOT NULL default '0',
   flags int(11) NOT NULL default '0',
   time int(11) NOT NULL default '0',
-  sender varchar(255) NOT NULL default '',
+  sender text NOT NULL default '',
   text blob NOT NULL,
   serv enum('NICK','CHAN') NOT NULL default 'NICK',
   PRIMARY KEY  (nm_id)
@@ -122,7 +124,7 @@
 CREATE TABLE anope_ns_access (
   na_id int(11) NOT NULL auto_increment,
   display varchar(255) NOT NULL default '',
-  access varchar(255) NOT NULL default '',
+  access text NOT NULL default '',
   PRIMARY KEY  (na_id)
 ) TYPE=MyISAM;
 
@@ -135,9 +137,9 @@
   time_registered int unsigned NOT NULL default '0',
   last_seen int unsigned NOT NULL default '0',
   status smallint NOT NULL default '0',
-  last_usermask varchar(255) NOT NULL default '',
-  last_realname varchar(255) NOT NULL default '',
-  last_quit varchar(255) NOT NULL default '',
+  last_usermask text NOT NULL default '',
+  last_realname text NOT NULL default '',
+  last_quit text NOT NULL default '',
   active tinyint(1) NOT NULL default '1',
   PRIMARY KEY  (na_id),
   UNIQUE KEY nick (nick),
@@ -150,9 +152,9 @@
   nc_id int(11) NOT NULL auto_increment,
   display varchar(255) NOT NULL default '',
   pass tinyblob NOT NULL default '',
-  email varchar(255) NOT NULL default '',
+  email text NOT NULL default '',
   icq int unsigned NOT NULL default '0',
-  url varchar(255) NOT NULL default '',
+  url text NOT NULL default '',
   flags int NOT NULL default '0',
   language smallint unsigned NOT NULL default '0',
   accesscount smallint NOT NULL default '0',
@@ -160,7 +162,7 @@
   memomax smallint unsigned NOT NULL default '0',
   channelcount smallint unsigned NOT NULL default '0',
   channelmax smallint unsigned NOT NULL default '0',
-  greet varchar(255) NOT NULL default '',
+  greet text NOT NULL default '',
   active tinyint(1) NOT NULL default '1',
   PRIMARY KEY  (nc_id),
   UNIQUE KEY display (display),
@@ -172,9 +174,9 @@
 CREATE TABLE anope_ns_request (
   nr_id int(11) NOT NULL auto_increment,
   nick varchar(255) NOT NULL default '',
-  passcode varchar(255) NOT NULL default '',
+  passcode text NOT NULL default '',
   password tinyblob NOT NULL default '',
-  email varchar(255) NOT NULL default '',
+  email text NOT NULL default '',
   requested int(11) NOT NULL default '0',
   active int(1) NOT NULL default '1',
   PRIMARY KEY  (nr_id),
@@ -186,10 +188,10 @@
 DROP TABLE IF EXISTS anope_os_akills;
 CREATE TABLE anope_os_akills (
   ok_id int(11) NOT NULL auto_increment,
-  user varchar(255) NOT NULL default '',
-  host varchar(255) NOT NULL default '',
-  xby varchar(255) NOT NULL default '',
-  reason varchar(255) NOT NULL default '',
+  user text NOT NULL default '',
+  host text NOT NULL default '',
+  xby text NOT NULL default '',
+  reason text NOT NULL default '',
   seton int(11) NOT NULL default '0',
   expire int(11) NOT NULL default '0',
   PRIMARY KEY  (ok_id)
@@ -212,7 +214,7 @@
 DROP TABLE IF EXISTS anope_os_status;
 CREATE TABLE anope_os_status (
   os_id int(11) NOT NULL auto_increment,
-  host varchar(255) NOT NULL default '',
+  host text NOT NULL default '',
   status int(11) NOT NULL default '0',
   used int(11) NOT NULL default '0',
   PRIMARY KEY  (os_id)
@@ -222,9 +224,9 @@
 DROP TABLE IF EXISTS anope_os_sglines;
 CREATE TABLE anope_os_sglines (
   og_id int(11) NOT NULL auto_increment,
-  mask varchar(255) NOT NULL default '',
-  xby varchar(255) NOT NULL default '',
-  reason varchar(255) NOT NULL default '',
+  mask text NOT NULL default '',
+  xby text NOT NULL default '',
+  reason text NOT NULL default '',
   seton int(11) NOT NULL default '0',
   expire int(11) NOT NULL default '0',
   PRIMARY KEY  (og_id)
@@ -234,9 +236,9 @@
 DROP TABLE IF EXISTS anope_os_sqlines;
 CREATE TABLE anope_os_sqlines (
   og_id int(11) NOT NULL auto_increment,
-  mask varchar(255) NOT NULL default '',
-  xby varchar(255) NOT NULL default '',
-  reason varchar(255) NOT NULL default '',
+  mask text NOT NULL default '',
+  xby text NOT NULL default '',
+  reason text NOT NULL default '',
   seton int(11) NOT NULL default '0',
   expire int(11) NOT NULL default '0',
   PRIMARY KEY  (og_id)
@@ -246,9 +248,9 @@
 DROP TABLE IF EXISTS anope_os_szlines;
 CREATE TABLE anope_os_szlines (
   og_id int(11) NOT NULL auto_increment,
-  mask varchar(255) NOT NULL default '',
-  xby varchar(255) NOT NULL default '',
-  reason varchar(255) NOT NULL default '',
+  mask text NOT NULL default '',
+  xby text NOT NULL default '',
+  reason text NOT NULL default '',
   seton int(11) NOT NULL default '0',
   expire int(11) NOT NULL default '0',
   PRIMARY KEY  (og_id)
@@ -258,7 +260,7 @@
 DROP TABLE IF EXISTS anope_os_hcache;
 CREATE TABLE anope_os_hcache (
   oh_id int(11) NOT NULL auto_increment,
-  mask varchar(255) NOT NULL default '',
+  mask text NOT NULL default '',
   status int(11) NOT NULL default '0',
   used int(11) NOT NULL default '0',
   PRIMARY KEY  (oh_id)
@@ -268,9 +270,9 @@
 CREATE TABLE anope_hs_core (
   bs_id int(11) NOT NULL auto_increment,
   nick varchar(255) NOT NULL default '',
-  vident varchar(255) NOT NULL default '',
-  vhost varchar(255) NOT NULL default '',
-  creator varchar(255) NOT NULL default '',
+  vident text NOT NULL default '',
+  vhost text NOT NULL default '',
+  creator text NOT NULL default '',
   `time` int(11) NOT NULL default '0',
   PRIMARY KEY  (bs_id),
   UNIQUE KEY nick (nick),
@@ -283,7 +285,7 @@
   type int(11) NOT NULL default '0',
   num int(11) NOT NULL default '0',
   ntext text NOT NULL default '',
-  who varchar(255) NOT NULL default '',
+  who text NOT NULL default '',
   `time` int(11) NOT NULL default '0',
   PRIMARY KEY  (on_id)
 ) TYPE=MyISAM;
@@ -291,10 +293,10 @@
 DROP TABLE IF EXISTS anope_os_exceptions;
 CREATE TABLE anope_os_exceptions (
   oe_id int(11) NOT NULL auto_increment,
-  mask varchar(255) NOT NULL default '',
+  mask text NOT NULL default '',
   lim int(11) NOT NULL default '0',
-  who varchar(255) NOT NULL default '',
-  reason varchar(255) NOT NULL default '',
+  who text NOT NULL default '',
+  reason text NOT NULL default '',
   `time` int(11) NOT NULL default '0',
   expires int(11) NOT NULL default '0',
   PRIMARY KEY  (oe_id)
diff -urN anope-1.5.14/extern.h anope-1.5.15/extern.h
--- anope-1.5.14/extern.h	2004-01-31 13:57:18.000000000 -0500
+++ anope-1.5.15/extern.h	2004-03-13 08:55:59.000000000 -0500
@@ -8,7 +8,7 @@
  * Based on the original code of Epona by Lara.
  * Based on the original code of Services by Andy Church. 
  * 
- * $Id: extern.h,v 1.64 2004/01/31 18:57:18 dane Exp $ 
+ * $Id: extern.h,v 1.65 2004/03/13 13:55:59 dane Exp $ 
  *
  */
 
@@ -546,6 +546,7 @@
 E int   got_alarm;
 E time_t start_time;
 
+E void save_databases(void);
 
 /**** memory.c ****/
 
diff -urN anope-1.5.14/init.c anope-1.5.15/init.c
--- anope-1.5.14/init.c	2004-01-17 23:54:40.000000000 -0500
+++ anope-1.5.15/init.c	2004-03-13 08:55:59.000000000 -0500
@@ -8,7 +8,7 @@
  * Based on the original code of Epona by Lara.
  * Based on the original code of Services by Andy Church. 
  * 
- * $Id: init.c,v 1.39 2004/01/18 04:54:40 dane Exp $ 
+ * $Id: init.c,v 1.40 2004/03/13 13:55:59 dane Exp $ 
  *
  */
 
@@ -677,7 +677,8 @@
 
     alog("Databases loaded");
 
-    /* Convert FFF to mysql here? */
+    /* Save the databases back to file/mysql to reflect any changes */
+    save_databases();
 
     /* Connect to the remote server */
     servsock = conn(RemoteServer, RemotePort, LocalHost, LocalPort);
diff -urN anope-1.5.14/lang/es.l anope-1.5.15/lang/es.l
--- anope-1.5.14/lang/es.l	2004-01-17 23:33:30.000000000 -0500
+++ anope-1.5.15/lang/es.l	2004-03-11 12:37:31.000000000 -0500
@@ -1374,7 +1374,7 @@
 CHAN_LIST_END
 	Fin de la lista - %d/%d concordancia(s) mostrada(s).
 	
-# CLIST responses
+# INVITE responses
 CHAN_INVITE_SYNTAX
 	INVITE canal
 
@@ -3729,9 +3729,9 @@
 	    DROP       Cancela la registracion de un canal
 	    SENDPASS   Ayuda a recuperar claves perdidas
 	
-	Otros comandos: ALIST, BAN, CLEAR, CLIST, DEOP, DEVOICE, 
-	                GETKEY, INFO, INVITE, KICK, LIST, LOGOUT, 
-	                OP, UNBAN, VOICE, VOP
+	Otros comandos: ALIST, BAN, CLEAR, DEOP, DEVOICE, GETKEY,
+	                INFO, INVITE, KICK, LIST, LOGOUT, OP,
+	                UNBAN, VOICE, VOP
 	
 CHAN_HELP_UNREAL
 	
@@ -3840,10 +3840,6 @@
 	                  TOPIC
 	    XOP           Cambia el sistema de privilegios de
 	                  usuario
-	    CLIST         Lista los canales en que el usuario es 
-	                  founder
-	    ALIST         Lista los canales en que el usuario 
-	                  tiene acceso
 	
 	Tipea /msg %S HELP opcion para mayor informacion
 	acerca de una opcion en particular.
diff -urN anope-1.5.14/lang/fr.l anope-1.5.15/lang/fr.l
--- anope-1.5.14/lang/fr.l	2004-01-17 23:33:30.000000000 -0500
+++ anope-1.5.15/lang/fr.l	2004-03-14 12:36:58.000000000 -0500
@@ -6199,6 +6199,6 @@
 
 HOST_HELP_GROUP
 	Syntaxe: GROUP
-	
-	Permet d'enregistrer la vhost du nick actuellement
-	pour tous les pseudos du groupe.
+
+	Permet d'enregistrer la vHost du nick actuellement
+	utilisé pour tous les pseudos du groupe. 
diff -urN anope-1.5.14/main.c anope-1.5.15/main.c
--- anope-1.5.14/main.c	2004-01-17 23:54:40.000000000 -0500
+++ anope-1.5.15/main.c	2004-03-13 08:55:59.000000000 -0500
@@ -22,7 +22,7 @@
  * along with this program (see the file COPYING); if not, write to the
  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: main.c,v 1.22 2004/01/18 04:54:40 dane Exp $
+ * $Id: main.c,v 1.23 2004/03/13 13:55:59 dane Exp $
  *
  */
 
@@ -123,7 +123,7 @@
 
 /*************************************************************************/
 
-static void save_databases(void)
+void save_databases(void)
 {
     waiting = -2;
     if (debug)
diff -urN anope-1.5.14/modules.c anope-1.5.15/modules.c
--- anope-1.5.14/modules.c	2004-02-18 14:00:33.000000000 -0500
+++ anope-1.5.15/modules.c	2004-03-11 11:50:01.000000000 -0500
@@ -8,7 +8,7 @@
  * Based on the original code of Epona by Lara.
  * Based on the original code of Services by Andy Church.
  *
- * $Id: modules.c,v 1.36 2004/02/18 19:00:33 rob Exp $
+ * $Id: modules.c,v 1.37 2004/03/11 16:50:01 rob Exp $
  *
  */
 #include "modules.h"
@@ -97,7 +97,6 @@
 
 Module *createModule(char *filename)
 {
-    int i;
     Module *m;
     if (!filename) {
         return NULL;
@@ -109,10 +108,6 @@
     m->handle = NULL;           /* Handle */
     m->version = NULL;
     m->author = NULL;
-    for (i = 0; i < MAX_CMD_HASH; i++) {        /* Init. the tables */
-        m->cmdList[i] = NULL;
-        m->msgList[i] = NULL;
-    }
     m->nickHelp = NULL;
     m->chanHelp = NULL;
     m->memoHelp = NULL;
@@ -381,6 +376,8 @@
     int idx;
     CommandHash *current = NULL;
     MessageHash *mcurrent = NULL;
+    Command *c;
+    Message *msg;
 
     if (!m) {
         return MOD_ERR_PARAMS;
@@ -389,42 +386,74 @@
     /* Kill any active callbacks this module has */
     moduleCallBackPrepForUnload(m->name);
 
+    /**
+     * ok, im going to walk every hash looking for commands we own, now, not exactly elegant or efficiant :)
+     **/
     for (idx = 0; idx < MAX_CMD_HASH; idx++) {
-        for (current = m->cmdList[idx]; current; current = current->next) {
-            if (current->c && current->c->service) {
-                if (s_HostServ
-                    && (stricmp(s_HostServ, current->c->service) == 0)) {
-                    moduleDelCommand(HOSTSERV, current->c->name);
-                } else if (s_BotServ
-                           && (stricmp(s_BotServ, current->c->service) ==
-                               0)) {
-                    moduleDelCommand(BOTSERV, current->c->name);
-                } else if (s_MemoServ
-                           && (stricmp(s_MemoServ, current->c->service) ==
-                               0)) {
-                    moduleDelCommand(MEMOSERV, current->c->name);
-                } else if (s_ChanServ
-                           && (stricmp(s_ChanServ, current->c->service) ==
-                               0)) {
-                    moduleDelCommand(CHANSERV, current->c->name);
-                } else if (s_NickServ
-                           && (stricmp(s_NickServ, current->c->service) ==
-                               0)) {
-                    moduleDelCommand(NICKSERV, current->c->name);
-                } else if (s_HelpServ
-                           && (stricmp(s_HelpServ, current->c->service) ==
-                               0)) {
-                    moduleDelCommand(HELPSERV, current->c->name);
-                } else {
-                    moduleDelCommand(OPERSERV, current->c->name);
+        for (current = HS_cmdTable[idx]; current; current = current->next) {
+            for (c = current->c; c; c = c->next) {
+                if ((c->mod_name) && (strcmp(c->mod_name, m->name) == 0)) {
+                    moduleDelCommand(HOSTSERV, c->name);
+                }
+            }
+        }
+
+        for (current = BS_cmdTable[idx]; current; current = current->next) {
+            for (c = current->c; c; c = c->next) {
+                if ((c->mod_name) && (strcmp(c->mod_name, m->name) == 0)) {
+                    moduleDelCommand(BOTSERV, c->name);
+                }
+            }
+        }
+
+        for (current = MS_cmdTable[idx]; current; current = current->next) {
+            for (c = current->c; c; c = c->next) {
+                if ((c->mod_name) && (strcmp(c->mod_name, m->name) == 0)) {
+                    moduleDelCommand(MEMOSERV, c->name);
                 }
             }
         }
-        for (mcurrent = m->msgList[idx]; mcurrent;
-             mcurrent = mcurrent->next) {
-            moduleDelMessage(mcurrent->m->name);
+
+        for (current = NS_cmdTable[idx]; current; current = current->next) {
+            for (c = current->c; c; c = c->next) {
+                if ((c->mod_name) && (strcmp(c->mod_name, m->name) == 0)) {
+                    moduleDelCommand(NICKSERV, c->name);
+                }
+            }
+        }
+
+        for (current = CS_cmdTable[idx]; current; current = current->next) {
+            for (c = current->c; c; c = c->next) {
+                if ((c->mod_name) && (strcmp(c->mod_name, m->name) == 0)) {
+                    moduleDelCommand(CHANSERV, c->name);
+                }
+            }
+        }
+
+        for (current = HE_cmdTable[idx]; current; current = current->next) {
+            for (c = current->c; c; c = c->next) {
+                if ((c->mod_name) && (strcmp(c->mod_name, m->name) == 0)) {
+                    moduleDelCommand(HELPSERV, c->name);
+                }
+            }
         }
 
+        for (current = OS_cmdTable[idx]; current; current = current->next) {
+            for (c = current->c; c; c = c->next) {
+                if ((c->mod_name) && (stricmp(c->mod_name, m->name) == 0)) {
+                    moduleDelCommand(OPERSERV, c->name);
+                }
+            }
+        }
+
+        for (mcurrent = IRCD[idx]; mcurrent; mcurrent = mcurrent->next) {
+            for (msg = mcurrent->m; msg; msg = msg->next) {
+                if ((msg->mod_name)
+                    && (stricmp(msg->mod_name, m->name) == 0)) {
+                    moduleDelMessage(msg->name);
+                }
+            }
+        }
     }
     return MOD_ERR_OK;
 }
@@ -545,13 +574,13 @@
     } else
         c->service = sstrdup("Unknown");
 
-    status = addCommand(mod_current_module->cmdList, c, pos);
-    if (status == MOD_ERR_OK) {
-        if (debug)
-            displayCommandFromHash(cmdTable, c->name);
-        status = addCommand(cmdTable, c, pos);
-        if (debug)
-            displayCommandFromHash(cmdTable, c->name);
+    if (debug)
+        displayCommandFromHash(cmdTable, c->name);
+    status = addCommand(cmdTable, c, pos);
+    if (debug)
+        displayCommandFromHash(cmdTable, c->name);
+    if (status != MOD_ERR_OK) {
+        alog("ERROR! [%d]", status);
     }
     return status;
 }
@@ -560,7 +589,7 @@
 {
     Command *c = NULL;
     Command *cmd = NULL;
-    int status;
+    int status = 0;
 
     if (!mod_current_module) {
         return MOD_ERR_UNKNOWN;
@@ -571,22 +600,16 @@
         return MOD_ERR_NOEXIST;
     }
 
-    status =
-        delCommand(mod_current_module->cmdList, c,
-                   mod_current_module->name);
+
     for (cmd = c; cmd; cmd = cmd->next) {
-        if (status == MOD_ERR_OK) {
-            if (cmd->mod_name
-                && strcasecmp(cmd->mod_name,
-                              mod_current_module->name) == 0) {
-                if (debug) {
-                    displayCommandFromHash(cmdTable, name);
-                }
-                status =
-                    delCommand(cmdTable, cmd, mod_current_module->name);
-                if (debug) {
-                    displayCommandFromHash(cmdTable, name);
-                }
+        if (cmd->mod_name
+            && strcasecmp(cmd->mod_name, mod_current_module->name) == 0) {
+            if (debug) {
+                displayCommandFromHash(cmdTable, name);
+            }
+            status = delCommand(cmdTable, cmd, mod_current_module->name);
+            if (debug) {
+                displayCommandFromHash(cmdTable, name);
             }
         }
     }
@@ -679,7 +702,11 @@
     index = CMD_HASH(c->name);
 
     for (current = cmdTable[index]; current; current = current->next) {
-        if (strcasecmp(c->name, current->name) == 0) {  /* the cmd exist's we are a addHead */
+        if ((c->service) && (current->c) && (current->c->service)
+            && (!strcmp(c->service, current->c->service) == 0)) {
+            continue;
+        }
+        if ((strcasecmp(c->name, current->name) == 0)) {        /* the cmd exist's we are a addHead */
             if (pos == 1) {
                 c->next = current->c;
                 current->c = c;
@@ -911,11 +938,9 @@
     m->core = 0;
     m->mod_name = sstrdup(mod_current_module->name);
 
-    status = addMessage(mod_current_module->msgList, m, pos);
-    if (status == MOD_ERR_OK) {
-        status = addMessage(IRCD, m, pos);
-        if (debug)
-            displayMessageFromHash(m->name);
+    status = addMessage(IRCD, m, pos);
+    if (debug) {
+        displayMessageFromHash(m->name);
     }
     return status;
 }
@@ -933,14 +958,9 @@
         return MOD_ERR_NOEXIST;
     }
 
-
-    status =
-        delMessage(mod_current_module->msgList, m,
-                   mod_current_module->name);
-    if (status == MOD_ERR_OK) {
-        status = delMessage(IRCD, m, mod_current_module->name);
-        if (debug)
-            displayMessageFromHash(m->name);
+    status = delMessage(IRCD, m, mod_current_module->name);
+    if (debug) {
+        displayMessageFromHash(m->name);
     }
     return status;
 }
diff -urN anope-1.5.14/modules.h anope-1.5.15/modules.h
--- anope-1.5.14/modules.h	2004-01-11 15:16:45.000000000 -0500
+++ anope-1.5.15/modules.h	2004-03-11 11:50:01.000000000 -0500
@@ -8,7 +8,7 @@
  * Based on the original code of Epona by Lara.
  * Based on the original code of Services by Andy Church. 
  * 
- * $Id: modules.h,v 1.15 2004/01/11 20:16:45 ribosome Exp $
+ * $Id: modules.h,v 1.16 2004/03/11 16:50:01 rob Exp $
  */
 
 #ifndef MODULES_H
@@ -88,7 +88,7 @@
 	void (*hostHelp)(User *u); /* 6 */
 	void (*helpHelp)(User *u); /* 7 */
 
-	CommandHash *cmdList[MAX_CMD_HASH];
+//	CommandHash *cmdList[MAX_CMD_HASH];
 	MessageHash *msgList[MAX_CMD_HASH];
 };
 
diff -urN anope-1.5.14/mysql.c anope-1.5.15/mysql.c
--- anope-1.5.14/mysql.c	2004-01-11 16:37:31.000000000 -0500
+++ anope-1.5.15/mysql.c	2004-03-14 08:02:53.000000000 -0500
@@ -8,7 +8,7 @@
  * Based on the original code of Epona by Lara.
  * Based on the original code of Services by Andy Church. 
  * 
- * $Id: mysql.c,v 1.30 2004/01/11 21:37:31 dane Exp $ 
+ * $Id: mysql.c,v 1.33 2004/03/14 13:02:53 rob Exp $ 
  *
  */
 #include "services.h"
@@ -66,6 +66,10 @@
 
 int db_mysql_open()
 {
+    /* If MySQL is disabled, return 0 */
+    if (!do_mysql)
+        return 0;
+
     mysql = mysql_init(NULL);
     if (mysql == NULL)
         db_mysql_error(MYSQL_WARNING, "Unable to create mysql object");
@@ -140,8 +144,9 @@
     int slen;
     char *quoted;
 
-    if (!sql)
-        return NULL;
+    if (!sql) {
+        return sstrdup("");
+    }
 
     slen = strlen(sql);
     quoted = malloc((1 + (slen * 2)) * sizeof(char));
@@ -403,8 +408,9 @@
              "forbidby='%s',forbidreason='%s',bantype='%d',accesscount='%d',"
              "akickcount='%d',mlock_on='%d',mlock_off='%d',mlock_limit='%d',"
              "mlock_key='%s',mlock_flood='%s',mlock_redirect='%s',entry_message='%s',"
-             "botnick='%s',botflags='%d',bwcount='%d',capsmin='%d',capspercent='%d',"
-             "floodlines='%d',floodsecs='%d',repeattimes='%d',active='1' WHERE name='%s'",
+             "memomax='%d',botnick='%s',botflags='%d',ttb='%d',bwcount='%d',"
+             "capsmin='%d',capspercent='%d',floodlines='%d',floodsecs='%d',"
+             "repeattimes='%d',active='1' WHERE name='%s'",
              cifoundernick,
              cisuccessornick,
              efounderpass, cidesc, ciurl, ciemail,
@@ -426,8 +432,10 @@
              "",
 #endif
              cientrymsg,
+             (int) ci->memos.memomax,
              cibotnick,
              (int) ci->botflags,
+             (int) ci->ttb,
              (int) ci->bwcount,
              (int) ci->capsmin,
              (int) ci->capspercent,
diff -urN anope-1.5.14/nickserv.c anope-1.5.15/nickserv.c
--- anope-1.5.14/nickserv.c	2004-02-19 11:46:29.000000000 -0500
+++ anope-1.5.15/nickserv.c	2004-03-12 22:25:59.000000000 -0500
@@ -8,7 +8,7 @@
  * Based on the original code of Epona by Lara.
  * Based on the original code of Services by Andy Church. 
  * 
- * $Id: nickserv.c,v 1.92 2004/02/19 16:46:29 ribosome Exp $
+ * $Id: nickserv.c,v 1.93 2004/03/13 03:25:59 dane Exp $
  *
  */
 
@@ -2151,7 +2151,7 @@
         if (forced != 1) {
             u->na = na;
             na->u = u;
-            alog("%s: `%s' registered by %s@%s (e-mail: %s)", s_NickServ,
+            alog("%s: '%s' registered by %s@%s (e-mail: %s)", s_NickServ,
                  u->nick, u->username, GetHost(u),
                  (email ? email : "none"));
             notice_lang(s_NickServ, u, NICK_REGISTERED, u->nick,
diff -urN anope-1.5.14/operserv.c anope-1.5.15/operserv.c
--- anope-1.5.14/operserv.c	2004-02-18 14:00:33.000000000 -0500
+++ anope-1.5.15/operserv.c	2004-03-14 17:01:48.000000000 -0500
@@ -8,7 +8,7 @@
  * Based on the original code of Epona by Lara.
  * Based on the original code of Services by Andy Church. 
  * 
- * $Id: operserv.c,v 1.85 2004/02/18 19:00:33 rob Exp $
+ * $Id: operserv.c,v 1.88 2004/03/14 22:01:48 dane Exp $
  *
  */
 
@@ -117,11 +117,17 @@
 int do_modunload(User * u);
 int do_modlist(User * u);
 int do_modinfo(User * u);
+static int showModuleCmdLoaded(CommandHash * cmdList, char *mod_name,
+                               User * u);
+static int showModuleMsgLoaded(MessageHash * msgList, char *mod_name,
+                               User * u);
 #endif
 
 
 #ifdef USE_OSSVS
+#ifndef IRC_HYBRID
 static int do_operumodes(User * u);
+#endif
 static int do_svsnick(User * u);
 #endif
 
@@ -1489,7 +1495,7 @@
  * check user flag for SuperAdmin -rob
  */
 #ifdef USE_OSSVS
-
+#ifndef IRC_HYBRID
 static int do_operumodes(User * u)
 {
     char *nick = strtok(NULL, " ");
@@ -1532,6 +1538,7 @@
     return MOD_CONT;
 }
 #endif
+#endif 
 /**************************************************************************/
 
 /**
@@ -3778,7 +3785,7 @@
             if (modes && !(cu->user->mode & modes))
                 continue;
             notice_lang(s_OperServ, u, OPER_USERLIST_RECORD,
-                        cu->user->nick, cu->user->username,
+                        cu->user->nick, GetIdent(cu->user),
                         GetHost(cu->user));
         }
     } else {
@@ -3792,14 +3799,14 @@
             for (u2 = userlist[i]; u2; u2 = u2->next) {
                 if (pattern) {
                     snprintf(mask, sizeof(mask), "%s!%s@%s", u2->nick,
-                             u2->username, GetHost(u2));
+                             GetIdent(u2), GetHost(u2));
                     if (!match_wild_nocase(pattern, mask))
                         continue;
                     if (modes && !(u2->mode & modes))
                         continue;
                 }
                 notice_lang(s_OperServ, u, OPER_USERLIST_RECORD, u2->nick,
-                            u2->username, GetHost(u2));
+                            GetIdent(u2), GetHost(u2));
             }
         }
     }
@@ -4939,6 +4946,8 @@
     return MOD_CONT;
 }
 
+#ifdef USE_MODULES 
+
 int do_modload(User * u)
 {
     char *name;
@@ -5016,8 +5025,6 @@
     Module *m;
     int idx = 0;
     int display = 0;
-    CommandHash *current = NULL;
-    MessageHash *mcurrent = NULL;
 
     file = strtok(NULL, "");
     if (!file) {
@@ -5033,27 +5040,60 @@
                     m->version ? m->version : "?",
                     m->author ? m->author : "?", timebuf);
         for (idx = 0; idx < MAX_CMD_HASH; idx++) {
-            for (current = m->cmdList[idx]; current;
-                 current = current->next) {
+            display += showModuleCmdLoaded(HOSTSERV[idx], m->name, u);
+            display += showModuleCmdLoaded(OPERSERV[idx], m->name, u);
+            display += showModuleCmdLoaded(NICKSERV[idx], m->name, u);
+            display += showModuleCmdLoaded(CHANSERV[idx], m->name, u);
+            display += showModuleCmdLoaded(BOTSERV[idx], m->name, u);
+            display += showModuleCmdLoaded(MEMOSERV[idx], m->name, u);
+            display += showModuleCmdLoaded(HELPSERV[idx], m->name, u);
+            display += showModuleMsgLoaded(IRCD[idx], m->name, u);
+
+        }
+    }
+    if (display == 0) {
+        notice_lang(s_OperServ, u, OPER_MODULE_NO_INFO, file);
+    }
+    return MOD_CONT;
+}
+
+static int showModuleCmdLoaded(CommandHash * cmdList, char *mod_name,
+                               User * u)
+{
+    Command *c;
+    CommandHash *current;
+    int display = 0;
+
+    for (current = cmdList; current; current = current->next) {
+        for (c = current->c; c; c = c->next) {
+            if ((c->mod_name) && (stricmp(c->mod_name, mod_name) == 0)) {
                 notice_lang(s_OperServ, u, OPER_MODULE_CMD_LIST,
-                            current->c->service, current->c->name);
+                            c->service, c->name);
                 display++;
             }
         }
-        for (idx = 0; idx < MAX_CMD_HASH; idx++) {
-            for (mcurrent = m->msgList[idx]; mcurrent;
-                 mcurrent = mcurrent->next) {
+    }
+    return display;
+}
+
+static int showModuleMsgLoaded(MessageHash * msgList, char *mod_name,
+                               User * u)
+{
+    Message *msg;
+    MessageHash *mcurrent;
+    int display = 0;
+    for (mcurrent = msgList; mcurrent; mcurrent = mcurrent->next) {
+        for (msg = mcurrent->m; msg; msg = msg->next) {
+            if ((msg->mod_name) && (stricmp(msg->mod_name, mod_name) == 0)) {
                 notice_lang(s_OperServ, u, OPER_MODULE_MSG_LIST,
-                            mcurrent->m->name);
+                            msg->name);
                 display++;
             }
         }
     }
-    if (display == 0) {
-        notice_lang(s_OperServ, u, OPER_MODULE_NO_INFO, file);
-    }
-    return MOD_CONT;
+    return display;
 }
 
+#endif
 
 /*************************************************************************/
diff -urN anope-1.5.14/version.log anope-1.5.15/version.log
--- anope-1.5.14/version.log	2004-02-19 13:51:04.000000000 -0500
+++ anope-1.5.15/version.log	2004-03-14 16:39:18.000000000 -0500
@@ -3,15 +3,89 @@
 #
 # Please read COPYING and README for furhter details.
 #
-# $Id: version.log,v 1.74 2004/02/19 18:51:04 dane Exp $
+# $Id: version.log,v 1.86 2004/03/14 21:39:18 dane Exp $
 
 VERSION_MAJOR="1"
 VERSION_MINOR="5"
-VERSION_PATCH="14"
+VERSION_PATCH="15"
 VERSION_BUILD="0"
-VERSION_EXTRA="-rc3"
+VERSION_EXTRA="-rc4"
 
 # $Log: version.log,v $
+# Revision 1.86  2004/03/14 21:39:18  dane
+# 1.5.15 prep
+#
+# Revision 1.85  2004/03/14 17:36:58  rob
+# BUILD : 1.5.14.12
+# BUGS  : 0000465
+# NOTES : Fixed _tiny_ typo-bug in fr.l
+# VTAG  : cvs checkout -D "2004-03-14 17:48" anope-dev
+#
+# Revision 1.84  2004/03/14 17:24:52  keeper
+# BUILD : 1.5.14.10
+# BUGS  : 0000462
+# NOTES : Fixed bug channelmode +r not being removed when nick is dropped.
+#
+# Revision 1.83  2004/03/14 14:15:34  certus
+# BUILD : 1.5.14.9
+# BUGS  : 437
+# NOTES : Fixed bug with logchan and logbot
+# VTAG  : cvs checkout -D "2004-03-14 09:15" anope-dev
+#
+# Revision 1.82  2004/03/14 13:02:53  rob
+# BUILD : 1.5.14.8
+# BUGS  : 0000450
+# NOTES : Fixed cvs (null) values
+# VTAG  : cvs checkout -D "2004-03-14 13:14" anope-dev
+#
+# Revision 1.81  2004/03/13 13:55:59  dane
+# BUILD : 1.5.14.7
+# BUGS  : none
+# NOTES : Added missing channel fields to MySQL table schema. Also
+# 	forced a db save just after the initial db load to populate
+# 	databases.
+# VTAG  : cvs checkout -D "2004-03-13 08:55" anope-dev
+#
+# Revision 1.80  2004/03/13 13:26:23  dane
+# BUILD : 1.5.14.6
+# BUGS  : none
+# NOTES : Added a check for do_mysql on mysql_open() to return 0 if
+# 	MySQL is disabled on the config file.
+# VTAG  : cvs checkout -D "2004-03-13 08:26" anope-dev
+#
+# Revision 1.79  2004/03/13 03:36:18  dane
+# BUILD : 1.5.14.5
+# BUGS  : 434
+# NOTES : Changed most varchars to text.
+# VTAG  : cvs checkout -D "2004-03-12 22:36" anope-dev
+#
+# Revision 1.78  2004/03/13 03:25:59  dane
+# BUILD : 1.5.14.4
+# BUGS  : 0000440
+# NOTES : Typo fixed.
+# VTAG  : cvs checkout -D "2004-03-12 22:25" anope-dev
+#
+# Revision 1.77  2004/03/11 17:37:31  rob
+# BUILD : 1.5.14.3
+# BUGS  : N/A
+# NOTES : Fixed my goof with Changes file, and added CLIST to the spanish
+# language file ( curtusy of DrStein )
+#
+# VTAG  : cvs checkout -D "2004-03-11 17:48" anope-dev
+#
+# Revision 1.76  2004/03/11 16:50:01  rob
+# BUILD : 1.5.14.2
+# BUGS  : 0000431 | 0000432
+# NOTES : Fixed a couple of module bugs, and incoperated dengel's patch for the malformed +b crash - YAY @ cvs being back :P
+#
+# VTAG  : cvs checkout -D "2004-03-11 17:01" anope-dev
+#
+# Revision 1.75  2004/02/19 19:35:30  dane
+# BUILD : 1.5.14.1
+# BUGS  : none
+# NOTES : Framework for development
+# VTAG  : cvs checkout -D "2004-02-19 14:35" anope-dev
+#
 # Revision 1.74  2004/02/19 18:51:04  dane
 # Release 1.5.14-rc3
 #
