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_opermotd.cpp | |
| parent | More const correctness work. (diff) | |
| parent | Fix reading the MOTD when <connect:motd> is a literal path. (diff) | |
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules/m_opermotd.cpp')
| -rw-r--r-- | src/modules/m_opermotd.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/modules/m_opermotd.cpp b/src/modules/m_opermotd.cpp index 9d94d3e63..6066800fa 100644 --- a/src/modules/m_opermotd.cpp +++ b/src/modules/m_opermotd.cpp @@ -75,7 +75,7 @@ public: user->WriteRemoteNumeric(RPL_OMOTDSTART, "Server operators message of the day"); for (const auto& line : opermotd) - user->WriteRemoteNumeric(RPL_OMOTD, InspIRCd::Format(" %s", line.c_str())); + user->WriteRemoteNumeric(RPL_OMOTD, line); user->WriteRemoteNumeric(RPL_ENDOFOMOTD, "End of OPERMOTD"); } }; @@ -109,7 +109,16 @@ public: try { FileReader reader(conf->getString("file", "opermotd", 1)); - cmd.opermotd = reader.GetVector(); + + // Process the MOTD entry. + cmd.opermotd.reserve(reader.GetVector().size()); + for (const auto& line : reader.GetVector()) + { + // Some clients can not handle receiving RPL_OMOTD with an empty + // trailing parameter so if a line is empty we replace it with + // a single space. + cmd.opermotd.push_back(line.empty() ? " " : line); + } InspIRCd::ProcessColors(cmd.opermotd); } catch (const CoreException&) |
