diff options
author | AlphaTech <alphat3ch@icloud.com> | 2015-09-08 03:47:29 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2016-09-25 17:27:30 -0400 |
commit | f3bb46a9f5bb6154f9d23dc62765758a9135f0e6 (patch) | |
tree | ac3d7e9c14f958cd0175a51ba74ea0c6eef9aaee /modules/commands/ms_read.cpp | |
parent | 4d054aa2b20caa4d268fa5575a8e5eb12beca9b3 (diff) |
MemoServ - Read All
Diffstat (limited to 'modules/commands/ms_read.cpp')
-rw-r--r-- | modules/commands/ms_read.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/modules/commands/ms_read.cpp b/modules/commands/ms_read.cpp index 96103d30b..939e1247a 100644 --- a/modules/commands/ms_read.cpp +++ b/modules/commands/ms_read.cpp @@ -110,7 +110,7 @@ class CommandMSRead : public Command CommandMSRead(Module *creator) : Command(creator, "memoserv/read", 1, 2) { this->SetDesc(_("Read a memo or memos")); - this->SetSyntax(_("[\037channel\037] {\037num\037 | \037list\037 | LAST | NEW}")); + this->SetSyntax(_("[\037channel\037] {\037num\037 | \037list\037 | LAST | NEW | ALL}")); } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override @@ -141,7 +141,7 @@ class CommandMSRead : public Command else mi = &source.nc->memos; - if (numstr.empty() || (!numstr.equals_ci("LAST") && !numstr.equals_ci("NEW") && numstr.find_first_not_of("0123456789.,-") != Anope::string::npos)) + if (numstr.empty() || (!numstr.equals_ci("LAST") && !numstr.equals_ci("NEW") && !numstr.equals_ci("ALL") && numstr.find_first_not_of("0123456789.,-") != Anope::string::npos)) this->OnSyntaxError(source, numstr); else if (mi->memos->empty()) { @@ -176,6 +176,13 @@ class CommandMSRead : public Command for (i = 0, end = mi->memos->size() - 1; i < end; ++i); MemoListCallback::DoRead(source, mi, ci, i); } + else if (numstr.equals_ci("ALL")) + { + for (i = 0, end = mi->memos->size(); i < end; ++i) + { + MemoListCallback::DoRead(source, mi, ci, i); + } + } else /* number[s] */ { MemoListCallback list(source, mi, ci, numstr); @@ -191,9 +198,10 @@ class CommandMSRead : public Command source.Reply(" "); source.Reply(_("Sends you the text of the memos specified. If LAST is\n" "given, sends you the memo you most recently received. If\n" - "NEW is given, sends you all of your new memos. Otherwise,\n" - "sends you memo number \037num\037. You can also give a list of\n" - "numbers, as in this example:\n" + "NEW is given, sends you all of your new memos. If ALL is\n" + "given, sends you all of your memos. Otherwise, sends you\n" + "memo number \037num\037. You can also give a list of numbers,\n" + "as in this example:\n" " \n" " \002READ 2-5,7-9\002\n" " Displays memos numbered 2 through 5 and 7 through 9.")); |