diff options
| author | 2022-12-09 11:31:11 +0000 | |
|---|---|---|
| committer | 2022-12-09 11:31:11 +0000 | |
| commit | 3e941f1cfbae54c83dd7558a3fea89cf80940605 (patch) | |
| tree | 03b2c1f22e63d3732a3b724c14e687929fd761f4 /src/modules/m_showfile.cpp | |
| parent | More const correctness work. (diff) | |
| parent | Fix reading the MOTD when <connect:motd> is a literal path. (diff) | |
| download | inspircd++-3e941f1cfbae54c83dd7558a3fea89cf80940605.tar.gz inspircd++-3e941f1cfbae54c83dd7558a3fea89cf80940605.tar.bz2 inspircd++-3e941f1cfbae54c83dd7558a3fea89cf80940605.zip | |
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules/m_showfile.cpp')
| -rw-r--r-- | src/modules/m_showfile.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/modules/m_showfile.cpp b/src/modules/m_showfile.cpp index d50a327d5..3eaae462f 100644 --- a/src/modules/m_showfile.cpp +++ b/src/modules/m_showfile.cpp @@ -62,7 +62,7 @@ public: user->WriteRemoteNumeric(intronumeric, introtext); for (const auto& line : contents) - user->WriteRemoteNumeric(textnumeric, InspIRCd::Format(" %s", line.c_str())); + user->WriteRemoteNumeric(textnumeric, line); if (!endtext.empty() && endnumeric) user->WriteRemoteNumeric(endnumeric, endtext.c_str()); @@ -94,7 +94,16 @@ public: else if (smethod == "notice") method = SF_NOTICE; - contents = filecontents; + // Process the entry. + contents.clear(); + contents.reserve(filecontents.size()); + for (const auto& line : filecontents) + { + // Some clients can not handle receiving NOTICE/PRIVMSG/RPL_RULES + // with an empty trailing parameter so if a line is empty we + // replace it with a single space. + contents.push_back(line.empty() ? " " : line); + } InspIRCd::ProcessColors(contents); } }; |
