summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mode.h8
-rw-r--r--src/mode.cpp4
-rw-r--r--src/users.cpp4
3 files changed, 9 insertions, 7 deletions
diff --git a/include/mode.h b/include/mode.h
index 6b481e779..ec293e497 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -586,7 +586,7 @@ class CoreExport ModeParser : public fakederef<ModeParser>
/** Cached mode list for use in 004 numeric
*/
- std::string Cached004ModeList;
+ TR1NS::array<std::string, 3> Cached004ModeList;
public:
typedef std::vector<ListModeBase*> ListModeList;
@@ -755,13 +755,13 @@ class CoreExport ModeParser : public fakederef<ModeParser>
*/
PrefixMode* FindPrefix(unsigned const char pfxletter);
- /** Returns a list of modes, space seperated by type:
+ /** Returns an array of modes:
* 1. User modes
* 2. Channel modes
* 3. Channel modes that require a parameter when set
* This is sent to users as the last part of the 004 numeric
*/
- const std::string& GetModeListFor004Numeric();
+ const TR1NS::array<std::string, 3>& GetModeListFor004Numeric();
/** Generates a list of modes, comma seperated by type:
* 1; Listmodes EXCEPT those with a prefix
@@ -800,7 +800,7 @@ class CoreExport ModeParser : public fakederef<ModeParser>
void ShowListModeList(User* user, Channel* chan, ModeHandler* mh);
};
-inline const std::string& ModeParser::GetModeListFor004Numeric()
+inline const TR1NS::array<std::string, 3>& ModeParser::GetModeListFor004Numeric()
{
return Cached004ModeList;
}
diff --git a/src/mode.cpp b/src/mode.cpp
index c4969d467..fd5e30707 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -720,7 +720,9 @@ std::string ModeParser::CreateModeList(ModeType mt, bool needparam)
void ModeParser::RecreateModeListFor004Numeric()
{
- Cached004ModeList = CreateModeList(MODETYPE_USER) + " " + CreateModeList(MODETYPE_CHANNEL) + " " + CreateModeList(MODETYPE_CHANNEL, true);
+ Cached004ModeList[0] = CreateModeList(MODETYPE_USER);
+ Cached004ModeList[1] = CreateModeList(MODETYPE_CHANNEL);
+ Cached004ModeList[2] = CreateModeList(MODETYPE_CHANNEL, true);
}
PrefixMode* ModeParser::FindPrefix(unsigned const char pfxletter)
diff --git a/src/users.cpp b/src/users.cpp
index 7d72692d9..4945cbb21 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -541,8 +541,8 @@ void LocalUser::FullConnect()
this->WriteNumeric(RPL_YOURHOSTIS, InspIRCd::Format("Your host is %s, running version %s", ServerInstance->Config->ServerName.c_str(), INSPIRCD_BRANCH));
this->WriteNumeric(RPL_SERVERCREATED, InspIRCd::TimeString(ServerInstance->startup_time, "This server was created %H:%M:%S %b %d %Y"));
- const std::string& modelist = ServerInstance->Modes->GetModeListFor004Numeric();
- this->WriteNumeric(RPL_SERVERVERSION, ServerInstance->Config->ServerName, INSPIRCD_BRANCH, modelist);
+ const TR1NS::array<std::string, 3>& modelist = ServerInstance->Modes->GetModeListFor004Numeric();
+ this->WriteNumeric(RPL_SERVERVERSION, ServerInstance->Config->ServerName, INSPIRCD_BRANCH, modelist[0], modelist[1], modelist[2]);
ServerInstance->ISupport.SendTo(this);