summaryrefslogtreecommitdiff
path: root/src/nickcore.cpp
diff options
context:
space:
mode:
authorDukePyrolator <DukePyrolator@anope.org>2011-03-12 09:27:16 +0100
committerDukePyrolator <DukePyrolator@anope.org>2011-03-12 09:27:16 +0100
commitfbae3344ff70f9e035292fdc9a6e09efc2702aed (patch)
tree440df041a811317db159365a6322bae9cd596643 /src/nickcore.cpp
parent95469fde3055e1a257fd4e1027617892b912d07c (diff)
added ns_cert
Diffstat (limited to 'src/nickcore.cpp')
-rw-r--r--src/nickcore.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/nickcore.cpp b/src/nickcore.cpp
index 4863d3244..e83d46c47 100644
--- a/src/nickcore.cpp
+++ b/src/nickcore.cpp
@@ -129,3 +129,42 @@ void NickCore::ClearAccess()
FOREACH_MOD(I_OnNickClearAccess, OnNickClearAccess(this));
this->access.clear();
}
+
+void NickCore::AddCert(const Anope::string &entry)
+{
+ this->cert.push_back(entry);
+ FOREACH_MOD(I_OnNickAddCert, OnNickAddCert(this, entry));
+}
+
+Anope::string NickCore::GetCert(unsigned entry) const
+{
+ if (this->cert.empty() || entry >= this->cert.size())
+ return "";
+ return this->cert[entry];
+}
+
+bool NickCore::FindCert(const Anope::string &entry)
+{
+ for (unsigned i = 0, end = this->cert.size(); i < end; ++i)
+ if (this->cert[i] == entry)
+ return true;
+
+ return false;
+}
+
+void NickCore::EraseCert(const Anope::string &entry)
+{
+ for (unsigned i = 0, end = this->cert.size(); i < end; ++i)
+ if (this->cert[i] == entry)
+ {
+ FOREACH_MOD(I_OnNickEraseCert, OnNickEraseCert(this, entry));
+ this->cert.erase(this->cert.begin() + i);
+ break;
+ }
+}
+
+void NickCore::ClearCert()
+{
+ FOREACH_MOD(I_OnNickClearCert, OnNickClearCert(this));
+ this->cert.clear();
+}