diff options
-rw-r--r-- | Changes | 1 | ||||
-rw-r--r-- | modules.c | 43 | ||||
-rw-r--r-- | modules.h | 1 | ||||
-rw-r--r-- | modules/hs_moo.c | 11 | ||||
-rw-r--r-- | version.log | 6 |
5 files changed, 51 insertions, 11 deletions
@@ -1,6 +1,7 @@ Anope Version 1.7.0 -------------------- Provided by Anope Dev. <dev@anope.org> +2004/04/04 Fixed moduleAddCommand for a non-existant service 2004/04/01 Added memo2mail and /msg memoserv set notify MAIL/NOMAIL. 2004/03/31 Fixed MySQL double encryption if using MD5. 2004/03/31 Implemented MySQL Phase2 (see docs/MYSQL file) @@ -656,20 +656,49 @@ int moduleAddCommand(CommandHash * cmdTable[], Command * c, int pos) c->mod_name = sstrdup(mod_current_module->name); } + if (cmdTable == HOSTSERV) { - c->service = sstrdup(s_HostServ); + if (s_HostServ) { + c->service = sstrdup(s_HostServ); + } else { + return MOD_ERR_NOSERVICE; + } } else if (cmdTable == BOTSERV) { - c->service = sstrdup(s_BotServ); + if (s_BotServ) { + c->service = sstrdup(s_BotServ); + } else { + return MOD_ERR_NOSERVICE; + } } else if (cmdTable == MEMOSERV) { - c->service = sstrdup(s_MemoServ); + if (s_MemoServ) { + c->service = sstrdup(s_MemoServ); + } else { + return MOD_ERR_NOSERVICE; + } } else if (cmdTable == CHANSERV) { - c->service = sstrdup(s_ChanServ); + if (s_ChanServ) { + c->service = sstrdup(s_ChanServ); + } else { + return MOD_ERR_NOSERVICE; + } } else if (cmdTable == NICKSERV) { - c->service = sstrdup(s_NickServ); + if (s_NickServ) { + c->service = sstrdup(s_NickServ); + } else { + return MOD_ERR_NOSERVICE; + } } else if (cmdTable == HELPSERV) { - c->service = sstrdup(s_HelpServ); + if (s_HelpServ) { + c->service = sstrdup(s_HelpServ); + } else { + return MOD_ERR_NOSERVICE; + } } else if (cmdTable == OPERSERV) { - c->service = sstrdup(s_OperServ); + if (s_OperServ) { + c->service = sstrdup(s_OperServ); + } else { + return MOD_ERR_NOSERVICE; + } } else c->service = sstrdup("Unknown"); @@ -50,6 +50,7 @@ #define MOD_ERR_NODELETE 9 #define MOD_ERR_UNKNOWN 10 #define MOD_ERR_FILE_IO 11 + #define MOD_ERR_NOSERVICE 12 /*************************************************************************/ diff --git a/modules/hs_moo.c b/modules/hs_moo.c index 97d48ae04..3a2fccfe1 100644 --- a/modules/hs_moo.c +++ b/modules/hs_moo.c @@ -23,6 +23,7 @@ int myHostServMooRootHelp(User *u); /* Function to display extra help t int AnopeInit(int argc, char **argv) /* This will be executed when the module is loaded */ { Command *c; /* Pointer to a Command */ + int status = 0; /* the status of our new command */ c = createCommand("moo", hs_moo_show, NULL, -1, -1, -1, -1, -1); /* Create a new command "moo" pointing to hs_moo */ moduleAddHelp(c,myHostServMooHelp); /* add help for all users to this command */ @@ -33,13 +34,17 @@ int AnopeInit(int argc, char **argv) /* This will be executed when the mod moduleSetHostHelp(myHostServHelp); /* add us to the .hs help list */ - - alog("hs_moo.so: Add Command 'moo' Status: %d", /* Log the command being added */ - moduleAddCommand(HOSTSERV, c, MOD_HEAD)); /* And add it to the HOSTSERV cmd table */ + status = moduleAddCommand(HOSTSERV, c, MOD_HEAD); /* Add the command to the HOSTSERV cmd table */ + alog("hs_moo.so: Add Command 'moo' Status: %d",status); /* Log the command being added */ + moduleAddCallback("test",time(NULL)+dotime("15s"),test,0,NULL); /* set a call-back function to exec in 3 mins time */ moduleDelCallback("test"); moduleAddAuthor(AUTHOR); /* tell Anope about the author */ moduleAddVersion(VERSION); /* Tell Anope about the verison */ + + if(status!=MOD_ERR_OK) { + return MOD_STOP; + } return MOD_CONT; } diff --git a/version.log b/version.log index 7e182752f..b6d7ca4d2 100644 --- a/version.log +++ b/version.log @@ -8,11 +8,15 @@ VERSION_MAJOR="1" VERSION_MINOR="7" VERSION_PATCH="0" -VERSION_BUILD="29" +VERSION_BUILD="30" VERSION_EXTRA="" # $Log$ # +# BUILD : 1.7.0 (30) +# BUGS : http://bugs.anope.org/show_bug.cgi?id=3 +# NOTES : Fixed moduleAddCommand for a non-existant service, now returns MOD_ERR_NOSERVICE, updated hs_moo to deal with it nicely +# # BUILD : 1.7.0 (29) # BUGS : http://bugs.anope.org/show_bug.cgi?id=9 # NOTES : Updated en_us.l file to show MAIL as a valid option on notify syntax response |