diff options
author | Adam <Adam@anope.org> | 2013-07-01 22:17:52 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-07-01 22:17:52 -0400 |
commit | 1a3d9a016d3adc49788bbff73aac9b3b5ea85b17 (patch) | |
tree | c0ecf92ed768473bc82ff64a7fce827245f37ba9 /src/misc.cpp | |
parent | 518182ac9204f815258b0de91b3f884d8efa1502 (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/misc.cpp')
-rw-r--r-- | src/misc.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/misc.cpp b/src/misc.cpp index fd08ffb2a..c9e18dc66 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -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; |