diff options
author | Peter Powell <petpow@saberuk.com> | 2018-11-24 17:37:14 +0000 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2018-11-24 17:41:53 +0000 |
commit | 56a95ff4aee7bc6e7f0569164cec7a4e786d4133 (patch) | |
tree | a41bcecf1c3c435f656979d66647e0a3289edcfa /src/modules | |
parent | 248fa43bf98d61bc84025b68ac373b7c42d728f6 (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')
-rw-r--r-- | src/modules/m_showfile.cpp | 5 |
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)) { |