summaryrefslogtreecommitdiff
path: root/modules/commands
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-01-24 12:34:03 +0000
committerSadie Powell <sadie@witchery.services>2024-01-24 12:34:34 +0000
commit484160eb4ed560eeda97c94a42dd8e31431ab251 (patch)
tree03600af16b55fa2f268904d7a42a8b87f86c09f4 /modules/commands
parent7ac1fe58478d58e2480b6919c4abf3a82929169c (diff)
Shuffle modules around a bit.
Diffstat (limited to 'modules/commands')
-rw-r--r--modules/commands/bs_assign.cpp260
-rw-r--r--modules/commands/bs_badwords.cpp476
-rw-r--r--modules/commands/bs_bot.cpp387
-rw-r--r--modules/commands/bs_botlist.cpp82
-rw-r--r--modules/commands/bs_control.cpp149
-rw-r--r--modules/commands/bs_info.cpp134
-rw-r--r--modules/commands/bs_kick.cpp1491
-rw-r--r--modules/commands/bs_set.cpp231
-rw-r--r--modules/commands/cs_access.cpp939
-rw-r--r--modules/commands/cs_akick.cpp585
-rw-r--r--modules/commands/cs_ban.cpp254
-rw-r--r--modules/commands/cs_clone.cpp262
-rw-r--r--modules/commands/cs_drop.cpp97
-rw-r--r--modules/commands/cs_enforce.cpp279
-rw-r--r--modules/commands/cs_entrymsg.cpp294
-rw-r--r--modules/commands/cs_flags.cpp518
-rw-r--r--modules/commands/cs_getkey.cpp75
-rw-r--r--modules/commands/cs_info.cpp100
-rw-r--r--modules/commands/cs_invite.cpp113
-rw-r--r--modules/commands/cs_kick.cpp149
-rw-r--r--modules/commands/cs_list.cpp267
-rw-r--r--modules/commands/cs_log.cpp404
-rw-r--r--modules/commands/cs_mode.cpp1066
-rw-r--r--modules/commands/cs_register.cpp126
-rw-r--r--modules/commands/cs_seen.cpp461
-rw-r--r--modules/commands/cs_set.cpp1326
-rw-r--r--modules/commands/cs_set_misc.cpp222
-rw-r--r--modules/commands/cs_status.cpp125
-rw-r--r--modules/commands/cs_suspend.cpp296
-rw-r--r--modules/commands/cs_sync.cpp68
-rw-r--r--modules/commands/cs_topic.cpp273
-rw-r--r--modules/commands/cs_unban.cpp132
-rw-r--r--modules/commands/cs_updown.cpp245
-rw-r--r--modules/commands/cs_xop.cpp651
-rw-r--r--modules/commands/gl_global.cpp68
-rw-r--r--modules/commands/greet.cpp220
-rw-r--r--modules/commands/help.cpp199
-rw-r--r--modules/commands/hs_del.cpp116
-rw-r--r--modules/commands/hs_group.cpp118
-rw-r--r--modules/commands/hs_list.cpp160
-rw-r--r--modules/commands/hs_off.cpp71
-rw-r--r--modules/commands/hs_on.cpp77
-rw-r--r--modules/commands/hs_request.cpp399
-rw-r--r--modules/commands/hs_set.cpp231
-rw-r--r--modules/commands/ms_cancel.cpp103
-rw-r--r--modules/commands/ms_check.cpp89
-rw-r--r--modules/commands/ms_del.cpp162
-rw-r--r--modules/commands/ms_ignore.cpp134
-rw-r--r--modules/commands/ms_info.cpp235
-rw-r--r--modules/commands/ms_list.cpp167
-rw-r--r--modules/commands/ms_read.cpp227
-rw-r--r--modules/commands/ms_rsend.cpp106
-rw-r--r--modules/commands/ms_send.cpp90
-rw-r--r--modules/commands/ms_sendall.cpp70
-rw-r--r--modules/commands/ms_set.cpp317
-rw-r--r--modules/commands/ms_staff.cpp67
-rw-r--r--modules/commands/ns_access.cpp208
-rw-r--r--modules/commands/ns_ajoin.cpp408
-rw-r--r--modules/commands/ns_alist.cpp148
-rw-r--r--modules/commands/ns_cert.cpp412
-rw-r--r--modules/commands/ns_drop.cpp88
-rw-r--r--modules/commands/ns_getemail.cpp74
-rw-r--r--modules/commands/ns_group.cpp399
-rw-r--r--modules/commands/ns_identify.cpp131
-rw-r--r--modules/commands/ns_info.cpp287
-rw-r--r--modules/commands/ns_list.cpp303
-rw-r--r--modules/commands/ns_logout.cpp93
-rw-r--r--modules/commands/ns_recover.cpp301
-rw-r--r--modules/commands/ns_register.cpp445
-rw-r--r--modules/commands/ns_resetpass.cpp146
-rw-r--r--modules/commands/ns_set.cpp1464
-rw-r--r--modules/commands/ns_set_misc.cpp238
-rw-r--r--modules/commands/ns_status.cpp89
-rw-r--r--modules/commands/ns_suspend.cpp291
-rw-r--r--modules/commands/ns_update.cpp64
-rw-r--r--modules/commands/os_akill.cpp487
-rw-r--r--modules/commands/os_chankill.cpp119
-rw-r--r--modules/commands/os_config.cpp149
-rw-r--r--modules/commands/os_defcon.cpp603
-rw-r--r--modules/commands/os_dns.cpp944
-rw-r--r--modules/commands/os_forbid.cpp573
-rw-r--r--modules/commands/os_ignore.cpp421
-rw-r--r--modules/commands/os_info.cpp291
-rw-r--r--modules/commands/os_jupe.cpp82
-rw-r--r--modules/commands/os_kick.cpp86
-rw-r--r--modules/commands/os_kill.cpp69
-rw-r--r--modules/commands/os_list.cpp289
-rw-r--r--modules/commands/os_login.cpp135
-rw-r--r--modules/commands/os_logsearch.cpp187
-rw-r--r--modules/commands/os_mode.cpp192
-rw-r--r--modules/commands/os_modinfo.cpp211
-rw-r--r--modules/commands/os_module.cpp192
-rw-r--r--modules/commands/os_news.cpp478
-rw-r--r--modules/commands/os_noop.cpp100
-rw-r--r--modules/commands/os_oper.cpp292
-rw-r--r--modules/commands/os_reload.cpp69
-rw-r--r--modules/commands/os_session.cpp738
-rw-r--r--modules/commands/os_set.cpp269
-rw-r--r--modules/commands/os_shutdown.cpp112
-rw-r--r--modules/commands/os_stats.cpp281
-rw-r--r--modules/commands/os_svs.cpp182
-rw-r--r--modules/commands/os_sxline.cpp731
-rw-r--r--modules/commands/os_update.cpp54
103 files changed, 0 insertions, 29888 deletions
diff --git a/modules/commands/bs_assign.cpp b/modules/commands/bs_assign.cpp
deleted file mode 100644
index 43abdd55f..000000000
--- a/modules/commands/bs_assign.cpp
+++ /dev/null
@@ -1,260 +0,0 @@
-/* BotServ core functions
- *
- * (C) 2003-2024 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 CommandBSAssign final
- : public Command
-{
-public:
- CommandBSAssign(Module *creator) : Command(creator, "botserv/assign", 2, 2)
- {
- this->SetDesc(_("Assigns a bot to a channel"));
- this->SetSyntax(_("\037channel\037 \037nick\037"));
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
- {
- const Anope::string &chan = params[0];
- const Anope::string &nick = params[1];
-
- if (Anope::ReadOnly)
- {
- source.Reply(_("Sorry, bot assignment is temporarily disabled."));
- return;
- }
-
- ChannelInfo *ci = ChannelInfo::Find(params[0]);
- if (ci == NULL)
- {
- source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
- return;
- }
-
- BotInfo *bi = BotInfo::Find(nick, true);
- if (!bi)
- {
- source.Reply(BOT_DOES_NOT_EXIST, nick.c_str());
- return;
- }
-
- AccessGroup access = source.AccessFor(ci);
- if (ci->HasExt("BS_NOBOT") || (!access.HasPriv("ASSIGN") && !source.HasPriv("botserv/administration")))
- {
- source.Reply(ACCESS_DENIED);
- return;
- }
-
- if (bi->oper_only && !source.HasPriv("botserv/administration"))
- {
- source.Reply(ACCESS_DENIED);
- return;
- }
-
- if (ci->bi == bi)
- {
- source.Reply(_("Bot \002%s\002 is already assigned to channel \002%s\002."), ci->bi->nick.c_str(), chan.c_str());
- return;
- }
-
- bool override = !access.HasPriv("ASSIGN");
- Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "for " << bi->nick;
-
- bi->Assign(source.GetUser(), ci);
- source.Reply(_("Bot \002%s\002 has been assigned to %s."), bi->nick.c_str(), ci->name.c_str());
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Assigns the specified bot to a channel. You\n"
- "can then configure the bot for the channel so it fits\n"
- "your needs."));
- return true;
- }
-};
-
-class CommandBSUnassign final
- : public Command
-{
-public:
- CommandBSUnassign(Module *creator) : Command(creator, "botserv/unassign", 1, 1)
- {
- this->SetDesc(_("Unassigns a bot from a channel"));
- this->SetSyntax(_("\037channel\037"));
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
- {
- if (Anope::ReadOnly)
- {
- source.Reply(_("Sorry, bot assignment is temporarily disabled."));
- return;
- }
-
- 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("ASSIGN"))
- {
- source.Reply(ACCESS_DENIED);
- return;
- }
-
- if (!ci->bi)
- {
- source.Reply(BOT_NOT_ASSIGNED);
- return;
- }
-
- if (ci->HasExt("PERSIST") && !ModeManager::FindChannelModeByName("PERM"))
- {
- source.Reply(_("You cannot unassign bots while persist is set on the channel."));
- return;
- }
-
- bool override = !access.HasPriv("ASSIGN");
- Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "for " << ci->bi->nick;
-
- ci->bi->UnAssign(source.GetUser(), ci);
- source.Reply(_("There is no bot assigned to %s anymore."), ci->name.c_str());
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Unassigns a bot from a channel. When you use this command,\n"
- "the bot won't join the channel anymore. However, bot\n"
- "configuration for the channel is kept, so you will always\n"
- "be able to reassign a bot later without having to reconfigure\n"
- "it entirely."));
- return true;
- }
-};
-
-class CommandBSSetNoBot final
- : 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) override
- {
- ChannelInfo *ci = ChannelInfo::Find(params[0]);
- const Anope::string &value = params[1];
-
- if (Anope::ReadOnly)
- {
- source.Reply(_("Sorry, bot modification is temporarily disabled."));
- return;
- }
-
- if (ci == NULL)
- {
- source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
- return;
- }
-
- if (value.equals_ci("ON"))
- {
- Log(LOG_ADMIN, source, this, ci) << "to enable nobot";
-
- ci->Extend<bool>("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"))
- {
- Log(LOG_ADMIN, source, this, ci) << "to disable nobot";
-
- ci->Shrink<bool>("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 &) override
- {
- this->SendSyntax(source);
- source.Reply(_(" \n"
- "This option makes a channel unassignable. If a bot\n"
- "is already assigned to the channel, it is unassigned\n"
- "automatically when you enable it."));
- return true;
- }
-};
-
-class BSAssign final
- : public Module
-{
- ExtensibleItem<bool> nobot;
-
- CommandBSAssign commandbsassign;
- CommandBSUnassign commandbsunassign;
- CommandBSSetNoBot commandbssetnobot;
-
-public:
- BSAssign(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
- nobot(this, "BS_NOBOT"),
- commandbsassign(this), commandbsunassign(this), commandbssetnobot(this)
- {
- }
-
- void OnInvite(User *source, Channel *c, User *targ) override
- {
- BotInfo *bi;
- if (Anope::ReadOnly || !c->ci || targ->server != Me || !(bi = dynamic_cast<BotInfo *>(targ)))
- return;
-
- AccessGroup access = c->ci->AccessFor(source);
- if (nobot.HasExt(c->ci) || (!access.HasPriv("ASSIGN") && !source->HasPriv("botserv/administration")))
- {
- targ->SendMessage(bi, ACCESS_DENIED);
- return;
- }
-
- if (bi->oper_only && !source->HasPriv("botserv/administration"))
- {
- targ->SendMessage(bi, ACCESS_DENIED);
- return;
- }
-
- if (c->ci->bi == bi)
- {
- targ->SendMessage(bi, _("Bot \002%s\002 is already assigned to channel \002%s\002."), c->ci->bi->nick.c_str(), c->name.c_str());
- return;
- }
-
- bi->Assign(source, c->ci);
- targ->SendMessage(bi, _("Bot \002%s\002 has been assigned to %s."), bi->nick.c_str(), c->name.c_str());
- }
-
- void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) override
- {
- if (nobot.HasExt(ci))
- info.AddOption(_("No bot"));
- }
-};
-
-MODULE_INIT(BSAssign)
diff --git a/modules/commands/bs_badwords.cpp b/modules/commands/bs_badwords.cpp
deleted file mode 100644
index e513170e7..000000000
--- a/modules/commands/bs_badwords.cpp
+++ /dev/null
@@ -1,476 +0,0 @@
-/* BotServ core functions
- *
- * (C) 2003-2024 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"
-#include "modules/bs_badwords.h"
-
-struct BadWor