mirror of
https://github.com/anope/anope.git
synced 2026-06-28 11:06:37 +02:00
Add ms_ignore:max config option
This commit is contained in:
@@ -137,7 +137,17 @@ command { service = "MemoServ"; name = "DEL"; command = "memoserv/del"; }
|
||||
*
|
||||
* Used to ignore memos from specific users.
|
||||
*/
|
||||
module { name = "ms_ignore" }
|
||||
module
|
||||
{
|
||||
name = "ms_ignore"
|
||||
|
||||
/*
|
||||
* The maximum number of entries that may be on a memo ignore list.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
max = 32
|
||||
}
|
||||
command { service = "MemoServ"; name = "IGNORE"; command = "memoserv/ignore"; }
|
||||
|
||||
/*
|
||||
|
||||
@@ -50,6 +50,12 @@ class CommandMSIgnore : public Command
|
||||
source.Reply(ACCESS_DENIED);
|
||||
else if (command.equals_ci("ADD") && !param.empty())
|
||||
{
|
||||
if (mi->ignores.size() >= Config->GetModule(this->owner)->Get<unsigned>("max", "32"))
|
||||
{
|
||||
source.Reply(_("Sorry, the memo ignore list for \002%s\002 is full."), channel.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if (std::find(mi->ignores.begin(), mi->ignores.end(), param.ci_str()) == mi->ignores.end())
|
||||
{
|
||||
mi->ignores.push_back(param.ci_str());
|
||||
|
||||
Reference in New Issue
Block a user