summaryrefslogtreecommitdiff
path: root/src/modules.c
diff options
context:
space:
mode:
authorRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-11-08 01:13:19 +0000
committerRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-11-08 01:13:19 +0000
commitd2e5ef67e3cd1bab3af02fabc521533fda2d9da8 (patch)
treef2593b651b0fa25383c1190bf226680e57a79a09 /src/modules.c
parentd5162d6e45aa484b918f4e2f97f5fcfb49b537e0 (diff)
moduleInsertLanguage() -> Module::InsertLanguage()
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1585 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/modules.c')
-rw-r--r--src/modules.c49
1 files changed, 20 insertions, 29 deletions
diff --git a/src/modules.c b/src/modules.c
index 7d0bc3f17..76852d581 100644
--- a/src/modules.c
+++ b/src/modules.c
@@ -409,6 +409,26 @@ void Module::SetType(MODType type)
this->type = type;
}
+void Module::InsertLanguage(int langNumber, int ac, const char **av)
+{
+ int i;
+
+ if (debug)
+ alog("debug: %s Adding %d texts for language %d", this->name.c_str(), ac, langNumber);
+
+ if (this->lang[langNumber].argc > 0) {
+ moduleDeleteLanguage(langNumber);
+ }
+
+ this->lang[langNumber].argc = ac;
+ this->lang[langNumber].argv =
+ (char **)malloc(sizeof(char *) * ac);
+ for (i = 0; i < ac; i++) {
+ this->lang[langNumber].argv[i] = sstrdup(av[i]);
+ }
+}
+
+
/**
* Add the module to the list of currently loaded modules.
@@ -2475,35 +2495,6 @@ int moduleGetConfigDirective(Directive * d)
}
/**
- * Allow a module to add a set of language strings to anope
- * @param langNumber the language number for the strings
- * @param ac The language count for the strings
- * @param av The language sring list.
- **/
-void moduleInsertLanguage(int langNumber, int ac, const char **av)
-{
- int i;
-
- if ((mod_current_module_name) && (!mod_current_module || mod_current_module_name != mod_current_module->name)) {
- mod_current_module = findModule(mod_current_module_name);
- }
-
- if (debug)
- alog("debug: %s Adding %d texts for language %d", mod_current_module->name.c_str(), ac, langNumber);
-
- if (mod_current_module->lang[langNumber].argc > 0) {
- moduleDeleteLanguage(langNumber);
- }
-
- mod_current_module->lang[langNumber].argc = ac;
- mod_current_module->lang[langNumber].argv =
- (char **)malloc(sizeof(char *) * ac);
- for (i = 0; i < ac; i++) {
- mod_current_module->lang[langNumber].argv[i] = sstrdup(av[i]);
- }
-}
-
-/**
* Send a notice to the user in the correct language, or english.
* @param source Who sends the notice
* @param u The user to send the message to