1
0
mirror of https://github.com/anope/anope.git synced 2026-07-09 15:43:13 +02:00

Removed /bs set msg

This commit is contained in:
Adam
2011-09-03 00:17:01 -04:00
parent 17ea4ed8f5
commit 19e0b87aa1
7 changed files with 2 additions and 90 deletions
-4
View File
@@ -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.
-6
View File
@@ -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
};
-7
View File
@@ -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))
-45
View File
@@ -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
-2
View File
@@ -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;
}
-7
View File
@@ -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();
}
}
+2 -19
View File
@@ -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);
}
}