summaryrefslogtreecommitdiff
path: root/modules/memoserv/read.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-10-02 12:38:09 -0400
committerAdam <Adam@anope.org>2016-10-02 12:38:09 -0400
commit65a4b358f7eb188c6c910f40a39dfb390828bb1e (patch)
tree5641e1371265b060ee8621fb5d1a6f333ddea99b /modules/memoserv/read.cpp
parent1c442ed3ecde48259d5a7103f06bf912922706aa (diff)
Allow /ms read to get a comma separated list of memo numbers as help describes. Show message if no memos could be displayed.
Diffstat (limited to 'modules/memoserv/read.cpp')
-rw-r--r--modules/memoserv/read.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/memoserv/read.cpp b/modules/memoserv/read.cpp
index 846e90fea..62d6cd4d2 100644
--- a/modules/memoserv/read.cpp
+++ b/modules/memoserv/read.cpp
@@ -121,7 +121,7 @@ class CommandMSRead : public Command
else
mi = source.nc->GetMemos();
- if (numstr.empty() || (!numstr.equals_ci("LAST") && !numstr.equals_ci("NEW") && !numstr.is_number_only()))
+ if (numstr.empty() || (!numstr.equals_ci("LAST") && !numstr.equals_ci("NEW") && numstr.find_first_not_of("0123456789.,-") != Anope::string::npos))
{
this->OnSyntaxError(source, numstr);
return;
@@ -167,15 +167,21 @@ class CommandMSRead : public Command
}
else /* number[s] */
{
+ bool shown = false;
+
NumberList(numstr, false,
[&](unsigned int number)
{
if (!number || number > memos.size())
return;
+ shown = true;
DoRead(source, mi, ci, number - 1);
},
[]{});
+
+ if (!shown)
+ source.Reply(_("No memos to display."));
}
}