mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
Clean up the logic for parsing oper mode privileges.
This commit is contained in:
parent
c5680d6493
commit
41f781a9a6
@ -428,30 +428,24 @@ void OperInfo::init()
|
||||
AllowedOperCommands.AddList(tag->getString("commands"));
|
||||
AllowedPrivs.AddList(tag->getString("privs"));
|
||||
|
||||
std::string modes = tag->getString("usermodes");
|
||||
for (std::string::const_iterator c = modes.begin(); c != modes.end(); ++c)
|
||||
const std::string umodes = tag->getString("usermodes");
|
||||
for (std::string::const_iterator c = umodes.begin(); c != umodes.end(); ++c)
|
||||
{
|
||||
if (*c == '*')
|
||||
{
|
||||
const char& chr = *c;
|
||||
if (chr == '*')
|
||||
this->AllowedUserModes.set();
|
||||
}
|
||||
else if (*c >= 'A' && *c <= 'z')
|
||||
{
|
||||
this->AllowedUserModes[*c - 'A'] = true;
|
||||
}
|
||||
else if (ModeParser::IsModeChar(chr))
|
||||
this->AllowedUserModes[chr - 'A'] = true;
|
||||
}
|
||||
|
||||
modes = tag->getString("chanmodes");
|
||||
for (std::string::const_iterator c = modes.begin(); c != modes.end(); ++c)
|
||||
const std::string cmodes = tag->getString("chanmodes");
|
||||
for (std::string::const_iterator c = cmodes.begin(); c != cmodes.end(); ++c)
|
||||
{
|
||||
if (*c == '*')
|
||||
{
|
||||
const char& chr = *c;
|
||||
if (chr == '*')
|
||||
this->AllowedChanModes.set();
|
||||
}
|
||||
else if (*c >= 'A' && *c <= 'z')
|
||||
{
|
||||
this->AllowedChanModes[*c - 'A'] = true;
|
||||
}
|
||||
else if (ModeParser::IsModeChar(chr))
|
||||
this->AllowedChanModes[chr - 'A'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user