summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrob rob@31f1291d-b8d6-0310-a050-a5561fc1590b <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-04-04 10:47:35 +0000
committerrob rob@31f1291d-b8d6-0310-a050-a5561fc1590b <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-04-04 10:47:35 +0000
commit1eb2bf791a953cea3ed72a0a4b5ef8380fb656b3 (patch)
tree6abc6c3ab3356f1c8afce0b2d6d5514d7bf478f2
parent5bced6fbefa29746001117b2b33b89d9fb7eb515 (diff)
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
git-svn-id: svn://svn.anope.org/anope/trunk@30 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@21 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r--Changes1
-rw-r--r--modules.c43
-rw-r--r--modules.h1
-rw-r--r--modules/hs_moo.c11
-rw-r--r--version.log6
5 files changed, 51 insertions, 11 deletions
diff --git a/Changes b/Changes
index 996fcdb29..ab4cc6924 100644
--- a/Changes
+++ b/Changes
@@ -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)
diff --git a/modules.c b/modules.c
index 286299f70..6e57aea67 100644
--- a/modules.c
+++ b/modules.c
@@ -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");
diff --git a/modules.h b/modules.h
index d56ce33cb..3568b55a7 100644
--- a/modules.h
+++ b/modules.h
@@ -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