1
0
mirror of https://github.com/anope/anope.git synced 2026-06-26 14:16:39 +02:00

added ns_cert

This commit is contained in:
DukePyrolator
2011-03-12 09:27:16 +01:00
parent 95469fde30
commit fbae3344ff
25 changed files with 452 additions and 99 deletions
+39
View File
@@ -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();
}