1
0
mirror of https://github.com/anope/anope.git synced 2026-06-26 00:46:37 +02:00

Added /bs set msg

This commit is contained in:
Adam
2010-11-26 10:15:48 -06:00
parent cb6ef574e3
commit 2b10cc84ea
10 changed files with 108 additions and 13 deletions
+22 -10
View File
@@ -8,6 +8,26 @@
#include "services.h"
#include "modules.h"
CommandSource::~CommandSource()
{
for (std::list<Anope::string>::iterator it = this->reply.begin(), it_end = this->reply.end(); it != it_end; ++it)
{
const Anope::string &message = *it;
// Send to the user if the reply is more than one line
if (!this->fantasy || !this->ci || this->reply.size() > 1)
u->SendMessage(this->service->nick, message);
else if (this->ci->botflags.HasFlag(BS_MSG_PRIVMSG))
ircdproto->SendPrivmsg(this->service, this->ci->name, message.c_str());
else if (this->ci->botflags.HasFlag(BS_MSG_NOTICE))
ircdproto->SendNotice(this->service, this->ci->name, message.c_str());
else if (this->ci->botflags.HasFlag(BS_MSG_NOTICEOPS))
ircdproto->SendNoticeChanops(this->service, this->ci->c, message.c_str());
else
u->SendMessage(this->service->nick, message);
}
}
void CommandSource::Reply(LanguageString message, ...)
{
Anope::string m = GetString(this->u, message);
@@ -27,7 +47,7 @@ void CommandSource::Reply(LanguageString message, ...)
Anope::string line;
while (sep.GetToken(line))
this->Reply(line.empty() ? " " : line);
this->Reply(line.empty() ? " " : line.c_str());
}
void CommandSource::Reply(const char *message, ...)
@@ -40,20 +60,12 @@ void CommandSource::Reply(const char *message, ...)
va_start(args, message);
vsnprintf(buf, BUFSIZE - 1, message, args);
this->Reply(Anope::string(buf));
this->reply.push_back(message);
va_end(args);
}
}
void CommandSource::Reply(const Anope::string &message)
{
if (this->fantasy && this->ci)
ircdproto->SendPrivmsg(this->service, this->ci->name, message.c_str());
else
u->SendMessage(this->service->nick, message);
}
Command::Command(const Anope::string &sname, size_t min_params, size_t max_params, const Anope::string &spermission) : MaxParams(max_params), MinParams(min_params), name(sname), permission(spermission)
{
this->module = NULL;