From 193f50ab6c9115399bbfd85d6c50683f0af38660 Mon Sep 17 00:00:00 2001 From: "Naram Qashat cyberbotx@cyberbotx.com" Date: Tue, 14 Oct 2008 03:35:54 +0000 Subject: Added maxmemos directive to memoserv block in new config. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1445 5417fbe8-f217-4b02-8779-1006273d7864 --- data/example_new.conf | 8 ++++++++ src/config.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/data/example_new.conf b/data/example_new.conf index fb5b5d697..c198dc0a2 100644 --- a/data/example_new.conf +++ b/data/example_new.conf @@ -452,4 +452,12 @@ memoserv * name) of the client. */ description = "Memo Service" + + /* + * The maximum number of memos a user is allowed to keep by default. Normal users may set the + * limit anywhere between 0 and this value. Services Admins can change it to any value or + * disable it. This directive is optional, but recommended. If not set, the limit is disabled + * by default, and normal users can set any limit they want. + */ + maxmemos = 20 } diff --git a/src/config.c b/src/config.c index 0d32cc09e..27f28baf5 100644 --- a/src/config.c +++ b/src/config.c @@ -496,7 +496,7 @@ int ServerConfig::Read(bool bail) { errstr.clear(); // These tags MUST occur and must ONLY occur once in the config file - static const char *Once[] = {"nickserv", "chanserv", NULL}; + static const char *Once[] = {"nickserv", "chanserv", "memoserv", NULL}; // These tags can occur ONCE or not at all InitialConfig Values[] = { /* The following comments are from CyberBotX to w00t as examples to use: @@ -596,6 +596,7 @@ int ServerConfig::Read(bool bail) {"chanserv", "opersonly", "no", new ValueContainerBool(&CSOpersOnly), DT_BOOLEAN, NoValidation}, {"memoserv", "nick", "MemoServ", new ValueContainerChar(&s_MemoServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, {"memoserv", "description", "Memo Service", new ValueContainerChar(&desc_MemoServ), DT_CHARPTR | DT_NORELOAD, ValidateNotEmpty}, + {"memoserv", "maxmemos", "0", new ValueContainerInt(&MSMaxMemos), DT_INTEGER, NoValidation}, {NULL, NULL, NULL, NULL, DT_NOTHING, NoValidation} }; /* These tags can occur multiple times, and therefore they have special code to read them @@ -1260,7 +1261,6 @@ Directive directives[] = { {"ModuleDelayedAutoload", {{PARAM_STRING, PARAM_RELOAD, &ModulesDelayed}}}, {"MOTDFile", {{PARAM_STRING, PARAM_RELOAD, &MOTDFilename}}}, - {"MSMaxMemos", {{PARAM_POSINT, PARAM_RELOAD, &MSMaxMemos}}}, {"MSNotifyAll", {{PARAM_SET, PARAM_RELOAD, &MSNotifyAll}}}, {"MSSendDelay", {{PARAM_TIME, PARAM_RELOAD, &MSSendDelay}}}, {"MSMemoReceipt", {{PARAM_POSINT, PARAM_RELOAD, &MSMemoReceipt}}}, -- cgit