summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/commands.c19
-rw-r--r--src/events.c4
-rw-r--r--src/modulemanager.cpp4
-rw-r--r--src/modules.c2
-rw-r--r--src/modules/hs_request.c13
5 files changed, 7 insertions, 35 deletions
diff --git a/src/commands.c b/src/commands.c
index 9481e37d9..da13b6357 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -6,9 +6,9 @@
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
- * Based on the original code of Services by Andy Church.
- *
- * $Id$
+ * Based on the original code of Services by Andy Church.
+ *
+ * $Id$
*
*/
@@ -62,18 +62,14 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[],
notice_lang(service, u, OPER_DEFCON_DENIED);
}
} else {
- mod_current_module_name = c->mod_name;
mod_current_module = NULL;
if ((c->has_priv == NULL) || c->has_priv(u)) {
retVal = c->routine(u);
- mod_current_module_name = NULL;
if (retVal == MOD_CONT) {
current = c->next;
while (current && retVal == MOD_CONT) {
- mod_current_module_name = current->mod_name;
mod_current_module = NULL;
retVal = current->routine(u);
- mod_current_module_name = NULL;
current = current->next;
}
}
@@ -82,7 +78,6 @@ void mod_run_cmd(char *service, User * u, CommandHash * cmdTable[],
alog("Access denied for %s with service %s and command %s",
u->nick, service, cmd);
}
- mod_current_module_name = NULL;
}
} else {
if ((!checkDefCon(DEFCON_SILENT_OPER_ONLY)) || is_oper(u)) {
@@ -135,16 +130,9 @@ void mod_help_cmd(char *service, User * u, CommandHash * cmdTable[],
int cont = MOD_CONT;
const char *p1 = NULL, *p2 = NULL, *p3 = NULL, *p4 = NULL;
Module *calling_module = mod_current_module;
- const char *calling_module_name = mod_current_module_name;
for (current = c; (current) && (cont == MOD_CONT);
current = current->next) {
- mod_current_module_name = current->mod_name;
- if (mod_current_module_name)
- mod_current_module = findModule(mod_current_module_name);
- else
- mod_current_module = NULL;
-
p1 = current->help_param1;
p2 = current->help_param2;
p3 = current->help_param3;
@@ -201,7 +189,6 @@ void mod_help_cmd(char *service, User * u, CommandHash * cmdTable[],
}
mod_current_module = calling_module;
- mod_current_module_name = calling_module_name;
}
/*************************************************************************/
diff --git a/src/events.c b/src/events.c
index ce36aa3e2..6625cfcf1 100644
--- a/src/events.c
+++ b/src/events.c
@@ -63,15 +63,11 @@ void event_process_hook(const char *name, int argc, char **argv)
evh = find_eventhook(name);
if (evh) {
if (evh->func) {
- mod_current_module_name = evh->mod_name;
retVal = evh->func(argc, argv);
- mod_current_module_name = NULL;
if (retVal == MOD_CONT) {
current = evh->next;
while (current && current->func && retVal == MOD_CONT) {
- mod_current_module_name = current->mod_name;
retVal = current->func(argc, argv);
- mod_current_module_name = NULL;
current = current->next;
}
}
diff --git a/src/modulemanager.cpp b/src/modulemanager.cpp
index c14abd94f..6d11299f6 100644
--- a/src/modulemanager.cpp
+++ b/src/modulemanager.cpp
@@ -172,8 +172,6 @@ int ModuleManager::LoadModule(const std::string &modname, User * u)
throw CoreException("Couldn't find constructor, yet moderror wasn't set?");
}
- mod_current_module_name = modname.c_str();
-
/* Create module. */
std::string nick;
if (u)
@@ -210,8 +208,6 @@ int ModuleManager::LoadModule(const std::string &modname, User * u)
return MOD_STOP;
}
- mod_current_module_name = NULL;
-
if (u)
{
ircdproto->SendGlobops(s_OperServ, "%s loaded module %s", u->nick, modname.c_str());
diff --git a/src/modules.c b/src/modules.c
index 9ae18bc70..6a25f4830 100644
--- a/src/modules.c
+++ b/src/modules.c
@@ -29,7 +29,6 @@ MessageHash *IRCD[MAX_CMD_HASH];
ModuleHash *MODULE_HASH[MAX_CMD_HASH];
Module *mod_current_module;
-const char *mod_current_module_name = NULL;
char *mod_current_buffer = NULL;
ModuleCallBack *moduleCallBackHead = NULL;
@@ -1319,7 +1318,6 @@ void ModuleManager::RunCallbacks()
if (debug)
alog("debug: executing callback: %s", tmp->name ? tmp->name : "<unknown>");
if (tmp->func) {
- mod_current_module_name = tmp->owner_name;
tmp->func(tmp->argc, tmp->argv);
mod_current_module = NULL;
moduleCallBackDeleteEntry(NULL);
diff --git a/src/modules/hs_request.c b/src/modules/hs_request.c
index 69b290eab..5aead1a4f 100644
--- a/src/modules/hs_request.c
+++ b/src/modules/hs_request.c
@@ -512,23 +512,18 @@ void my_memo_lang(User * u, char *name, int z, int number, ...)
char *s, *t, *buf;
User *u2;
- if ((mod_current_module_name)
- && (!mod_current_module
- || mod_current_module_name != mod_current_module->name))
- mod_current_module = findModule(mod_current_module_name);
-
u2 = finduser(name);
/* Find the users lang, and use it if we cant */
if (u2 && u2->na && u2->na->nc)
lang = u2->na->nc->language;
/* If the users lang isnt supported, drop back to enlgish */
- if (mod_current_module->lang[lang].argc == 0)
+ if (me->lang[lang].argc == 0)
lang = LANG_EN_US;
/* If the requested lang string exists for the language */
- if (mod_current_module->lang[lang].argc > number) {
- fmt = mod_current_module->lang[lang].argv[number];
+ if (me->lang[lang].argc > number) {
+ fmt = me->lang[lang].argv[number];
buf = sstrdup(fmt);
s = buf;
@@ -546,7 +541,7 @@ void my_memo_lang(User * u, char *name, int z, int number, ...)
}
delete [] buf;
} else {
- alog("%s: INVALID language string call, language: [%d], String [%d]", mod_current_module->name.c_str(), lang, number);
+ alog("%s: INVALID language string call, language: [%d], String [%d]", me->name.c_str(), lang, number);
}
}