1
0
mirror of https://github.com/anope/anope.git synced 2026-06-28 15:56:38 +02:00

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.

This commit is contained in:
Adam
2013-07-01 22:17:52 -04:00
parent 518182ac92
commit 1a3d9a016d
90 changed files with 3997 additions and 3570 deletions
+20 -1
View File
@@ -220,7 +220,7 @@ void InfoFormatter::Process(std::vector<Anope::string> &buffer)
Anope::string s;
for (unsigned i = it->first.length(); i < this->longest; ++i)
s += " ";
s += Anope::string(Language::Translate(this->nc, it->first.c_str())) + ": " + it->second;
s += Anope::string(Language::Translate(this->nc, it->first.c_str())) + ": " + Language::Translate(this->nc, it->second.c_str());
buffer.push_back(s);
}
@@ -234,6 +234,25 @@ Anope::string& InfoFormatter::operator[](const Anope::string &key)
return this->replies.back().second;
}
void InfoFormatter::AddOption(const Anope::string &opt)
{
Anope::string *optstr = NULL;
for (std::vector<std::pair<Anope::string, Anope::string> >::iterator it = this->replies.begin(), it_end = this->replies.end(); it != it_end; ++it)
{
if (it->first == "Options")
{
optstr = &it->second;
break;
}
}
if (!optstr)
optstr = &(*this)["Options"];
if (!optstr->empty())
*optstr += ", ";
*optstr += Language::Translate(nc, opt.c_str());
}
bool Anope::IsFile(const Anope::string &filename)
{
struct stat fileinfo;