summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/commands.h4
-rw-r--r--include/services.h6
-rw-r--r--modules/commands/bs_info.cpp7
-rw-r--r--modules/commands/bs_set.cpp45
-rw-r--r--modules/extra/m_ldap_authentication.cpp2
-rw-r--r--src/bots.cpp7
-rw-r--r--src/command.cpp21
7 files changed, 2 insertions, 90 deletions
diff --git a/include/commands.h b/include/commands.h
index 02a89f416..271e9c551 100644
--- a/include/commands.h
+++ b/include/commands.h
@@ -52,12 +52,8 @@ struct CoreExport CommandSource
/* The permission of the command being executed */
Anope::string permission;
- std::list<Anope::string> reply;
-
void Reply(const char *message, ...);
void Reply(const Anope::string &message);
-
- void DoReply();
};
/** Every services command is a class, inheriting from Command.
diff --git a/include/services.h b/include/services.h
index 5b5cf46bb..84776d064 100644
--- a/include/services.h
+++ b/include/services.h
@@ -670,12 +670,6 @@ enum BotServFlag
BS_KICK_ITALICS,
/* BotServ kicks for amsgs */
BS_KICK_AMSGS,
- /* Send fantasy replies back to the channel via PRIVMSG */
- BS_MSG_PRIVMSG,
- /* Send fantasy replies back to the channel via NOTICE */
- BS_MSG_NOTICE,
- /* Send fantasy replies back to the channel via NOTICE to ops */
- BS_MSG_NOTICEOPS,
BS_END
};
diff --git a/modules/commands/bs_info.cpp b/modules/commands/bs_info.cpp
index 0dbec9e29..7ac7d67e3 100644
--- a/modules/commands/bs_info.cpp
+++ b/modules/commands/bs_info.cpp
@@ -173,13 +173,6 @@ class CommandBSInfo : public Command
else
source.Reply(_(" AMSG kicker : %s"), DISABLED);
- if (ci->botflags.HasFlag(BS_MSG_PRIVMSG))
- source.Reply(_(" Fantasy reply : %s"), "PRIVMSG");
- else if (ci->botflags.HasFlag(BS_MSG_NOTICE))
- source.Reply(_(" Fantasy reply : %s"), "NOTICE");
- else if (ci->botflags.HasFlag(BS_MSG_NOTICEOPS))
- source.Reply(_(" Fantasy reply : %s"), "NOTICEOPS");
-
end = buf;
*end = 0;
if (ci->botflags.HasFlag(BS_DONTKICKOPS))
diff --git a/modules/commands/bs_set.cpp b/modules/commands/bs_set.cpp
index b38c05d60..d114faef4 100644
--- a/modules/commands/bs_set.cpp
+++ b/modules/commands/bs_set.cpp
@@ -143,39 +143,6 @@ class CommandBSSet : public Command
else
this->OnSyntaxError(source, "NOBOT");
}
- else if (option.equals_ci("MSG"))
- {
- if (value.equals_ci("OFF"))
- {
- ci->botflags.UnsetFlag(BS_MSG_PRIVMSG);
- ci->botflags.UnsetFlag(BS_MSG_NOTICE);
- ci->botflags.UnsetFlag(BS_MSG_NOTICEOPS);
- source.Reply(_("Fantasy replies will no longer be sent to %s."), ci->name.c_str());
- }
- else if (value.equals_ci("PRIVMSG"))
- {
- ci->botflags.SetFlag(BS_MSG_PRIVMSG);
- ci->botflags.UnsetFlag(BS_MSG_NOTICE);
- ci->botflags.UnsetFlag(BS_MSG_NOTICEOPS);
- source.Reply(_("Fantasy replies will be sent via PRIVMSG to %s."), ci->name.c_str());
- }
- else if (value.equals_ci("NOTICE"))
- {
- ci->botflags.UnsetFlag(BS_MSG_PRIVMSG);
- ci->botflags.SetFlag(BS_MSG_NOTICE);
- ci->botflags.UnsetFlag(BS_MSG_NOTICEOPS);
- source.Reply(_("Fantasy replies will be sent via NOTICE to %s."), ci->name.c_str());
- }
- else if (value.equals_ci("NOTICEOPS"))
- {
- ci->botflags.UnsetFlag(BS_MSG_PRIVMSG);
- ci->botflags.UnsetFlag(BS_MSG_NOTICE);
- ci->botflags.SetFlag(BS_MSG_NOTICEOPS);
- source.Reply(_("Fantasy replies will be sent via NOTICE to channel ops on %s."), ci->name.c_str());
- }
- else
- this->OnSyntaxError(source, "MSG");
- }
else
this->OnSyntaxError(source, "");
}
@@ -195,7 +162,6 @@ class CommandBSSet : public Command
" DONTKICKVOICES To protect voices against bot kicks\n"
" GREET Enable greet messages\n"
" FANTASY Enable fantaisist commands\n"
- " MSG Configure how fantasy commands should be replied to\n"
" \n"
"Type \002%s%s HELP SET \037option\037\002 for more information\n"
"on a specific option.\n"
@@ -254,15 +220,6 @@ class CommandBSSet : public Command
source.Reply(_("Syntax: \002SET \037bot-nick\037 PRIVATE {\037ON|OFF\037}\002\n"
"This option prevents a bot from being assigned to a\n"
"channel by users that aren't IRC operators."));
- else if (subcommand.equals_ci("MSG"))
- source.Reply(_("Syntax: \002SET \037channel\037 MSG {\037OFF|PRIVMSG|NOTICE|NOTICEOPS\037}\002\n"
- " \n"
- "Configures how fantasy commands should be returned to the channel. Off disables\n"
- "fantasy from replying to the channel. Privmsg, notice, and noticeops message the\n"
- "channel, notice the channel, and notice the channel ops respectively.\n"
- " \n"
- "Note that replies over one line will not use this setting to prevent spam, and will\n"
- "go directly to the user who executed it."));
else
return false;
@@ -283,8 +240,6 @@ class CommandBSSet : public Command
this->SendSyntax(source, "\037channel\037 FANTASY {\037ON|OFF\037}");
else if (subcommand.equals_ci("GREET"))
this->SendSyntax(source, "\037channel\037 GREET {\037ON|OFF\037}");
- else if (subcommand.equals_ci("MSG"))
- this->SendSyntax(source, "\037channel\037 MSG {\037PRIVMSG|NOTICE|NOTICEOPS|OFF\037}");
else if (subcommand.equals_ci("NOBOT"))
this->SendSyntax(source, "\037channel\037 NOBOT {\037ON|OFF\037}");
else
diff --git a/modules/extra/m_ldap_authentication.cpp b/modules/extra/m_ldap_authentication.cpp
index 25d75a410..8a4ef2702 100644
--- a/modules/extra/m_ldap_authentication.cpp
+++ b/modules/extra/m_ldap_authentication.cpp
@@ -66,7 +66,6 @@ class IdentifyInterface : public LDAPInterface
enc_encrypt(ii->pass, na->nc->pass);
c->Execute(ii->source, ii->params);
- ii->source.DoReply();
delete ii;
}
@@ -91,7 +90,6 @@ class IdentifyInterface : public LDAPInterface
u->Extend("m_ldap_authentication_error");
c->Execute(ii->source, ii->params);
- ii->source.DoReply();
delete ii;
}
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);
}
}