summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bots.cpp7
-rw-r--r--src/command.cpp21
2 files changed, 2 insertions, 26 deletions
diff --git a/src/bots.cpp b/src/bots.cpp
index 379836ec2..f3c0af4fd 100644
--- a/src/bots.cpp
+++ b/src/bots.cpp
@@ -253,16 +253,12 @@ void BotInfo::OnMessage(User *u, const Anope::string &message)
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnPreCommand, OnPreCommand(source, c, params));
if (MOD_RESULT == EVENT_STOP)
- {
- source.DoReply();
return;
- }
if (params.size() < c->MinParams)
{
c->OnSyntaxError(source, !params.empty() ? params[params.size() - 1] : "");
- source.DoReply();
return;
}
@@ -271,7 +267,6 @@ void BotInfo::OnMessage(User *u, const Anope::string &message)
{
u->SendMessage(this, ACCESS_DENIED);
Log(LOG_COMMAND, "denied", this) << "Access denied for user " << u->GetMask() << " with command " << c->name;
- source.DoReply();
return;
}
@@ -280,8 +275,6 @@ void BotInfo::OnMessage(User *u, const Anope::string &message)
if (user_reference)
{
FOREACH_MOD(I_OnPostCommand, OnPostCommand(source, c, params));
- if (user_reference)
- source.DoReply();
}
}
diff --git a/src/command.cpp b/src/command.cpp
index e9da36ac2..9d9e0d4f6 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -32,26 +32,9 @@ void CommandSource::Reply(const Anope::string &message)
sepstream sep(translated_message, '\n');
Anope::string tok;
while (sep.GetToken(tok))
- this->reply.push_back(tok);
-}
-
-void CommandSource::DoReply()
-{
- 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->c || !this->c->ci || this->reply.size() > 1)
- u->SendMessage(this->service, message);
- else if (this->c->ci->botflags.HasFlag(BS_MSG_PRIVMSG))
- ircdproto->SendPrivmsg(this->service, this->c->name, message.c_str());
- else if (this->c->ci->botflags.HasFlag(BS_MSG_NOTICE))
- ircdproto->SendNotice(this->service, this->c->name, message.c_str());
- else if (this->c->ci->botflags.HasFlag(BS_MSG_NOTICEOPS))
- ircdproto->SendNoticeChanops(this->service, this->c, message.c_str());
- else
- u->SendMessage(this->service, message);
+ const char *translated_message = translate(this->u, tok.c_str());
+ u->SendMessage(this->service, translated_message);
}
}