summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-04-09 14:48:24 -0500
committerAdam <Adam@anope.org>2013-04-09 14:48:24 -0500
commitb76b2e11c80bb100c48e4eec9a51c53cd079d181 (patch)
tree304c0df94ec540fc70198bf9b7e1eb3442ad775b
parentb35665bb5427f84a42648cc65d1eb8aa5af8d131 (diff)
Made privilege names case insensitive
-rw-r--r--include/regchannel.h2
-rw-r--r--src/access.cpp4
-rw-r--r--src/regchannel.cpp4
3 files changed, 5 insertions, 5 deletions
diff --git a/include/regchannel.h b/include/regchannel.h
index 395794594..91cc90ffa 100644
--- a/include/regchannel.h
+++ b/include/regchannel.h
@@ -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;
diff --git a/src/access.cpp b/src/access.cpp
index 6f9a8cd8f..8c43b3a3d 100644
--- a/src/access.cpp
+++ b/src/access.cpp
@@ -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;
diff --git a/src/regchannel.cpp b/src/regchannel.cpp
index 89dd14e06..48d039be3 100644
--- a/src/regchannel.cpp
+++ b/src/regchannel.cpp
@@ -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;