1
0
mirror of https://github.com/anope/anope.git synced 2026-06-29 20:25:43 +02:00

Combine all of the set modules now that having them split apart is almost completely pointless

This commit is contained in:
Adam
2012-12-22 14:49:48 -05:00
parent 0cde0aee34
commit dc751bd2f1
46 changed files with 2969 additions and 4223 deletions
+10 -57
View File
@@ -241,72 +241,25 @@ command { service = "BotServ"; name = "KICK"; command = "botserv/kick"; }
/*
* bs_set
*
* Provides the command botserv/set.
* Provides the commands:
* botserv/set/dontkickops - Used for preventing BotServ from kicking channel operators.
* botserv/set/dontkickvoices - Used for preventing BotServ from kicking voices.
* botserv/set/fantasy - Used for enabling or disabling BotServ's fantaisist commands.
* botserv/set/greet - Used for enabling or disabling BotServ's greet messages in a channel.
* botserv/set/nobot - Used to prohibit specific channels from being assigned BotServ bots.
* botserv/set/private - Used to prohibit specific BotServ bots from being assigned to channels.
*
* Used for setting options such as kickers and fantasy replies.
*/
module { name = "bs_set" }
command { service = "BotServ"; name = "SET"; command = "botserv/set"; }
/*
* bs_set_dontkickops
*
* Provides the command botserv/set/dontkickops.
*
* Used for preventing BotServ from kicking channel operators.
*/
module { name = "bs_set_dontkickops" }
command { service = "BotServ"; name = "SET DONTKICKOPS"; command = "botserv/set/dontkickops"; }
/*
* bs_set_dontkickvoices
*
* Provides the command botserv/set/dontkickvoices.
*
* Used for preventing BotServ from kicking voices.
*/
module { name = "bs_set_dontkickvoices" }
command { service = "BotServ"; name = "SET DONTKICKVOICES"; command = "botserv/set/dontkickvoices"; }
/*
* bs_set_fantasy
*
* Provides the command botserv/set/fantasy.
*
* Used for enabling or disabling BotServ's fantaisist commands.
*/
module { name = "bs_set_fantasy" }
command { service = "BotServ"; name = "SET FANTASY"; command = "botserv/set/fantasy"; }
/*
* bs_set_greet
*
* Provides the command botserv/set/greet.
*
* Used for enabling or disabling BotServ's greet messages in a channel.
*/
module { name = "bs_set_greet" }
command { service = "BotServ"; name = "SET GREET"; command = "botserv/set/greet"; }
/*
* bs_set_nobot
*
* Provides the command botserv/set/nobot.
*
* Used by Services Operators to prohibit specific channels from being assigned BotServ bots.
*/
module { name = "bs_set_nobot" }
command { service = "BotServ"; name = "SET NOBOT"; command = "botserv/set/nobot"; }
/*
* bs_set_private
*
* Provides the command botserv/set/private.
*
* Used by Services Operators to prohibit specific BotServ bots from being assigned to channels.
*/
module { name = "bs_set_private" }
command { service = "BotServ"; name = "SET PRIVATE"; command = "botserv/set/private"; }
command { service = "BotServ"; name = "SET NOBOT"; command = "botserv/set/nobot"; permission = "botserv/set/nobot"; }
command { service = "BotServ"; name = "SET PRIVATE"; command = "botserv/set/private"; permission = "botserv/set/private"; }
/* Fantasy commands
*
File diff suppressed because it is too large Load Diff
-25
View File
@@ -538,14 +538,6 @@ ssl
key = "data/anope.key"
}
/*
* m_statusupdate
*
* This module automatically updates users status on channels when the
* channel's access list is modified.
*/
module { name = "m_statusupdate" }
/*
* m_xmlrpc
*
@@ -567,23 +559,6 @@ m_xmlrpc
*/
#module { name = "m_xmlrpc_main" }
/*
* ns_maxemail
*
* Limits how many times the same email address may be used in Anope
* to register accounts.
*/
module { name = "ns_maxemail" }
ns_maxemail
{
/*
* The limit to how many registered nicks can use the same e-mail address. If set to 0 or left
* commented, there will be no limit enforced when registering new accounts or using
* /msg NickServ SET EMAIL.
*/
#maxemails = 1
}
/*
* webcpanel
*
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-90
View File
@@ -1,90 +0,0 @@
/* BotServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandBSSetDontKickOps : public Command
{
public:
CommandBSSetDontKickOps(Module *creator, const Anope::string &sname = "botserv/set/dontkickops") : Command(creator, sname, 2, 2)
{
this->SetDesc(_("To protect ops against bot kicks"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
AccessGroup access = source.AccessFor(ci);
if (!source.HasPriv("botserv/administration") && !access.HasPriv("SET"))
{
source.Reply(ACCESS_DENIED);
return;
}
if (Anope::ReadOnly)
{
source.Reply(_("Sorry, bot option setting is temporarily disabled."));
return;
}
if (params[1].equals_ci("ON"))
{
bool override = !access.HasPriv("SET");
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to enable dontkickops";
ci->botflags.SetFlag(BS_DONTKICKOPS);
source.Reply(_("Bot \002won't kick ops\002 on channel %s."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
bool override = !access.HasPriv("SET");
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to disable dontkickops";
ci->botflags.UnsetFlag(BS_DONTKICKOPS);
source.Reply(_("Bot \002will kick ops\002 on channel %s."), ci->name.c_str());
}
else
this->OnSyntaxError(source, source.command);
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(_(" \n"
"Enables or disables \002ops protection\002 mode on a channel.\n"
"When it is enabled, ops won't be kicked by the bot\n"
"even if they don't match the NOKICK level."));
return true;
}
};
class BSSetDontKickOps : public Module
{
CommandBSSetDontKickOps commandbssetdontkickops;
public:
BSSetDontKickOps(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandbssetdontkickops(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(BSSetDontKickOps)
@@ -1,90 +0,0 @@
/* BotServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandBSSetDontKickVoices : public Command
{
public:
CommandBSSetDontKickVoices(Module *creator, const Anope::string &sname = "botserv/set/dontkickvoices") : Command(creator, sname, 2, 2)
{
this->SetDesc(_("To protect voices against bot kicks"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
AccessGroup access = source.AccessFor(ci);
if (!source.HasPriv("botserv/administration") && !access.HasPriv("SET"))
{
source.Reply(ACCESS_DENIED);
return;
}
if (Anope::ReadOnly)
{
source.Reply(_("Sorry, bot option setting is temporarily disabled."));
return;
}
if (params[1].equals_ci("ON"))
{
bool override = !access.HasPriv("SET");
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to enable dontkickvoices";
ci->botflags.SetFlag(BS_DONTKICKVOICES);
source.Reply(_("Bot \002won't kick voices\002 on channel %s."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
bool override = !access.HasPriv("SET");
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to disable dontkickvoices";
ci->botflags.UnsetFlag(BS_DONTKICKVOICES);
source.Reply(_("Bot \002will kick voices\002 on channel %s."), ci->name.c_str());
}
else
this->OnSyntaxError(source, source.command);
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(_(" \n"
"Enables or disables \002voices protection\002 mode on a channel.\n"
"When it is enabled, voices won't be kicked by the bot\n"
"even if they don't match the NOKICK level."));
return true;
}
};
class BSSetDontKickVoices : public Module
{
CommandBSSetDontKickVoices commandbssetdontkickvoices;
public:
BSSetDontKickVoices(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandbssetdontkickvoices(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(BSSetDontKickVoices)
-99
View File
@@ -1,99 +0,0 @@
/* BotServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandBSSetFantasy : public Command
{
public:
CommandBSSetFantasy(Module *creator, const Anope::string &sname = "botserv/set/fantasy") : Command(creator, sname, 2, 2)
{
this->SetDesc(_("Enable fantaisist commands"));
this->SetSyntax(_("\037channel\037 {\037ON|OFF\037}"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
const Anope::string &value = params[1];
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
if (!source.HasPriv("botserv/administration") && !source.AccessFor(ci).HasPriv("SET"))
{
source.Reply(ACCESS_DENIED);
return;
}
if (Anope::ReadOnly)
{
source.Reply(_("Sorry, bot option setting is temporarily disabled."));
return;
}
if (value.equals_ci("ON"))
{
bool override = !source.AccessFor(ci).HasPriv("SET");
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to enable fantasy";
ci->botflags.SetFlag(BS_FANTASY);
source.Reply(_("Fantasy mode is now \002on\002 on channel %s."), ci->name.c_str());
}
else if (value.equals_ci("OFF"))
{
bool override = !source.AccessFor(ci).HasPriv("SET");
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to disable fantasy";
ci->botflags.UnsetFlag(BS_FANTASY);
source.Reply(_("Fantasy mode is now \002off\002 on channel %s."), ci->name.c_str());
}
else
this->OnSyntaxError(source, source.command);
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(_(" \n"
"Enables or disables \002fantasy\002 mode on a channel.\n"
"When it is enabled, users will be able to use\n"
"%s commands on a channel when prefixed\n"
"with one of the following fantasy characters: \002%s\002\n"
" \n"
"Note that users wanting to use fantaisist\n"
"commands MUST have enough level for both\n"
"the FANTASIA and another level depending\n"
"of the command if required (for example, to use \n"
"!op, user must have enough access for the OPDEOP\n"
"level)."), Config->ChanServ.c_str(), Config->BSFantasyCharacter.c_str());
return true;
}
};
class BSSetFantasy : public Module
{
CommandBSSetFantasy commandbssetfantasy;
public:
BSSetFantasy(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandbssetfantasy(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(BSSetFantasy)
-92
View File
@@ -1,92 +0,0 @@
/* BotServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandBSSetGreet : public Command
{
public:
CommandBSSetGreet(Module *creator, const Anope::string &sname = "botserv/set/greet") : Command(creator, sname, 2, 2)
{
this->SetDesc(_("Enable greet messages"));
this->SetSyntax(_("\037channel\037 {\037ON|OFF\037}"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
const Anope::string &value = params[1];
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
if (!source.HasPriv("botserv/administration") && !source.AccessFor(ci).HasPriv("SET"))
{
source.Reply(ACCESS_DENIED);
return;
}
if (Anope::ReadOnly)
{
source.Reply(_("Sorry, bot option setting is temporarily disabled."));
return;
}
if (value.equals_ci("ON"))
{
bool override = !source.AccessFor(ci).HasPriv("SET");
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to enable greets";
ci->botflags.SetFlag(BS_GREET);
source.Reply(_("Greet mode is now \002on\002 on channel %s."), ci->name.c_str());
}
else if (value.equals_ci("OFF"))
{
bool override = !source.AccessFor(ci).HasPriv("SET");
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to disable greets";
ci->botflags.UnsetFlag(BS_GREET);
source.Reply(_("Greet mode is now \002off\002 on channel %s."), ci->name.c_str());
}
else
this->OnSyntaxError(source, source.command);
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(_(" \n"
"Enables or disables \002greet\002 mode on a channel.\n"
"When it is enabled, the bot will display greet\n"
"messages of users joining the channel, provided\n"
"they have enough access to the channel."));
return true;
}
};
class BSSetGreet : public Module
{
CommandBSSetGreet commandbssetgreet;
public:
BSSetGreet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandbssetgreet(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(BSSetGreet)
-87
View File
@@ -1,87 +0,0 @@
/* BotServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandBSSetNoBot : public Command
{
public:
CommandBSSetNoBot(Module *creator, const Anope::string &sname = "botserv/set/nobot") : Command(creator, sname, 2, 2)
{
this->SetDesc(_("Prevent a bot from being assigned to a channel"));
this->SetSyntax(_("\037channel\037 {\037ON|OFF\037}"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
const Anope::string &value = params[1];
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
if (!source.HasCommand("botserv/set/nobot"))
{
source.Reply(ACCESS_DENIED);
return;
}
if (value.equals_ci("ON"))
{
bool override = !source.AccessFor(ci).HasPriv("SET");
Log(override ? LOG_ADMIN : LOG_COMMAND, source, this, ci) << "to enable nobot";
ci->botflags.SetFlag(BS_NOBOT);
if (ci->bi)
ci->bi->UnAssign(source.GetUser(), ci);
source.Reply(_("No Bot mode is now \002on\002 on channel %s."), ci->name.c_str());
}
else if (value.equals_ci("OFF"))
{
bool override = !source.AccessFor(ci).HasPriv("SET");
Log(override ? LOG_ADMIN : LOG_COMMAND, source, this, ci) << "to disable nobot";
ci->botflags.UnsetFlag(BS_NOBOT);
source.Reply(_("No Bot mode is now \002off\002 on channel %s."), ci->name.c_str());
}
else
this->OnSyntaxError(source, source.command);
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(_(" \n"
"This option makes a channel be unassignable. If a bot \n"
"is already assigned to the channel, it is unassigned\n"
"automatically when you enable the option."));
return true;
}
};
class BSSetNoBot : public Module
{
CommandBSSetNoBot commandbssetnobot;
public:
BSSetNoBot(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandbssetnobot(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(BSSetNoBot)
-78
View File
@@ -1,78 +0,0 @@
/* BotServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandBSSetPrivate : public Command
{
public:
CommandBSSetPrivate(Module *creator, const Anope::string &sname = "botserv/set/private") : Command(creator, sname, 2, 2)
{
this->SetDesc(_("Prevent a bot from being assigned by non IRC operators"));
this->SetSyntax(_("\037botname\037 {\037ON|OFF\037}"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
BotInfo *bi = BotInfo::Find(params[0], true);
const Anope::string &value = params[1];
if (bi == NULL)
{
source.Reply(BOT_DOES_NOT_EXIST, params[0].c_str());
return;
}
if (!source.HasCommand("botserv/set/private"))
{
source.Reply(ACCESS_DENIED);
return;
}
if (value.equals_ci("ON"))
{
bi->SetFlag(BI_PRIVATE);
source.Reply(_("Private mode of bot %s is now \002on\002."), bi->nick.c_str());
}
else if (value.equals_ci("OFF"))
{
bi->UnsetFlag(BI_PRIVATE);
source.Reply(_("Private mode of bot %s is now \002off\002."), bi->nick.c_str());
}
else
this->OnSyntaxError(source, source.command);
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(_(" \n"
"This option prevents a bot from being assigned to a\n"
"channel by users that aren't IRC operators."));
return true;
}
};
class BSSetPrivate : public Module
{
CommandBSSetPrivate commandbssetprivate;
public:
BSSetPrivate(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandbssetprivate(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(BSSetPrivate)
-73
View File
@@ -1,73 +0,0 @@
/* ChanServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandCSSASet : public Command
{
public:
CommandCSSASet(Module *creator) : Command(creator, "chanserv/saset", 2, 3)
{
this->SetDesc(_("Forcefully set channel options and information"));
this->SetSyntax(_("\037option\037 \037channel\037 \037parameters\037"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
this->OnSyntaxError(source, "");
return;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override
{
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Allows Services Operators to forcefully change settings\n"
"on channels.\n"
" \n"
"Available options:"));
Anope::string this_name = source.command;
for (CommandInfo::map::const_iterator it = source.service->commands.begin(), it_end = source.service->commands.end(); it != it_end; ++it)
{
const Anope::string &c_name = it->first;
const CommandInfo &info = it->second;
if (c_name.find_ci(this_name + " ") == 0)
{
ServiceReference<Command> command("Command", info.name);
if (command)
{
source.command = it->first;
command->OnServHelp(source);
}
}
}
source.Reply(_("Type \002%s%s HELP SASET \037option\037\002 for more information on a\n"
"particular option."), Config->UseStrictPrivMsgString.c_str(), source.service->nick.c_str());
return true;
}
};
class CSSASet : public Module
{
CommandCSSASet commandcssaset;
public:
CSSASet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandcssaset(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(CSSASet)
-79
View File
@@ -1,79 +0,0 @@
/* ChanServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandCSSASetNoexpire : public Command
{
public:
CommandCSSASetNoexpire(Module *creator) : Command(creator, "chanserv/saset/noexpire", 2, 2)
{
this->SetDesc(_("Prevent the channel from expiring"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
if (source.permission.empty() && !source.AccessFor(ci).HasPriv("SET"))
{
source.Reply(ACCESS_DENIED);
return;
}
if (params[1].equals_ci("ON"))
{
ci->SetFlag(CI_NO_EXPIRE);
source.Reply(_("Channel %s \002will not\002 expire."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_NO_EXPIRE);
source.Reply(_("Channel %s \002will\002 expire."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "NOEXPIRE");
return;
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Sets whether the given channel will expire. Setting this\n"
"to ON prevents the channel from expiring."));
return true;
}
};
class CSSetNoexpire : public Module
{
CommandCSSASetNoexpire commandcssasetnoexpire;
public:
CSSetNoexpire(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandcssasetnoexpire(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(CSSetNoexpire)
File diff suppressed because it is too large Load Diff
-85
View File
@@ -1,85 +0,0 @@
/* ChanServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandCSSetAutoOp : public Command
{
public:
CommandCSSetAutoOp(Module *creator, const Anope::string &cname = "chanserv/set/autoop") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Should services automatically give status to users"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1]));
if (MOD_RESULT == EVENT_STOP)
return;
if (MOD_RESULT != EVENT_ALLOW && source.permission.empty() && !source.AccessFor(ci).HasPriv("SET"))
{
source.Reply(ACCESS_DENIED);
return;
}
if (params[1].equals_ci("ON"))
{
ci->UnsetFlag(CI_NOAUTOOP);
source.Reply(_("Services will now automatically give modes to users in \2%s\2"), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->SetFlag(CI_NOAUTOOP);
source.Reply(_("Services will no longer automatically give modes to users in \2%s\2"), ci->name.c_str());
}
else
this->OnSyntaxError(source, "AUTOOP");
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Enables or disables %s's autoop feature for a\n"
"channel. When disabled, users who join the channel will\n"
"not automatically gain any status from %s"), Config->ChanServ.c_str(),
Config->ChanServ.c_str(), this->name.c_str());
return true;
}
};
class CSSetAutoOp : public Module
{
CommandCSSetAutoOp commandcssetautoop;
public:
CSSetAutoOp(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandcssetautoop(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(CSSetAutoOp)
-91
View File
@@ -1,91 +0,0 @@
/* ChanServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandCSSetBanType : public Command
{
public:
CommandCSSetBanType(Module *creator, const Anope::string &cname = "chanserv/set/bantype") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Set how Services make bans on the channel"));
this->SetSyntax(_("\037channel\037 \037bantype\037"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1]));
if (MOD_RESULT == EVENT_STOP)
return;
if (MOD_RESULT != EVENT_ALLOW && source.permission.empty() && !source.AccessFor(ci).HasPriv("SET"))
{
source.Reply(ACCESS_DENIED);
return;
}
try
{
int16_t new_type = convertTo<int16_t>(params[1]);
if (new_type < 0 || new_type > 3)
throw ConvertException("Invalid range");
ci->bantype = new_type;
source.Reply(_("Ban type for channel %s is now #%d."), ci->name.c_str(), ci->bantype);
}
catch (const ConvertException &)
{
source.Reply(_("\002%s\002 is not a valid ban type."), params[1].c_str());
}
return;
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Sets the ban type that will be used by services whenever\n"
"they need to ban someone from your channel.\n"
" \n"
"bantype is a number between 0 and 3 that means:\n"
" \n"
"0: ban in the form *!user@host\n"
"1: ban in the form *!*user@host\n"
"2: ban in the form *!*@host\n"
"3: ban in the form *!*user@*.domain"), this->name.c_str());
return true;
}
};
class CSSetBanType : public Module
{
CommandCSSetBanType commandcssetbantype;
public:
CSSetBanType(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandcssetbantype(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(CSSetBanType)
-94
View File
@@ -1,94 +0,0 @@
/* NickServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandCSSetChanstats : public Command
{
public:
CommandCSSetChanstats(Module *creator) : Command(creator, "chanserv/set/chanstats", 2, 2)
{
this->SetDesc(_("Turn chanstat statistics on or off"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
if (!ci)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1]));
if (MOD_RESULT == EVENT_STOP)
return;
if (MOD_RESULT != EVENT_ALLOW && source.permission.empty() && !source.AccessFor(ci).HasPriv("SET"))
{
source.Reply(ACCESS_DENIED);
return;
}
if (params[1].equals_ci("ON"))
{
ci->SetFlag(CI_STATS);
source.Reply(_("Chanstats statistics are now enabled for this channel"));
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_STATS);
source.Reply(_("Chanstats statistics are now disabled for this channel"));
}
else
this->OnSyntaxError(source, "");
return;
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(" ");
source.Reply("Turn Chanstats channel statistics ON or OFF");
return true;
}
};
class CSSetChanstats : public Module
{
CommandCSSetChanstats commandcssetchanstats;
bool CSDefChanstats;
public:
CSSetChanstats(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandcssetchanstats(this)
{
this->SetAuthor("Anope");
Implementation i[] = { I_OnReload, I_OnChanRegistered };
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
this->OnReload();
}
void OnReload() anope_override
{
ConfigReader config;
CSDefChanstats = config.ReadFlag("chanstats", "CSDefChanstats", "0", 0);
}
void OnChanRegistered(ChannelInfo *ci) anope_override
{
if (CSDefChanstats)
ci->SetFlag(CI_STATS);
}
};
MODULE_INIT(CSSetChanstats)
-82
View File
@@ -1,82 +0,0 @@
/* ChanServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandCSSetDescription : public Command
{
public:
CommandCSSetDescription(Module *creator, const Anope::string &cname = "chanserv/set/description") : Command(creator, cname, 1, 2)
{
this->SetDesc(_("Set the channel description"));
this->SetSyntax(_("\037channel\037 [\037description\037]"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1]));
if (MOD_RESULT == EVENT_STOP)
return;
if (MOD_RESULT != EVENT_ALLOW && source.permission.empty() && !source.AccessFor(ci).HasPriv("SET"))
{
source.Reply(ACCESS_DENIED);
return;
}
if (params.size() > 1)
{
ci->desc = params[1];
source.Reply(_("Description of %s changed to \002%s\002."), ci->name.c_str(), ci->desc.c_str());
}
else
{
ci->desc.clear();
source.Reply(_("Description of %s unset."), ci->name.c_str());
}
return;
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Sets the description for the channel, which shows up with\n"
"the \002LIST\002 and \002INFO\002 commands."), this->name.c_str());
return true;
}
};
class CSSetDescription : public Module
{
CommandCSSetDescription commandcssetdescription;
public:
CSSetDescription(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandcssetdescription(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(CSSetDescription)
-97
View File
@@ -1,97 +0,0 @@
/* ChanServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandCSSetFounder : public Command
{
public:
CommandCSSetFounder(Module *creator, const Anope::string &cname = "chanserv/set/founder") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Set the founder of a channel"));
this->SetSyntax(_("\037channel\037 \037nick\037"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1]));
if (MOD_RESULT == EVENT_STOP)
return;
if (MOD_RESULT != EVENT_ALLOW && source.permission.empty() && !source.AccessFor(ci).HasPriv("SET"))
{
source.Reply(ACCESS_DENIED);
return;
}
if (source.permission.empty() && (ci->HasFlag(CI_SECUREFOUNDER) ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER")))
{
source.Reply(ACCESS_DENIED);
return;
}
const NickAlias *na = NickAlias::Find(params[1]);
if (!na)
{
source.Reply(NICK_X_NOT_REGISTERED, params[1].c_str());
return;
}
NickCore *nc = na->nc;
if (Config->CSMaxReg && nc->channelcount >= Config->CSMaxReg && !source.HasPriv("chanserv/no-register-limit"))
{
source.Reply(_("\002%s\002 has too many channels registered."), na->nick.c_str());
return;
}
Log(!source.permission.empty() ? LOG_ADMIN : LOG_COMMAND, source, this, ci) << "to change the founder from " << (ci->GetFounder() ? ci->GetFounder()->display : "(none)") << " to " << nc->display;
ci->SetFounder(nc);
source.Reply(_("Founder of \002%s\002 changed to \002%s\002."), ci->name.c_str(), na->nick.c_str());
return;
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Changes the founder of a channel. The new nickname must\n"
"be a registered one."), this->name.c_str());
return true;
}
};
class CSSetFounder : public Module
{
CommandCSSetFounder commandcssetfounder;
public:
CSSetFounder(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandcssetfounder(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(CSSetFounder)
-87
View File
@@ -1,87 +0,0 @@
/* ChanServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandCSSetKeepTopic : public Command
{
public:
CommandCSSetKeepTopic(Module *creator, const Anope::string &cname = "chanserv/set/keeptopic") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Retain topic when channel is not in use"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1]));
if (MOD_RESULT == EVENT_STOP)
return;
if (MOD_RESULT != EVENT_ALLOW && source.permission.empty() && !source.AccessFor(ci).HasPriv("SET"))
{
source.Reply(ACCESS_DENIED);
return;
}
if (params[1].equals_ci("ON"))
{
ci->SetFlag(CI_KEEPTOPIC);
source.Reply(_("Topic retention option for %s is now \002on\002."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_KEEPTOPIC);
source.Reply(_("Topic retention option for %s is now \002off\002."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "KEEPTOPIC");
return;
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Enables or disables the \002topic retention\002 option for a\n"
"channel. When \002%s\002 is set, the topic for the\n"
"channel will be remembered by %s even after the\n"
"last user leaves the channel, and will be restored the\n"
"next time the channel is created."), this->name.c_str(), source.service->nick.c_str());
return true;
}
};
class CSSetKeepTopic : public Module
{
CommandCSSetKeepTopic commandcssetkeeptopic;
public:
CSSetKeepTopic(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandcssetkeeptopic(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(CSSetKeepTopic)
-85
View File
@@ -1,85 +0,0 @@
/* ChanServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandCSSetPeace : public Command
{
public:
CommandCSSetPeace(Module *creator, const Anope::string &cname = "chanserv/set/peace") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Regulate the use of critical commands"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1]));
if (MOD_RESULT == EVENT_STOP)
return;
if (MOD_RESULT != EVENT_ALLOW && source.permission.empty() && !source.AccessFor(ci).HasPriv("SET"))
{
source.Reply(ACCESS_DENIED);
return;
}
if (params[1].equals_ci("ON"))
{
ci->SetFlag(CI_PEACE);
source.Reply(_("Peace option for %s is now \002on\002."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_PEACE);
source.Reply(_("Peace option for %s is now \002off\002."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "PEACE");
return;
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Enables or disables the \002peace\002 option for a channel.\n"
"When \002peace\002 is set, a user won't be able to kick,\n"
"ban or remove a channel status of a user that has\n"
"a level superior or equal to his via %s commands."), source.service->nick.c_str());
return true;
}
};
class CSSetPeace : public Module
{
CommandCSSetPeace commandcssetpeace;
public:
CSSetPeace(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandcssetpeace(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(CSSetPeace)
File diff suppressed because it is too large Load Diff
-86
View File
@@ -1,86 +0,0 @@
/* ChanServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandCSSetPrivate : public Command
{
public:
CommandCSSetPrivate(Module *creator, const Anope::string &cname = "chanserv/set/private") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Hide channel from LIST command"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1]));
if (MOD_RESULT == EVENT_STOP)
return;
if (MOD_RESULT != EVENT_ALLOW && source.permission.empty() && !source.AccessFor(ci).HasPriv("SET"))
{
source.Reply(ACCESS_DENIED);
return;
}
if (params[1].equals_ci("ON"))
{
ci->SetFlag(CI_PRIVATE);
source.Reply(_("Private option for %s is now \002on\002."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_PRIVATE);
source.Reply(_("Private option for %s is now \002off\002."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "PRIVATE");
return;
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Enables or disables the \002private\002 option for a channel.\n"
"When \002private\002 is set, a \002%s%s LIST\002 will not\n"
"include the channel in any lists."),
Config->UseStrictPrivMsgString.c_str(), source.service->nick.c_str());
return true;
}
};
class CSSetPrivate : public Module
{
CommandCSSetPrivate commandcssetprivate;
public:
CSSetPrivate(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandcssetprivate(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(CSSetPrivate)
-84
View File
@@ -1,84 +0,0 @@
/* ChanServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandCSSetRestricted : public Command
{
public:
CommandCSSetRestricted(Module *creator, const Anope::string &cname = "chanserv/set/restricted") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Restrict access to the channel"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1]));
if (MOD_RESULT == EVENT_STOP)
return;
if (MOD_RESULT != EVENT_ALLOW && source.permission.empty() && !source.AccessFor(ci).HasPriv("SET"))
{
source.Reply(ACCESS_DENIED);
return;
}
if (params[1].equals_ci("ON"))
{
ci->SetFlag(CI_RESTRICTED);
source.Reply(_("Restricted access option for %s is now \002on\002."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_RESTRICTED);
source.Reply(_("Restricted access option for %s is now \002off\002."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "RESTRICTED");
return;
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Enables or disables the \002restricted access\002 option for a\n"
"channel. When \002restricted access\002 is set, users not on the access list will\n"
"instead be kicked and banned from the channel."));
return true;
}
};
class CSSetRestricted : public Module
{
CommandCSSetRestricted commandcssetrestricted;
public:
CSSetRestricted(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandcssetrestricted(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(CSSetRestricted)
-87
View File
@@ -1,87 +0,0 @@
/* ChanServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandCSSetSecure : public Command
{
public:
CommandCSSetSecure(Module *creator, const Anope::string &cname = "chanserv/set/secure") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Activate security features"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1]));
if (MOD_RESULT == EVENT_STOP)
return;
if (MOD_RESULT != EVENT_ALLOW && source.permission.empty() && !source.AccessFor(ci).HasPriv("SET"))
{
source.Reply(ACCESS_DENIED);
return;
}
if (params[1].equals_ci("ON"))
{
ci->SetFlag(CI_SECURE);
source.Reply(_("Secure option for %s is now \002on\002."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_SECURE);
source.Reply(_("Secure option for %s is now \002off\002."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "SECURE");
return;
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Enables or disables security features for a\n"
"channel. When \002%s\002 is set, only users who have\n"
"registered their nicknames and IDENTIFY'd\n"
"with their password will be given access to the channel\n"
"as controlled by the access list."), this->name.c_str());
return true;
}
};
class CSSetSecure : public Module
{
CommandCSSetSecure commandcssetsecure;
public:
CSSetSecure(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandcssetsecure(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(CSSetSecure)
-87
View File
@@ -1,87 +0,0 @@
/* ChanServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandCSSetSecureFounder : public Command
{
public:
CommandCSSetSecureFounder(Module *creator, const Anope::string &cname = "chanserv/set/securefounder") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Stricter control of channel founder status"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1]));
if (MOD_RESULT == EVENT_STOP)
return;
if (MOD_RESULT != EVENT_ALLOW && source.permission.empty() && !source.AccessFor(ci).HasPriv("SET"))
{
source.Reply(ACCESS_DENIED);
return;
}
if (params[1].equals_ci("ON"))
{
ci->SetFlag(CI_SECUREFOUNDER);
source.Reply(_("Secure founder option for %s is now \002on\002."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_SECUREFOUNDER);
source.Reply(_("Secure founder option for %s is now \002off\002."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "SECUREFOUNDER");
return;
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Enables or disables the \002secure founder\002 option for a channel.\n"
"When \002secure founder\002 is set, only the real founder will be\n"
"able to drop the channel, change its founder and its successor,\n"
"and not those who have founder level access through\n"
"the access/qop command."));
return true;
}
};
class CSSetSecureFounder : public Module
{
CommandCSSetSecureFounder commandcssetsecurefounder;
public:
CSSetSecureFounder(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandcssetsecurefounder(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(CSSetSecureFounder)
-85
View File
@@ -1,85 +0,0 @@
/* ChanServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandCSSetSecureOps : public Command
{
public:
CommandCSSetSecureOps(Module *creator, const Anope::string &cname = "chanserv/set/secureops") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Stricter control of chanop status"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1]));
if (MOD_RESULT == EVENT_STOP)
return;
if (MOD_RESULT != EVENT_ALLOW && source.permission.empty() && !source.AccessFor(ci).HasPriv("SET"))
{
source.Reply(ACCESS_DENIED);
return;
}
if (params[1].equals_ci("ON"))
{
ci->SetFlag(CI_SECUREOPS);
source.Reply(_("Secure ops option for %s is now \002on\002."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_SECUREOPS);
source.Reply(_("Secure ops option for %s is now \002off\002."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "SECUREOPS");
return;
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Enables or disables the \002secure ops\002 option for a channel.\n"
"When \002secure ops\002 is set, users who are not on the userlist\n"
"will not be allowed chanop status."));
return true;
}
};
class CSSetSecureOps : public Module
{
CommandCSSetSecureOps commandcssetsecureops;
public:
CSSetSecureOps(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandcssetsecureops(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(CSSetSecureOps)
-97
View File
@@ -1,97 +0,0 @@
/* ChanServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandCSSetSignKick : public Command
{
public:
CommandCSSetSignKick(Module *creator, const Anope::string &cname = "chanserv/set/signkick") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Sign kicks that are done with KICK command"));
this->SetSyntax(_("\037channel\037 SIGNKICK {ON | LEVEL | OFF}"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1]));
if (MOD_RESULT == EVENT_STOP)
return;
if (MOD_RESULT != EVENT_ALLOW && source.permission.empty() && !source.AccessFor(ci).HasPriv("SET"))
{
source.Reply(ACCESS_DENIED);
return;
}
if (params[1].equals_ci("ON"))
{
ci->SetFlag(CI_SIGNKICK);
ci->UnsetFlag(CI_SIGNKICK_LEVEL);
source.Reply(_("Signed kick option for %s is now \002on\002."), ci->name.c_str());
}
else if (params[1].equals_ci("LEVEL"))
{
ci->SetFlag(CI_SIGNKICK_LEVEL);
ci->UnsetFlag(CI_SIGNKICK);
source.Reply(_("Signed kick option for %s is now \002ON\002, but depends of the\n"
"level of the user that is using the command."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_SIGNKICK);
ci->UnsetFlag(CI_SIGNKICK_LEVEL);
source.Reply(_("Signed kick option for %s is now \002off\002."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "SIGNKICK");
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Enables or disables signed kicks for a\n"
"channel. When \002SIGNKICK\002 is set, kicks issued with\n"
"the \002KICK\002 command will have the nick that used the\n"
"command in their reason.\n"
" \n"
"If you use \002LEVEL\002, those who have a level that is superior\n"
"or equal to the SIGNKICK level on the channel won't have their\n"
"kicks signed."));
return true;
}
};
class CSSetSignKick : public Module
{
CommandCSSetSignKick commandcssetsignkick;
public:
CSSetSignKick(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandcssetsignkick(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(CSSetSignKick)
File diff suppressed because it is too large Load Diff
-85
View File
@@ -1,85 +0,0 @@
/* ChanServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandCSSetTopicLock : public Command
{
public:
CommandCSSetTopicLock(Module *creator, const Anope::string &cname = "chanserv/set/topiclock") : Command(creator, cname, 2, 2)
{
this->SetDesc(_("Topic can only be changed with TOPIC"));
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
ChannelInfo *ci = ChannelInfo::Find(params[0]);
if (ci == NULL)
{
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
return;
}
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnSetChannelOption, OnSetChannelOption(source, this, ci, params[1]));
if (MOD_RESULT == EVENT_STOP)
return;
if (MOD_RESULT != EVENT_ALLOW && source.permission.empty() && !source.AccessFor(ci).HasPriv("SET"))
{
source.Reply(ACCESS_DENIED);
return;
}
if (params[1].equals_ci("ON"))
{
ci->SetFlag(CI_TOPICLOCK);
source.Reply(_("Topic lock option for %s is now \002on\002."), ci->name.c_str());
}
else if (params[1].equals_ci("OFF"))
{
ci->UnsetFlag(CI_TOPICLOCK);
source.Reply(_("Topic lock option for %s is now \002off\002."), ci->name.c_str());
}
else
this->OnSyntaxError(source, "TOPICLOCK");
return;
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Enables or disables the \002topic lock\002 option for a channel.\n"
"When \002topic lock\002 is set, the channel topic will be unchangable\n"
"except via the \002TOPIC\002 command."));
return true;
}
};
class CSSetTopicLock : public Module
{
CommandCSSetTopicLock commandcssettopiclock;
public:
CSSetTopicLock(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandcssettopiclock(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(CSSetTopicLock)
File diff suppressed because it is too large Load Diff
-75
View File
@@ -1,75 +0,0 @@
/* NickServ core functions
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
/*************************************************************************/
#include "module.h"
class CommandNSSASetNoexpire : public Command
{
public:
CommandNSSASetNoexpire(Module *creator) : Command(creator, "nickserv/saset/noexpire", 1, 2)
{
this->SetDesc(_("Prevent the nickname from expiring"));
this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
NickAlias *na = NickAlias::Find(params[0]);
if (na == NULL)
{
source.Reply(NICK_X_NOT_REGISTERED, params[0].c_str());
return;
}
Anope::string param = params.size() > 1 ? params[1] : "";
if (param.equals_ci("ON"))
{
na->SetFlag(NS_NO_EXPIRE);
source.Reply(_("Nick %s \002will not\002 expire."), na->nick.c_str());
}
else if (param.equals_ci("OFF"))
{
na->UnsetFlag(NS_NO_EXPIRE);
source.Reply(_("Nick %s \002will\002 expire."), na->nick.c_str());
}
else
this->OnSyntaxError(source, "NOEXPIRE");
return;
}
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Sets whether the given nickname will expire. Setting this\n"
"to \002ON\002 prevents the nickname from expiring."));
return true;
}
};
class NSSASetNoexpire : public Module
{
CommandNSSASetNoexpire commandnssasetnoexpire;
public:
NSSASetNoexpire(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
commandnssasetnoexpire(this)
{
this->SetAuthor("Anope");
}
};
MODULE_INIT(NSSASetNoexpire)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+2 -5
View File
@@ -1,5 +1,5 @@
/* ns_maxemail.c - Limit the amount of times an email address
* can be used for a NickServ account.
/* ns_maxemail.cpp - Limit the amount of times an email address
* can be used for a NickServ account.
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
@@ -8,9 +8,6 @@
* Anope Coder: GeniusDex <geniusdex@anope.org>
*
* Please read COPYING and README for further details.
*
* Send any bug reports to the Anope Coder, as he will be able
* to deal with it best.
*/
#include "module.h"