Minor cleanup of the conn_umodes module.

This commit is contained in:
Peter Powell 2019-11-29 13:43:49 +00:00
parent 965460400b
commit df2a3d6fc4

View File

@ -32,22 +32,18 @@ class ModuleModesOnConnect : public Module
void OnUserConnect(LocalUser* user) CXX11_OVERRIDE
{
ConfigTag* tag = user->MyClass->config;
std::string ThisModes = tag->getString("modes");
if (!ThisModes.empty())
{
std::string buf;
irc::spacesepstream ss(ThisModes);
const std::string modestr = user->MyClass->config->getString("modes");
if (modestr.empty())
return;
CommandBase::Params modes;
modes.push_back(user->nick);
CommandBase::Params params;
params.push_back(user->nick);
// split ThisUserModes into modes and mode params
while (ss.GetToken(buf))
modes.push_back(buf);
irc::spacesepstream modestream(modestr);
for (std::string modetoken; modestream.GetToken(modetoken); )
params.push_back(modetoken);
ServerInstance->Parser.CallHandler("MODE", modes, user);
}
ServerInstance->Parser.CallHandler("MODE", params, user);
}
};