1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 03:06:37 +02:00

Made privilege names case insensitive

This commit is contained in:
Adam
2013-04-09 14:48:24 -05:00
parent b35665bb54
commit b76b2e11c8
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -163,7 +163,7 @@ class CoreExport ChannelInfo : public Serializable, public Extensible
Serialize::Checker<std::vector<ChanAccess *> > access; /* List of authorized users */
Serialize::Checker<std::vector<AutoKick *> > akick; /* List of users to kickban */
Serialize::Checker<std::vector<BadWord *> > badwords; /* List of badwords */
std::map<Anope::string, int16_t> levels;
Anope::map<int16_t> levels;
public:
friend class ChanAccess;
+2 -2
View File
@@ -63,13 +63,13 @@ Privilege::Privilege(const Anope::string &n, const Anope::string &d, int r) : na
{
if (this->desc.empty())
for (unsigned j = 0; j < sizeof(descriptions) / sizeof(*descriptions); ++j)
if (descriptions[j].name == name)
if (descriptions[j].name.equals_ci(name))
this->desc = descriptions[j].desc;
}
bool Privilege::operator==(const Privilege &other) const
{
return this->name == other.name;
return this->name.equals_ci(other.name);
}
std::vector<Privilege> PrivilegeManager::Privileges;
+2 -2
View File
@@ -418,7 +418,7 @@ void ChannelInfo::Serialize(Serialize::Data &data) const
this->ExtensibleSerialize(data);
{
Anope::string levels_buffer;
for (std::map<Anope::string, int16_t>::const_iterator it = this->levels.begin(), it_end = this->levels.end(); it != it_end; ++it)
for (Anope::map<int16_t>::const_iterator it = this->levels.begin(), it_end = this->levels.end(); it != it_end; ++it)
levels_buffer += it->first + " " + stringify(it->second) + " ";
data["levels"] << levels_buffer;
}
@@ -1099,7 +1099,7 @@ int16_t ChannelInfo::GetLevel(const Anope::string &priv) const
return ACCESS_INVALID;
}
std::map<Anope::string, int16_t>::const_iterator it = this->levels.find(priv);
Anope::map<int16_t>::const_iterator it = this->levels.find(priv);
if (it == this->levels.end())
return 0;
return it->second;