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:
+20
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user