summaryrefslogtreecommitdiff
path: root/src/nickcore.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-07-01 22:17:52 -0400
committerAdam <Adam@anope.org>2013-07-01 22:17:52 -0400
commit1a3d9a016d3adc49788bbff73aac9b3b5ea85b17 (patch)
treec0ecf92ed768473bc82ff64a7fce827245f37ba9 /src/nickcore.cpp
parent518182ac9204f815258b0de91b3f884d8efa1502 (diff)
Change extensible keys to require explicitly having a type defined for it. Completely modularize more features like bs_kick, entrymsg, log, mode, etc. Move fantasy to its own module. Move greet to its own module.
Diffstat (limited to 'src/nickcore.cpp')
-rw-r--r--src/nickcore.cpp72
1 files changed, 11 insertions, 61 deletions
diff --git a/src/nickcore.cpp b/src/nickcore.cpp
index 5779767dd..9bbaae959 100644
--- a/src/nickcore.cpp
+++ b/src/nickcore.cpp
@@ -67,13 +67,10 @@ void NickCore::Serialize(Serialize::Data &data) const
data["display"] << this->display;
data["pass"] << this->pass;
data["email"] << this->email;
- data["greet"] << this->greet;
data["language"] << this->language;
- this->ExtensibleSerialize(data);
+ Extensible::ExtensibleSerialize(this, this, data);
for (unsigned i = 0; i < this->access.size(); ++i)
data["access"] << this->access[i] << " ";
- for (unsigned i = 0; i < this->cert.size(); ++i)
- data["cert"] << this->cert[i] << " ";
data["memomax"] << this->memos.memomax;
for (unsigned i = 0; i < this->memos.ignores.size(); ++i)
data["memoignores"] << this->memos.ignores[i] << " ";
@@ -94,9 +91,8 @@ Serializable* NickCore::Unserialize(Serializable *obj, Serialize::Data &data)
data["pass"] >> nc->pass;
data["email"] >> nc->email;
- data["greet"] >> nc->greet;
data["language"] >> nc->language;
- nc->ExtensibleUnserialize(data);
+ Extensible::ExtensibleUnserialize(nc, nc, data);
{
Anope::string buf;
data["access"] >> buf;
@@ -105,14 +101,6 @@ Serializable* NickCore::Unserialize(Serializable *obj, Serialize::Data &data)
while (sep.GetToken(buf))
nc->access.push_back(buf);
}
- {
- Anope::string buf;
- data["cert"] >> buf;
- spacesepstream sep(buf);
- nc->cert.clear();
- while (sep.GetToken(buf))
- nc->cert.push_back(buf);
- }
data["memomax"] >> nc->memos.memomax;
{
Anope::string buf;
@@ -123,14 +111,15 @@ Serializable* NickCore::Unserialize(Serializable *obj, Serialize::Data &data)
nc->memos.ignores.push_back(buf);
}
- /* Compat */
- Anope::string sflags;
- data["flags"] >> sflags;
- spacesepstream sep(sflags);
- Anope::string tok;
- while (sep.GetToken(tok))
- nc->ExtendMetadata(tok);
- /* End compat */
+ /* compat */
+ bool b;
+ data["extensible:SECURE"] >> b;
+ if (b)
+ nc->Extend<bool>("NS_SECURE");
+ data["extensible:PRIVATE"] >> b;
+ if (b)
+ nc->Extend<bool>("NS_PRIVATE");
+ /* end compat */
return nc;
}
@@ -216,45 +205,6 @@ bool NickCore::IsOnAccess(const User *u) const
return false;
}
-void NickCore::AddCert(const Anope::string &entry)
-{
- this->cert.push_back(entry);
- FOREACH_MOD(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) const
-{
- 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(OnNickEraseCert, (this, entry));
- this->cert.erase(this->cert.begin() + i);
- break;
- }
-}
-
-void NickCore::ClearCert()
-{
- FOREACH_MOD(OnNickClearCert, (this));
- this->cert.clear();
-}
-
void NickCore::AddChannelReference(ChannelInfo *ci)
{
++(*this->chanaccess)[ci];