mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
Minor cleanup of the conn_umodes module.
This commit is contained in:
parent
965460400b
commit
df2a3d6fc4
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user