From 65a4b358f7eb188c6c910f40a39dfb390828bb1e Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 2 Oct 2016 12:38:09 -0400 Subject: Allow /ms read to get a comma separated list of memo numbers as help describes. Show message if no memos could be displayed. --- modules/memoserv/read.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'modules') 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.")); } } -- cgit