summaryrefslogtreecommitdiff
path: root/src/regchannel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/regchannel.cpp')
-rw-r--r--src/regchannel.cpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/regchannel.cpp b/src/regchannel.cpp
index 882649d54..7eceb5942 100644
--- a/src/regchannel.cpp
+++ b/src/regchannel.cpp
@@ -49,9 +49,6 @@ ChannelInfo::ChannelInfo(const Anope::string &chname) : Flags<ChannelInfoFlag, C
this->memos.memomax = Config->MSMaxMemos;
this->last_used = this->time_registered = Anope::CurTime;
- for (int i = 0; i < CA_SIZE; ++i)
- this->levels[i] = 0;
-
for (int i = 0; i < TTB_SIZE; ++i)
this->ttb[i] = 0;
@@ -781,3 +778,28 @@ void ChannelInfo::RestoreTopic()
}
}
+int16 ChannelInfo::GetLevel(const Anope::string &priv)
+{
+ if (PrivilegeManager::FindPrivilege(priv) == NULL)
+ throw CoreException("Unknown privilege " + priv);
+
+ if (this->levels.count(priv) == 0)
+ this->levels[priv] = 0;
+ return this->levels[priv];
+}
+
+void ChannelInfo::SetLevel(const Anope::string &priv, int16 level)
+{
+ this->levels[priv] = level;
+}
+
+void ChannelInfo::RemoveLevel(const Anope::string &priv)
+{
+ this->levels.erase(priv);
+}
+
+void ChannelInfo::ClearLevels()
+{
+ this->levels.clear();
+}
+