Merge branch 'insp3' into master.

This commit is contained in:
Sadie Powell 2022-12-09 11:31:11 +00:00
commit 3e941f1cfb
6 changed files with 57 additions and 24 deletions

View File

@ -1,4 +1,4 @@
Since the first commit in January 2003 106 people have submitted patches,
Since the first commit in January 2003 107 people have submitted patches,
commits, and other useful contributions to InspIRCd. These people, ordered by
the number of contributions they have made, are:
@ -50,18 +50,18 @@ the number of contributions they have made, are:
* Ben Harris <ben@tilde.team>
* Chin Lee <kwangchin@gmail.com>
* Christopher 'm4z' Holm <them4z@gmail.com>
* eggy
* Guillaume Delacour <gui@iroqwa.org>
* JD Horelick <jdhore1@gmail.com>
* James Lu <GLolol@overdrivenetworks.com>
* JD Horelick <jdhore1@gmail.com>
* Jens Voss <DukePyrolator@anope.org>
* Johanna A
* Kyle Fuller <inbox@kylefuller.co.uk>
* md_5 <git@md-5.net>
* Michael <michaelhazell@hotmail.com>
* Michael Hazell <michaelhazell@hotmail.com>
* Molly Miller
* PhilSliderS
* eggy
* md_5 <git@md-5.net>
* satmd <satmd@satmd.de>
* 0x277F <0x277F@gmail.com>
* A_D
@ -76,9 +76,12 @@ the number of contributions they have made, are:
* Christos Triantafyllidis
* David Lamont <del6597@rit.edu>
* David Schultz <me@zpld.me>
* delthas
* Dominic Hamon
* edef <edef@edef.eu>
* ElementalAlchemist <ElementAlchemist7@gmail.com>
* Elizabeth Myers <elizabeth@interlinked.me>
* emerson <github@emersonveenstra.net>
* Filippo Cortigiani <simos@simosnap.org>
* Florian Praden <florian@praden.eu>
* Garrett Holmstrom <gholms@fedoraproject.org>
@ -89,11 +92,15 @@ the number of contributions they have made, are:
* Julien Vehent <julien@linuxwall.info>
* JustArchi <JustArchi@JustArchi.net>
* Matthew Martin <phy1729@gmail.com>
* newuser1 <flirtex@gmail.com>
* nia <nia@netbsd.org>
* Nicole Kleinhoff <ilbelkyr@shalture.org>
* Pierre Carrier <pierre@spotify.com>
* Puck Meerburg <puck@puckipedia.com>
* R-V6
* randomdan
* Richard Bradfield <bradfirj@fstab.me>
* systocrat <systocrat@outlook.com>
* ThatOneRoadie <thatoneroadie+github@gmail.com>
* The Aviator <aviator45003@gmail.com>
* Thiago Crepaldi <thiago@thiagocrepaldi.com>
@ -101,9 +108,3 @@ the number of contributions they have made, are:
* Tim Heckman <t@heckman.io>
* Vitor Luis <droider.pc@gmail.com>
* WindowsUser
* edef <edef@edef.eu>
* emerson <github@emersonveenstra.net>
* newuser1 <flirtex@gmail.com>
* nia <nia@netbsd.org>
* randomdan
* systocrat <systocrat@outlook.com>

View File

@ -65,10 +65,8 @@ CmdResult CommandMotd::Handle(User* user, const Params& parameters)
}
user->WriteRemoteNumeric(RPL_MOTDSTART, InspIRCd::Format("%s message of the day", ServerInstance->Config->GetServerName().c_str()));
for (const auto& line : motd->second)
user->WriteRemoteNumeric(RPL_MOTD, InspIRCd::Format(" %s", line.c_str()));
user->WriteRemoteNumeric(RPL_MOTD, line);
user->WriteRemoteNumeric(RPL_ENDOFMOTD, "End of message of the day.");
return CmdResult::SUCCESS;

View File

@ -134,14 +134,30 @@ public:
if (newmotds.find(motd) != newmotds.end())
continue;
// We can't process the file if it doesn't exist.
ConfigFileCache::iterator file = ServerInstance->Config->Files.find(motd);
if (file == ServerInstance->Config->Files.end())
FileReader reader;
try
{
reader.Load(motd);
}
catch (const CoreException& ce)
{
// We can't process the file if it doesn't exist.
ServerInstance->Logs.Normal(MODNAME, "Unable to read motd for connect class \"%s\" at %s: %s",
klass->name.c_str(), klass->config->source.str().c_str(), ce.GetReason().c_str());
continue;
}
// Process escape codes.
newmotds[file->first] = file->second;
InspIRCd::ProcessColors(newmotds[file->first]);
// Process the MOTD entry.
file_cache& newmotd = newmotds[motd];
newmotd.reserve(reader.GetVector().size());
for (const auto& line : reader.GetVector())
{
// Some clients can not handle receiving RPL_MOTD with an empty
// trailing parameter so if a line is empty we replace it with
// a single space.
newmotd.push_back(line.empty() ? " " : line);
}
InspIRCd::ProcessColors(newmotd);
}
cmdmotd.motds.swap(newmotds);

View File

@ -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&)

View File

@ -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);
}
};

View File

@ -48,7 +48,7 @@ commits, and other useful contributions to InspIRCd. These people, ordered by
the number of contributions they have made, are:
EOH
for my $author (sort { $authors{$b} <=> $authors{$a} or $a cmp $b } keys %authors) {
for my $author (sort { $authors{$b} <=> $authors{$a} or lc($a) cmp lc($b) } keys %authors) {
next if $author eq 'InspIRCd Robot <noreply@inspircd.org>';
say $fh " * $author";
}