From 56a95ff4aee7bc6e7f0569164cec7a4e786d4133 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sat, 24 Nov 2018 17:37:14 +0000 Subject: Improve the output of the showfile module. - Omit the starting numeric if a zero numeric is specified. - Omit the ending numeric if a zero numeric is specified or if the end message is empty. --- src/modules/m_showfile.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_showfile.cpp b/src/modules/m_showfile.cpp index 99c545140..3c1c77f0b 100644 --- a/src/modules/m_showfile.cpp +++ b/src/modules/m_showfile.cpp @@ -55,13 +55,14 @@ class CommandShowFile : public Command { if (method == SF_NUMERIC) { - if (!introtext.empty()) + if (!introtext.empty() || !intronumeric) user->WriteRemoteNumeric(intronumeric, introtext); for (file_cache::const_iterator i = contents.begin(); i != contents.end(); ++i) user->WriteRemoteNumeric(textnumeric, InspIRCd::Format("- %s", i->c_str())); - user->WriteRemoteNumeric(endnumeric, endtext.c_str()); + if (!endtext.empty() || !endnumeric) + user->WriteRemoteNumeric(endnumeric, endtext.c_str()); } else if (IS_LOCAL(user)) { -- cgit v1.3.1-10-gc9f91