diff options
author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-19 00:48:29 +0000 |
---|---|---|
committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-19 00:48:29 +0000 |
commit | 0f069f0e8becfd1770a6ce396ead7aa67e3bde06 (patch) | |
tree | ede474534d89b32bcdcc24d58e5cca6c427d6176 /src/modules/hs_request.c | |
parent | 1a2fdff0c653562ebde967850875e5445bc0c5ae (diff) |
Converted modules to use ConfigReader to access new config parser.
Added all module directives to new config.
Removed references to old config parser (not sure if I got them all, though).
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1756 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/modules/hs_request.c')
-rw-r--r-- | src/modules/hs_request.c | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/src/modules/hs_request.c b/src/modules/hs_request.c index e9ad605a8..5eb7cc7f3 100644 --- a/src/modules/hs_request.c +++ b/src/modules/hs_request.c @@ -110,7 +110,7 @@ class HSRequest : public Module c = createCommand("list", hs_do_list_out, is_services_oper, -1, -1, -1, -1, -1); this->AddCommand(HOSTSERV, c, MOD_HEAD); - c = createCommand("drop", ns_do_drop, NULL, -1, -1, -1, -1, -1); + c = createCommand("drop", ns_do_drop, NULL, -1, -1, -1, -1, -1); this->AddCommand(NICKSERV, c, MOD_HEAD); hook = createEventHook(EVENT_DB_SAVING, hsreqevt_db_saving); @@ -945,29 +945,15 @@ int hsreqevt_db_backup(int argc, char **argv) void my_load_config(void) { - int i; - char *tmp = NULL; - - Directive confvalues[][1] = { - {{"HSRequestMemoUser", - {{PARAM_SET, PARAM_RELOAD, &HSRequestMemoUser}}}}, - {{"HSRequestMemoOper", - {{PARAM_SET, PARAM_RELOAD, &HSRequestMemoOper}}}}, - {{"HSRequestMemoSetters", - {{PARAM_SET, PARAM_RELOAD, &HSRequestMemoSetters}}}}, - {{"HSRequestDBName", {{PARAM_STRING, PARAM_RELOAD, &tmp}}}} - }; - - for (i = 0; i < 4; i++) - moduleGetConfigDirective(confvalues[i]); - - if (tmp) { - if (HSRequestDBName) - free(HSRequestDBName); - HSRequestDBName = sstrdup(tmp); - } else { - HSRequestDBName = sstrdup(HSREQ_DEFAULT_DBNAME); - } + ConfigReader config; + HSRequestMemoUser = config.ReadFlag("hs_request", "memouser", "no", 0); + HSRequestMemoOper = config.ReadFlag("hs_request", "memooper", "no", 0); + HSRequestMemoSetters = config.ReadFlag("hs_request", "memosetters", "no", 0); + std::string tmp = config.ReadValue("hs_request", "database", HSREQ_DEFAULT_DBNAME, 0); + + if (HSRequestDBName) + free(HSRequestDBName); + HSRequestDBName = sstrdup(tmp.c_str()); if (debug) alog("debug: [hs_request] Set config vars: MemoUser=%d MemoOper=%d MemoSetters=%d DBName='%s'", HSRequestMemoUser, HSRequestMemoOper, HSRequestMemoSetters, HSRequestDBName); |