From dc751bd2f10ab498352ee8a64d2c4b0dcac7c4ea Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 22 Dec 2012 14:49:48 -0500 Subject: Combine all of the set modules now that having them split apart is almost completely pointless --- data/botserv.example.conf | 67 +- data/chanserv.example.conf | 188 +--- data/modules.example.conf | 25 - data/nickserv.example.conf | 153 +--- modules/commands/bs_set.cpp | 366 +++++++- modules/commands/bs_set_dontkickops.cpp | 90 -- modules/commands/bs_set_dontkickvoices.cpp | 90 -- modules/commands/bs_set_fantasy.cpp | 99 --- modules/commands/bs_set_greet.cpp | 92 -- modules/commands/bs_set_nobot.cpp | 87 -- modules/commands/bs_set_private.cpp | 78 -- modules/commands/cs_saset.cpp | 73 -- modules/commands/cs_saset_noexpire.cpp | 79 -- modules/commands/cs_set.cpp | 1186 ++++++++++++++++++++++++- modules/commands/cs_set_autoop.cpp | 85 -- modules/commands/cs_set_bantype.cpp | 91 -- modules/commands/cs_set_chanstats.cpp | 94 -- modules/commands/cs_set_description.cpp | 82 -- modules/commands/cs_set_founder.cpp | 97 -- modules/commands/cs_set_keeptopic.cpp | 87 -- modules/commands/cs_set_peace.cpp | 85 -- modules/commands/cs_set_persist.cpp | 177 ---- modules/commands/cs_set_private.cpp | 86 -- modules/commands/cs_set_restricted.cpp | 84 -- modules/commands/cs_set_secure.cpp | 87 -- modules/commands/cs_set_securefounder.cpp | 87 -- modules/commands/cs_set_secureops.cpp | 85 -- modules/commands/cs_set_signkick.cpp | 97 -- modules/commands/cs_set_successor.cpp | 115 --- modules/commands/cs_set_topiclock.cpp | 85 -- modules/commands/ns_saset.cpp | 128 --- modules/commands/ns_saset_noexpire.cpp | 75 -- modules/commands/ns_set.cpp | 1325 +++++++++++++++++++++++++++- modules/commands/ns_set_autoop.cpp | 110 --- modules/commands/ns_set_chanstats.cpp | 120 --- modules/commands/ns_set_display.cpp | 104 --- modules/commands/ns_set_email.cpp | 190 ---- modules/commands/ns_set_greet.cpp | 111 --- modules/commands/ns_set_hide.cpp | 152 ---- modules/commands/ns_set_kill.cpp | 154 ---- modules/commands/ns_set_language.cpp | 132 --- modules/commands/ns_set_message.cpp | 123 --- modules/commands/ns_set_private.cpp | 117 --- modules/commands/ns_set_secure.cpp | 117 --- modules/extra/cs_statusupdate.cpp | 68 ++ modules/extra/m_statusupdate.cpp | 68 -- modules/extra/ns_maxemail.cpp | 7 +- 47 files changed, 3022 insertions(+), 4276 deletions(-) delete mode 100644 modules/commands/bs_set_dontkickops.cpp delete mode 100644 modules/commands/bs_set_dontkickvoices.cpp delete mode 100644 modules/commands/bs_set_fantasy.cpp delete mode 100644 modules/commands/bs_set_greet.cpp delete mode 100644 modules/commands/bs_set_nobot.cpp delete mode 100644 modules/commands/bs_set_private.cpp delete mode 100644 modules/commands/cs_saset.cpp delete mode 100644 modules/commands/cs_saset_noexpire.cpp delete mode 100644 modules/commands/cs_set_autoop.cpp delete mode 100644 modules/commands/cs_set_bantype.cpp delete mode 100644 modules/commands/cs_set_chanstats.cpp delete mode 100644 modules/commands/cs_set_description.cpp delete mode 100644 modules/commands/cs_set_founder.cpp delete mode 100644 modules/commands/cs_set_keeptopic.cpp delete mode 100644 modules/commands/cs_set_peace.cpp delete mode 100644 modules/commands/cs_set_persist.cpp delete mode 100644 modules/commands/cs_set_private.cpp delete mode 100644 modules/commands/cs_set_restricted.cpp delete mode 100644 modules/commands/cs_set_secure.cpp delete mode 100644 modules/commands/cs_set_securefounder.cpp delete mode 100644 modules/commands/cs_set_secureops.cpp delete mode 100644 modules/commands/cs_set_signkick.cpp delete mode 100644 modules/commands/cs_set_successor.cpp delete mode 100644 modules/commands/cs_set_topiclock.cpp delete mode 100644 modules/commands/ns_saset.cpp delete mode 100644 modules/commands/ns_saset_noexpire.cpp delete mode 100644 modules/commands/ns_set_autoop.cpp delete mode 100644 modules/commands/ns_set_chanstats.cpp delete mode 100644 modules/commands/ns_set_display.cpp delete mode 100644 modules/commands/ns_set_email.cpp delete mode 100644 modules/commands/ns_set_greet.cpp delete mode 100644 modules/commands/ns_set_hide.cpp delete mode 100644 modules/commands/ns_set_kill.cpp delete mode 100644 modules/commands/ns_set_language.cpp delete mode 100644 modules/commands/ns_set_message.cpp delete mode 100644 modules/commands/ns_set_private.cpp delete mode 100644 modules/commands/ns_set_secure.cpp create mode 100644 modules/extra/cs_statusupdate.cpp delete mode 100644 modules/extra/m_statusupdate.cpp diff --git a/data/botserv.example.conf b/data/botserv.example.conf index 568a1cbd1..09d644e0c 100644 --- a/data/botserv.example.conf +++ b/data/botserv.example.conf @@ -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"; command = "botserv/set"; } 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 * diff --git a/data/chanserv.example.conf b/data/chanserv.example.conf index c570e9185..5734fe8a0 100644 --- a/data/chanserv.example.conf +++ b/data/chanserv.example.conf @@ -1089,212 +1089,92 @@ cs_seen /* * cs_set * - * Provides the command chanserv/set. + * Provides the commands: + * chanserv/set and chanserv/saset - Dummy help wrappers for the SET and SASET commands. + * chanserv/set/autoop - Used for configuring whether or not ChanServ automatically gives channel status to users. + * chanserv/set/bantype - Used for controlling what format bans are placed on channels. + * chanserv/set/description - Used for changing channels descriptions. + * chanserv/set/founder - Used for changing a channels founder. + * chanserv/set/keeptopic - Used for configuring if ChanServ is to restore the channel topic when a channel is created. + * chanserv/set/peace - Used for configuring if users are able to kick other users with higher access than them. + * chanserv/set/persist - Used for setting whether ChanServ should stay in channels after the last user leaves. + * chanserv/set/private - Used for setting whether channels should show up in chanserv/list. + * chanserv/set/restricted - Used for setting whether users not on a channel's access list can join. + * chanserv/set/secure - Used for setting whether users who are recognized for accounts should have their access in channels. + * chanserv/set/securefounder - Used for setting whether users with founder level access in channels have true founder or not. + * chanserv/set/secureops - Used for restricting who can have channel op privilege in a channel to those whom have access in the channel. + * chanserv/set/signkick - Used for setting signkick, which appends the kicker's name to kicks sent through ChanServ. + * chanserv/set/successor - Used for setting channel successors, which become channel founders if the founders account expires. + * chanserv/set/topiclock - Used for setting topiclock, which prevents channel topics from being modified. + * chanserv/saset/topiclock - Used for setting noexpire, which prevents channels from expiring. * * Is a dummy command to provide a help wrapper for the various SET commands. */ module { name = "cs_set" } -command { service = "ChanServ"; name = "SET"; command = "chanserv/set"; } -/* - * cs_saset - * - * Provides the command chanserv/saset. - * - * Is a dummy command to provide a help wrapper for the various SASET commands. - */ -module { name = "cs_saset" } +command { service = "ChanServ"; name = "SET"; command = "chanserv/set"; } command { service = "ChanServ"; name = "SASET"; command = "chanserv/saset"; permission = "chanserv/saset/"; } -/* - * cs_set_autoop - * - * Provides the command chanserv/set/autoop. - * - * Used for controlling whether or not ChanServ automatically gives channel status to users. - */ -module { name = "cs_set_autoop" } command { service = "ChanServ"; name = "SET AUTOOP"; command = "chanserv/set/autoop"; } command { service = "ChanServ"; name = "SASET AUTOOP"; command = "chanserv/set/autoop"; permission = "chanserv/saset/autoop"; } -/* - * cs_set_bantype - * - * Provides the command chanserv/set/bantype. - * - * Used for controlling what format bans are placed on channels. - */ -module { name = "cs_set_bantype" } command { service = "ChanServ"; name = "SET BANTYPE"; command = "chanserv/set/bantype"; } command { service = "ChanServ"; name = "SASET BANTYPE"; command = "chanserv/set/bantype"; permission = "chanserv/saset/bantype"; } -/* - * cs_set_description - * - * Provides the command chanserv/set/description. - * - * Used for changing channels descriptions. - */ -module { name = "cs_set_description" } command { service = "ChanServ"; name = "SET DESCRIPTION"; command = "chanserv/set/description"; } command { service = "ChanServ"; name = "SET DESC"; command = "chanserv/set/description"; } + command { service = "ChanServ"; name = "SASET DESCRIPTION"; command = "chanserv/set/description"; permission = "chanserv/saset/description"; } command { service = "ChanServ"; name = "SASET DESC"; command = "chanserv/set/description"; permission = "chanserv/saset/description"; } -/* - * cs_set_founder - * - * Provides the command chanserv/set/founder. - * - * Used for changing channel founders. - */ -module { name = "cs_set_founder" } command { service = "ChanServ"; name = "SET FOUNDER"; command = "chanserv/set/founder"; } command { service = "ChanServ"; name = "SASET FOUNDER"; command = "chanserv/set/founder"; permission = "chanserv/saset/founder"; } -/* - * cs_set_keeptopic - * - * Provides the command chanserv/set/keeptopic. - * - * Used for enabling keeptopic on channels, which causes ChanServ to restore the channel topic - * when a channel is created. - */ -module { name = "cs_set_keeptopic" } command { service = "ChanServ"; name = "SET KEEPTOPIC"; command = "chanserv/set/keeptopic"; } command { service = "ChanServ"; name = "SASET KEEPTOPIC"; command = "chanserv/set/keeptopic"; permission = "chanserv/saset/keeptopic"; } -/* - * cs_set_misc - * - * Provides the command chanserv/set/misc. - * - * Allows you to create arbitrary commands to set data, and have that data show up in chanserv/info. - */ -module { name = "cs_set_misc" } -command { service = "ChanServ"; name = "SET URL"; command = "chanserv/set/misc"; } -command { service = "ChanServ"; name = "SET EMAIL"; command = "chanserv/set/misc"; } - -/* - * cs_set_peace - * - * Provides the command chanserv/set/peace. - * - * Used for setting the peace option, which prevents users from kicking other users with - * higher level access than them. - */ -module { name = "cs_set_peace" } command { service = "ChanServ"; name = "SET PEACE"; command = "chanserv/set/peace"; } command { service = "ChanServ"; name = "SASET PEACE"; command = "chanserv/set/peace"; permission = "chanserv/saset/peace"; } -/* - * cs_set_persist - * - * Provides the command chanserv/set/persist. - * - * Used for setting whether ChanServ should stay in channels after the last user leaves. - */ -module { name = "cs_set_persist" } command { service = "ChanServ"; name = "SET PERSIST"; command = "chanserv/set/persist"; } command { service = "ChanServ"; name = "SASET PERSIST"; command = "chanserv/set/persist"; permission = "chanserv/saset/persist"; } -/* - * cs_set_private - * - * Provides the command chanserv/set/private. - * - * Used for setting whether channels should show up in chanserv/list. - */ -module { name = "cs_set_private" } command { service = "ChanServ"; name = "SET PRIVATE"; command = "chanserv/set/private"; } command { service = "ChanServ"; name = "SASET PRIVATE"; command = "chanserv/set/private"; permission = "chanserv/saset/private"; } -/* - * cs_set_restricted - * - * Provides the command chanserv/set/restricted. - * - * Used for setting whether users not on a channel's access list can join. - */ -module { name = "cs_set_restricted" } command { service = "ChanServ"; name = "SET RESTRICTED"; command = "chanserv/set/restricted"; } command { service = "ChanServ"; name = "SASET RESTRICTED"; command = "chanserv/set/restricted"; permission = "chanserv/saset/restricted"; } -/* - * cs_set_secure - * - * Provides the command chanserv/set/secure. - * - * Used for setting whether users who are recognized for accounts should have their access in channels. - */ -module { name = "cs_set_secure" } command { service = "ChanServ"; name = "SET SECURE"; command = "chanserv/set/secure"; } command { service = "ChanServ"; name = "SASET SECURE"; command = "chanserv/set/secure"; permission = "chanserv/saset/secure"; } -/* - * cs_set_securefounder - * - * Provides the command chanserv/set/securefounder. - * - * Used for setting whether users with founder level access in channels have true founder or not. - */ -module { name = "cs_set_securefounder" } command { service = "ChanServ"; name = "SET SECUREFOUNDER"; command = "chanserv/set/securefounder"; } command { service = "ChanServ"; name = "SASET SECUREFOUNDER"; command = "chanserv/set/securefounder"; permission = "chanserv/saset/securefounder"; } -/* - * cs_set_secureops - * - * Provides the command chanserv/set/secureops. - * - * Used for restricting who can have channel op privilege in a channel to those whom have access in the channel. - */ -module { name = "cs_set_secureops" } command { service = "ChanServ"; name = "SET SECUREOPS"; command = "chanserv/set/secureops"; } command { service = "ChanServ"; name = "SASET SECUREOPS"; command = "chanserv/set/secureops"; permission = "chanserv/saset/secureops"; } -/* - * cs_set_signkick - * - * Provides the command chanserv/set/signkick. - * - * Used for setting signkick, which appends the kicker's name to kicks sent through ChanServ. - */ -module { name = "cs_set_signkick" } command { service = "ChanServ"; name = "SET SIGNKICK"; command = "chanserv/set/signkick"; } command { service = "ChanServ"; name = "SASET SIGNKICK"; command = "chanserv/set/signkick"; permission = "chanserv/saset/signkick"; } -/* - * cs_set_successor - * - * Provides the command chanserv/set/successor. - * - * Used for setting channel successors, which become channel founders if the founders account expires. - */ -module { name = "cs_set_successor" } command { service = "ChanServ"; name = "SET SUCCESSOR"; command = "chanserv/set/successor"; } command { service = "ChanServ"; name = "SASET SUCCESSOR"; command = "chanserv/set/successor"; permission = "chanserv/saset/successor"; } -/* - * cs_set_topiclock - * - * Provides the command chanserv/set/topiclock. - * - * Used for setting topiclock, which prevents channel topics from being modified. - */ -module { name = "cs_set_topiclock" } command { service = "ChanServ"; name = "SET TOPICLOCK"; command = "chanserv/set/topiclock"; } command { service = "ChanServ"; name = "SASET TOPICLOCK"; command = "chanserv/set/topiclock"; permission = "chanserv/saset/topiclock"; } +command { service = "ChanServ"; name = "SASET NOEXPIRE"; command = "chanserv/saset/noexpire"; permission = "chanserv/saset/noexpire"; } + /* - * cs_set_noexpire + * cs_set_misc * - * Provides the command chanserv/saset/noexpire. + * Provides the command chanserv/set/misc. * - * Used for setting noexpire, which prevents channels from expiring. + * Allows you to create arbitrary commands to set data, and have that data show up in chanserv/info. */ -module { name = "cs_saset_noexpire" } -command { service = "ChanServ"; name = "SASET NOEXPIRE"; command = "chanserv/saset/noexpire"; permission = "chanserv/saset/noexpire"; } +module { name = "cs_set_misc" } +command { service = "ChanServ"; name = "SET URL"; command = "chanserv/set/misc"; } +command { service = "ChanServ"; name = "SET EMAIL"; command = "chanserv/set/misc"; } /* * cs_status @@ -1374,3 +1254,15 @@ command { service = "ChanServ"; name = "AOP"; command = "chanserv/aop"; } command { service = "ChanServ"; name = "HOP"; command = "chanserv/hop"; } command { service = "ChanServ"; name = "VOP"; command = "chanserv/vop"; } +/* + * Extra ChanServ related modules. + */ + +/* + * cs_statusupdate + * + * This module automatically updates users status on channels when the + * channel's access list is modified. + */ +module { name = "cs_statusupdate" } + diff --git a/data/modules.example.conf b/data/modules.example.conf index 7137975fa..24b80055b 100644 --- a/data/modules.example.conf +++ b/data/modules.example.conf @@ -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 * diff --git a/data/nickserv.example.conf b/data/nickserv.example.conf index cbd0734d6..c3606e36f 100644 --- a/data/nickserv.example.conf +++ b/data/nickserv.example.conf @@ -463,148 +463,66 @@ command { service = "NickServ"; name = "RESEND"; command = "nickserv/resend"; } module { name = "ns_resetpass" } command { service = "NickServ"; name = "RESETPASS"; command = "nickserv/resetpass"; } -/* - * ns_saset - * - * Provides commands nickserv/saset, nickserv/saset/password. - * - * Used as a help wrapper for SASET commands, and used to force change users password. - */ -module { name = "ns_saset" } -command { service = "NickServ"; name = "SASET"; command = "nickserv/saset"; permission = "nickserv/saset/" } -command { service = "NickServ"; name = "SASET PASSWORD"; command = "nickserv/saset/password"; permission = "nickserv/saset/password" } - -/* - * ns_saset_noexpire - * - * Provides the command nickserv/saset/noexpire. - * - * Used for configuring noexpire, which prevents nicks from expiring. - */ -module { name = "ns_saset_noexpire" } -command { service = "NickServ"; name = "SASET NOEXPIRE"; command = "nickserv/saset/noexpire"; permission = "nickserv/saset/noexpire" } - /* * ns_set * - * Provides the commands nickserv/set, nickserv/set/password. - * - * Used as a help wrapper for SET commands, and used for users to change their password. + * Provides the commands: + * nickserv/set, nickserv/saset - Dummy help wrappers for the SET and SASET commands. + * nickserv/set/autoop, nickserv/saset/autoop - Determines whether or not modes are automatically set users when joining a channel. + * nickserv/set/display, nickserv/saset/display - Used for setting a users display name. + * nickserv/set/email, nickserv/saset/email - Used for setting a users email address. + * nickserv/set/greet, nickserv/saset/greet - Used for changing a users greet message, which is displayed when they enter channels. + * nicksrev/set/hide, nickserv/saset/hide - Used for configuring which options are publically shown in nickserv/info for users account. + * nickserv/set/kill, nickserv/saset/kill - Used for configuring nickname protection. + * nickserv/set/language, nickserv/saset/language - Used for configuring what language services use. + * nickserv/set/message, nickserv/saset/message - Used to configure how services send messages to you. + * nickserv/set/password, nickserv/saset/password - Used for changing a users greet password. + * nickserv/set/private, nickserv/saset/privatee - Used for configuring whether or a users account shows up in nickserv/list. + * nickserv/set/secure, nickserv/saset/secure - Used for configuring whether a user can identify by simply being recognized by nickserv/access. + * nickserv/saset/noexpire - Used for configuring noexpire, which prevents nicks from expiring. + * + * Used as a help wrapper for the SET and SASET commands, and provides many other set commands. */ module { name = "ns_set" } + command { service = "NickServ"; name = "SET"; command = "nickserv/set"; } -command { service = "NickServ"; name = "SET PASSWORD"; command = "nickserv/set/password"; } +command { service = "NickServ"; name = "SASET"; command = "nickserv/saset"; permission = "nickserv/saset/" } -/* - * ns_set_autoop - * - * Provides the commands nickserv/set/autoop and nickserv/saset/autoop. - * - * Used for setting autoop, which determines whether or not modes are automatically set on you when joining a channel. - */ -module { name = "ns_set_autoop" } command { service = "NickServ"; name = "SET AUTOOP"; command = "nickserv/set/autoop"; } command { service = "NickServ"; name = "SASET AUTOOP"; command = "nickserv/saset/autoop"; permission = "nickserv/saset/autoop"; } -/* - * ns_set_display - * - * Provides the commands nickserv/set/display and nickserv/saset/display. - * - * Used for setting users display names. - */ -module { name = "ns_set_display" } command { service = "NickServ"; name = "SET DISPLAY"; command = "nickserv/set/display"; } command { service = "NickServ"; name = "SASET DISPLAY"; command = "nickserv/saset/display"; permission = "nickserv/saset/display"; } -/* - * ns_set_email - * - * Provides the commands nickserv/set/email and nickserv/saset/email. - * - * Used for setting users email addresses. - */ -module { name = "ns_set_email" } command { service = "NickServ"; name = "SET EMAIL"; command = "nickserv/set/email"; } command { service = "NickServ"; name = "SASET EMAIL"; command = "nickserv/saset/email"; permission = "nickserv/saset/email"; } -/* - * ns_set_greet - * - * Provides the commands nickserv/set/greet and nickserv/saset/greet. - * - * Used for changing users greet message, which is displayed when they enter channels. - */ -module { name = "ns_set_greet" } command { service = "NickServ"; name = "SET GREET"; command = "nickserv/set/greet"; } command { service = "NickServ"; name = "SASET GREET"; command = "nickserv/saset/greet"; permission = "nickserv/saset/greet"; } -/* - * ns_set_hide - * - * Provides the commands nickserv/set/hide and nickserv/saset/hide. - * - * Used for configuring which options are publically shown in nickserv/info for your account. - */ -module { name = "ns_set_hide" } command { service = "NickServ"; name = "SET HIDE"; command = "nickserv/set/hide"; } command { service = "NickServ"; name = "SASET HIDE"; command = "nickserv/saset/hide"; permission = "nickserv/saset/hide"; } -/* - * ns_set_kill - * - * Provides the commands nickserv/set/kill and nickserv/saset/kill. - * - * Used for configuring if and for how long other users are allowed to use your nick. - */ -module { name = "ns_set_kill" } command { service = "NickServ"; name = "SET KILL"; command = "nickserv/set/kill"; } command { service = "NickServ"; name = "SASET KILL"; command = "nickserv/saset/kill"; permission = "nickserv/saset/kill"; } -/* - * ns_set_language - * - * Provides the commands nickserv/set/language and nickserv/saset/language. - * - * Used for configuring what language services use when messaging you. - */ -module { name = "ns_set_language" } command { service = "NickServ"; name = "SET LANGUAGE"; command = "nickserv/set/language"; } command { service = "NickServ"; name = "SASET LANGUAGE"; command = "nickserv/saset/language"; permission = "nickserv/saset/language"; } -/* - * ns_set_message - * - * Provides the commands nickserv/set/message and nickserv/saset/message. - * - * Used to configure how services send messages to you. - */ -module { name = "ns_set_message" } command { service = "NickServ"; name = "SET MESSAGE"; command = "nickserv/set/message"; } command { service = "NickServ"; name = "SASET MESSAGE"; command = "nickserv/saset/message"; permission = "nickserv/saset/message"; } -/* - * ns_set_private - * - * Provides the commands nickserv/set/private and nickserv/saset/private. - * - * Used for configuring whether or not your account shows up in nickserv/list. - */ -module { name = "ns_set_private" } +command { service = "NickServ"; name = "SET PASSWORD"; command = "nickserv/set/password"; } +command { service = "NickServ"; name = "SASET PASSWORD"; command = "nickserv/saset/password"; permission = "nickserv/saset/password"; } + command { service = "NickServ"; name = "SET PRIVATE"; command = "nickserv/set/private"; } command { service = "NickServ"; name = "SASET PRIVATE"; command = "nickserv/saset/private"; permission = "nickserv/saset/private"; } -/* - * ns_set_secure - * - * Provides the commands nickserv/set/secure and nickserv/saset/secure. - * - * Used for configuring whether you can gain access to your nick by simply being recognized by nickserv/access. - */ -module { name = "ns_set_secure" } command { service = "NickServ"; name = "SET SECURE"; command = "nickserv/set/secure"; } command { service = "NickServ"; name = "SASET SECURE"; command = "nickserv/saset/secure"; permission = "nickserv/saset/secure"; } +command { service = "NickServ"; name = "SASET NOEXPIRE"; command = "nickserv/saset/noexpire"; permission = "nickserv/saset/noexpire" } + /* * ns_set_misc * @@ -614,7 +532,9 @@ command { service = "NickServ"; name = "SASET SECURE"; command = "nickserv/saset */ module { name = "ns_set_misc" } command { service = "NickServ"; name = "SET URL"; command = "nickserv/set/misc"; } -command { service = "NickServ"; name = "SET ICQ"; command = "nickserv/set/misc"; } +#command { service = "NickServ"; name = "SET ICQ"; command = "nickserv/set/misc"; } +#command { service = "NickServ"; name = "SET TWITTER"; command = "nickserv/set/misc"; } +#command { service = "NickServ"; name = "SET FACEBOOK"; command = "nickserv/set/misc"; } /* * ns_status @@ -647,3 +567,24 @@ command { service = "NickServ"; name = "UNSUSPEND"; command = "nickserv/unsuspen module { name = "ns_update" } command { service = "NickServ"; name = "UPDATE"; command = "nickserv/update"; } +/* + * Extra NickServ related modules. + */ + +/* + * 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 +} + diff --git a/modules/commands/bs_set.cpp b/modules/commands/bs_set.cpp index 6f458bec0..7d880c659 100644 --- a/modules/commands/bs_set.cpp +++ b/modules/commands/bs_set.cpp @@ -9,8 +9,6 @@ * Based on the original code of Services by Andy Church. */ -/*************************************************************************/ - #include "module.h" class CommandBSSet : public Command @@ -56,13 +54,375 @@ class CommandBSSet : public Command } }; +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 ¶ms) 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 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 ¶ms) 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 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 ¶ms) 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 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 ¶ms) 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 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 ¶ms) 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 (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 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 ¶ms) 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 (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 BSSet : public Module { CommandBSSet commandbsset; + CommandBSSetDontKickOps commandbssetdontkickops; + CommandBSSetDontKickVoices commandbssetdontkickvoices; + CommandBSSetFantasy commandbssetfantasy; + CommandBSSetNoBot commandbssetnobot; + CommandBSSetPrivate commandbssetprivate; public: BSSet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE), - commandbsset(this) + commandbsset(this), commandbssetdontkickops(this), commandbssetdontkickvoices(this), + commandbssetfantasy(this), commandbssetnobot(this), commandbssetprivate(this) { this->SetAuthor("Anope"); diff --git a/modules/commands/bs_set_dontkickops.cpp b/modules/commands/bs_set_dontkickops.cpp deleted file mode 100644 index 5346074a6..000000000 --- a/modules/commands/bs_set_dontkickops.cpp +++ /dev/null @@ -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 ¶ms) 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) diff --git a/modules/commands/bs_set_dontkickvoices.cpp b/modules/commands/bs_set_dontkickvoices.cpp deleted file mode 100644 index b4b0cd7ec..000000000 --- a/modules/commands/bs_set_dontkickvoices.cpp +++ /dev/null @@ -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 ¶ms) 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) diff --git a/modules/commands/bs_set_fantasy.cpp b/modules/commands/bs_set_fantasy.cpp deleted file mode 100644 index 29c722026..000000000 --- a/modules/commands/bs_set_fantasy.cpp +++ /dev/null @@ -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 ¶ms) 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) diff --git a/modules/commands/bs_set_greet.cpp b/modules/commands/bs_set_greet.cpp deleted file mode 100644 index ad5220203..000000000 --- a/modules/commands/bs_set_greet.cpp +++ /dev/null @@ -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 ¶ms) 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) diff --git a/modules/commands/bs_set_nobot.cpp b/modules/commands/bs_set_nobot.cpp deleted file mode 100644 index f3f749aa5..000000000 --- a/modules/commands/bs_set_nobot.cpp +++ /dev/null @@ -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 ¶ms) 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) diff --git a/modules/commands/bs_set_private.cpp b/modules/commands/bs_set_private.cpp deleted file mode 100644 index 920c97d37..000000000 --- a/modules/commands/bs_set_private.cpp +++ /dev/null @@ -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 ¶ms) 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) diff --git a/modules/commands/cs_saset.cpp b/modules/commands/cs_saset.cpp deleted file mode 100644 index 211148e13..000000000 --- a/modules/commands/cs_saset.cpp +++ /dev/null @@ -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 ¶ms) 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", 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) diff --git a/modules/commands/cs_saset_noexpire.cpp b/modules/commands/cs_saset_noexpire.cpp deleted file mode 100644 index 1c7b260ec..000000000 --- a/modules/commands/cs_saset_noexpire.cpp +++ /dev/null @@ -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 ¶ms) 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) diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp index 0ac07e2b2..ecd228877 100644 --- a/modules/commands/cs_set.cpp +++ b/modules/commands/cs_set.cpp @@ -9,8 +9,6 @@ * Based on the original code of Services by Andy Church. */ -/*************************************************************************/ - #include "module.h" class CommandCSSet : public Command @@ -57,16 +55,1190 @@ class CommandCSSet : public Command } }; -class CSSet : public Module +class CommandCSSASet : public Command { - CommandCSSet commandcsset; + 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 ¶ms) 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", 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 CommandCSSetAutoOp : public Command +{ p