diff options
author | Adam <Adam@anope.org> | 2011-02-04 15:30:31 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-02-04 15:30:31 -0500 |
commit | 08583dc107974252312fb7c87532c9deb68e7f63 (patch) | |
tree | 0c42ec7422752cabd8352b49be976b4dc100c56c /src/command.cpp | |
parent | c362a1e077d5ede9eadbe79483f2a755b5883e9a (diff) |
Moved the language strings which are only used once
out of the core and into the modules that use them.
Diffstat (limited to 'src/command.cpp')
-rw-r--r-- | src/command.cpp | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/src/command.cpp b/src/command.cpp index 17de467e9..398f4249c 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -28,28 +28,6 @@ CommandSource::~CommandSource() } } -void CommandSource::Reply(LanguageString message, ...) -{ - Anope::string m = GetString(this->u, message); - - m = m.replace_all_cs("%S", this->owner->nick); - - if (m.length() >= 4096) - Log() << "Warning, language string " << message << " is longer than 4096 bytes"; - - va_list args; - char buf[4096]; - va_start(args, message); - vsnprintf(buf, sizeof(buf) - 1, m.c_str(), args); - va_end(args); - - sepstream sep(buf, '\n'); - Anope::string line; - - while (sep.GetToken(line)) - this->Reply(line.empty() ? " " : line.c_str()); -} - void CommandSource::Reply(const char *message, ...) { va_list args; @@ -60,12 +38,20 @@ void CommandSource::Reply(const char *message, ...) va_start(args, message); vsnprintf(buf, BUFSIZE - 1, message, args); - this->reply.push_back(buf); + this->Reply(Anope::string(buf)); va_end(args); } } +void CommandSource::Reply(const Anope::string &message) +{ + sepstream sep(message, '\n'); + Anope::string tok; + while (sep.GetToken(tok)) + this->reply.push_back(tok); +} + Command::Command(const Anope::string &sname, size_t min_params, size_t max_params, const Anope::string &spermission) : Flags<CommandFlag>(CommandFlagStrings), MaxParams(max_params), MinParams(min_params), name(sname), permission(spermission) { this->module = NULL; |