summaryrefslogtreecommitdiff
path: root/src/modules/m_showfile.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2018-11-24 17:37:14 +0000
committerPeter Powell <petpow@saberuk.com>2018-11-24 17:41:53 +0000
commit56a95ff4aee7bc6e7f0569164cec7a4e786d4133 (patch)
treea41bcecf1c3c435f656979d66647e0a3289edcfa /src/modules/m_showfile.cpp
parent248fa43bf98d61bc84025b68ac373b7c42d728f6 (diff)
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.
Diffstat (limited to 'src/modules/m_showfile.cpp')
-rw-r--r--src/modules/m_showfile.cpp5
1 files changed, 3 insertions, 2 deletions
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))
{