summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-12-22 14:49:48 -0500
committerAdam <Adam@anope.org>2012-12-22 14:49:48 -0500
commitdc751bd2f10ab498352ee8a64d2c4b0dcac7c4ea (patch)
treee2652e8831fc1c77d5e46d58d8c4a236d0bc4fa5
parent0cde0aee34a658e8059106ee51641cac2f48d92a (diff)
Combine all of the set modules now that having them split apart is almost completely pointless
-rw-r--r--data/botserv.example.conf67
-rw-r--r--data/chanserv.example.conf188
-rw-r--r--data/modules.example.conf25
-rw-r--r--data/nickserv.example.conf153
-rw-r--r--modules/commands/bs_set.cpp366
-rw-r--r--modules/commands/bs_set_dontkickops.cpp90
-rw-r--r--modules/commands/bs_set_dontkickvoices.cpp90
-rw-r--r--modules/commands/bs_set_fantasy.cpp99
-rw-r--r--modules/commands/bs_set_greet.cpp92
-rw-r--r--modules/commands/bs_set_nobot.cpp87
-rw-r--r--modules/commands/bs_set_private.cpp78
-rw-r--r--modules/commands/cs_saset.cpp73
-rw-r--r--modules/commands/cs_saset_noexpire.cpp79
-rw-r--r--modules/commands/cs_set.cpp1178
-rw-r--r--modules/commands/cs_set_autoop.cpp85
-rw-r--r--modules/commands/cs_set_bantype.cpp91
-rw-r--r--modules/commands/cs_set_chanstats.cpp94
-rw-r--r--modules/commands/cs_set_description.cpp82
-rw-r--r--modules/commands/cs_set_founder.cpp97
-rw-r--r--modules/commands/cs_set_keeptopic.cpp87
-rw-r--r--modules/commands/cs_set_peace.cpp85
-rw-r--r--modules/commands/cs_set_persist.cpp177
-rw-r--r--modules/commands/cs_set_private.cpp86
-rw-r--r--modules/commands/cs_set_restricted.cpp84
-rw-r--r--modules/commands/cs_set_secure.cpp87
-rw-r--r--modules/commands/cs_set_securefounder.cpp87
-rw-r--r--modules/commands/cs_set_secureops.cpp85
-rw-r--r--modules/commands/cs_set_signkick.cpp97
-rw-r--r--modules/commands/cs_set_successor.cpp115
-rw-r--r--modules/commands/cs_set_topiclock.cpp85
-rw-r--r--modules/commands/ns_saset.cpp128
-rw-r--r--modules/commands/ns_saset_noexpire.cpp75
-rw-r--r--modules/commands/ns_set.cpp1315
-rw-r--r--modules/commands/ns_set_autoop.cpp110
-rw-r--r--modules/commands/ns_set_chanstats.cpp120
-rw-r--r--modules/commands/ns_set_display.cpp104
-rw-r--r--modules/commands/ns_set_email.cpp190
-rw-r--r--modules/commands/ns_set_greet.cpp111
-rw-r--r--modules/commands/ns_set_hide.cpp152
-rw-r--r--modules/commands/ns_set_kill.cpp154
-rw-r--r--modules/commands/ns_set_language.cpp132
-rw-r--r--modules/commands/ns_set_message.cpp123
-rw-r--r--modules/commands/ns_set_private.cpp117
-rw-r--r--modules/commands/ns_set_secure.cpp117
-rw-r--r--modules/extra/cs_statusupdate.cpp (renamed from modules/extra/m_statusupdate.cpp)0
-rw-r--r--modules/extra/ns_maxemail.cpp7
46 files changed, 2945 insertions, 4199 deletions
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
*
@@ -568,23 +560,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
*
* This module creates a web configuration panel that allows users and operators to perform any task
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
@@ -464,147 +464,65 @@ 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<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 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 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 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 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 (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<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 (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<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)
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<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)
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<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)
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<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)
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<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)
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<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)
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<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)
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<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)
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 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 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 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 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 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 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 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 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 CommandCSSetPersist : public Command
+{
+ public:
+ CommandCSSetPersist(Module *creator, const Anope::string &cname = "chanserv/set/persist") : Command(creator, cname, 2, 2)
+ {
+ this->SetDesc(_("Set the channel as permanent"));
+ 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;
+ }
+
+ ChannelMode *cm = ModeManager::FindChannelModeByName(CMODE_PERM);
+
+ if (params[1].equals_ci("ON"))
+ {
+ if (!ci->HasFlag(CI_PERSIST))
+ {
+ ci->SetFlag(CI_PERSIST);
+ if (ci->c)
+ ci->c->SetFlag(CH_PERSIST);
+
+ /* Channel doesn't exist, create it */
+ if (!ci->c)
+ {
+ Channel *c = new Channel(ci->name);
+ if (ci->bi)
+ ci->bi->Join(c);
+ }
+
+ /* No botserv bot, no channel mode, give them ChanServ.
+ * Yes, this works fine with no Config->BotServ.
+ */
+ if (!ci->bi && !cm)
+ {
+ if (!ChanServ)
+ {
+ source.Reply(_("ChanServ is required to enable persist on this network."));
+ return;
+ }
+ ChanServ->Assign(NULL, ci);
+ if (!ci->c->FindUser(ChanServ))
+ ChanServ->Join(ci->c);
+ }
+
+ /* Set the perm mode */
+ if (cm)
+ {
+ if (ci->c && !ci->c->HasMode(CMODE_PERM))
+ ci->c->SetMode(NULL, cm);
+ /* Add it to the channels mlock */
+ ci->SetMLock(cm, true);
+ }
+ }
+
+ source.Reply(_("Channel \002%s\002 is now persistent."), ci->name.c_str());
+ }
+ else if (params[1].equals_ci("OFF"))
+ {
+ if (ci->HasFlag(CI_PERSIST))
+ {
+ ci->UnsetFlag(CI_PERSIST);
+ if (ci->c)
+ ci->c->UnsetFlag(CH_PERSIST);
+
+ /* Unset perm mode */
+ if (cm)
+ {
+ if (ci->c && ci->c->HasMode(CMODE_PERM))
+ ci->c->RemoveMode(NULL, cm);
+ /* Remove from mlock */
+ ci->RemoveMLock(cm, true);
+ }
+
+ /* No channel mode, no BotServ, but using ChanServ as the botserv bot
+ * which was assigned when persist was set on
+ */
+ if (!cm && Config->BotServ.empty() && ci->bi)
+ {
+ if (!ChanServ)
+ {
+ source.Reply(_("ChanServ is required to enable persist on this network."));
+ return;
+ }
+ /* Unassign bot */
+ ChanServ->UnAssign(NULL, ci);
+ }
+ }
+
+ source.Reply(_("Channel \002%s\002 is no longer persistent."), ci->name.c_str());
+ }
+ else
+ this->OnSyntaxError(source, "PERSIST");
+
+ return;
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Enables or disables the persistent channel setting.\n"
+ "When persistent is set, the service bot will remain\n"
+ "in the channel when it has emptied of users.\n"
+ " \n"
+ "If your IRCd does not have a permanent (persistent) channel\n"
+ "mode you must have a service bot in your channel to\n"
+ "set persist on, and it can not be unassigned while persist\n"
+ "is on.\n"
+ " \n"
+ "If this network does not have BotServ enabled and does\n"
+ "not have a permanent channel mode, ChanServ will\n"
+ "join your channel when you set persist on (and leave when\n"
+ "it has been set off).\n"
+ " \n"
+ "If your IRCd has a permanent (persistent) channel mode\n"
+ "and it is set or unset (for any reason, including MODE LOCK),\n"
+ "persist is automatically set and unset for the channel aswell.\n"
+ "Additionally, services will set or unset this mode when you\n"
+ "set persist on or off."));
+ return true;
+ }
+};
+
+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 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 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 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 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 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 CommandCSSetSuccessor : public Command
+{
+ public:
+ CommandCSSetSuccessor(Module *creator, const Anope::string &cname = "chanserv/set/successor") : Command(creator, cname, 1, 2)
+ {
+ this->SetDesc(_("Set the successor for 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())
+ {
+ if (!source.AccessFor(ci).HasPriv("SET"))
+ {
+ source.Reply(ACCESS_DENIED);
+ return;
+ }
+
+ if (ci->HasFlag(CI_SECUREFOUNDER) ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER"))
+ {
+ source.Reply(ACCESS_DENIED);
+ return;
+ }
+ }
+
+ NickCore *nc;
+
+ if (params.size() > 1)
+ {
+ const NickAlias *na = NickAlias::Find(params[1]);
+
+ if (!na)
+ {
+ source.Reply(NICK_X_NOT_REGISTERED, params[1].c_str());
+ return;
+ }
+ if (na->nc == ci->GetFounder())
+ {
+ source.Reply(_("%s cannot be the successor on channel %s as they are the founder."), na->nick.c_str(), ci->name.c_str());
+ return;
+ }
+ nc = na->nc;
+ }
+ else
+ nc = NULL;
+
+ Log(!source.permission.empty() ? LOG_ADMIN : LOG_COMMAND, source, this, ci) << "to change the successor from " << (ci->successor ? ci->successor->display : "(none)") << " to " << (nc ? nc->display : "(none)");
+
+ ci->successor = nc;
+
+ if (nc)
+ source.Reply(_("Successor for \002%s\002 changed to \002%s\002."), ci->name.c_str(), nc->display.c_str());
+ else
+ source.Reply(_("Successor for \002%s\002 unset."), ci->name.c_str());
+
+ return;
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Changes the successor of a channel. If the founder's\n"
+ "nickname expires or is dropped while the channel is still\n"
+ "registered, the successor will become the new founder of the\n"
+ "channel. However, if the successor already has too many\n"
+ "channels registered (%d), the channel will be dropped\n"
+ "instead, just as if no successor had been set. The new\n"
+ "nickname must be a registered one."), Config->CSMaxReg);
+ return true;
+ }
+};
+
+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 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 CSSet : public Module
{
CommandCSSet commandcsset;
+ CommandCSSASet commandcssaset;
+ CommandCSSetAutoOp commandcssetautoop;
+ CommandCSSetBanType commandcssetbantype;
+ CommandCSSetChanstats commandcssetchanstats;
+ bool CSDefChanstats;
+ CommandCSSetDescription commandcssetdescription;
+ CommandCSSetFounder commandcssetfounder;
+ CommandCSSetKeepTopic commandcssetkeeptopic;
+ CommandCSSetPeace commandcssetpeace;
+ CommandCSSetPersist commandcssetpersist;
+ CommandCSSetPrivate commandcssetprivate;
+ CommandCSSetRestricted commandcssetrestricted;
+ CommandCSSetSecure commandcssetsecure;
+ CommandCSSetSecureFounder commandcssetsecurefounder;
+ CommandCSSetSecureOps commandcssetsecureops;
+ CommandCSSetSignKick commandcssetsignkick;
+ CommandCSSetSuccessor commandcssetsuccessor;
+ CommandCSSetTopicLock commandcssettopiclock;
+ CommandCSSASetNoexpire commandcssasetnoexpire;
public:
CSSet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
- commandcsset(this)
+ commandcsset(this), commandcssaset(this), commandcssetautoop(this), commandcssetbantype(this), commandcssetchanstats(this),
+ CSDefChanstats(false), commandcssetdescription(this), commandcssetfounder(this), commandcssetkeeptopic(this),
+ commandcssetpeace(this), commandcssetpersist(this), commandcssetprivate(this), commandcssetrestricted(this),
+ commandcssetsecure(this), commandcssetsecurefounder(this), commandcssetsecureops(this), commandcssetsignkick(this),
+ commandcssetsuccessor(this), commandcssettopiclock(this), commandcssasetnoexpire(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);
}
};
diff --git a/modules/commands/cs_set_autoop.cpp b/modules/commands/cs_set_autoop.cpp
deleted file mode 100644
index 0b00b151b..000000000
--- a/modules/commands/cs_set_autoop.cpp
+++ /dev/null
@@ -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)
diff --git a/modules/commands/cs_set_bantype.cpp b/modules/commands/cs_set_bantype.cpp
deleted file mode 100644
index e7dfc52ee..000000000
--- a/modules/commands/cs_set_bantype.cpp
+++ /dev/null
@@ -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)
diff --git a/modules/commands/cs_set_chanstats.cpp b/modules/commands/cs_set_chanstats.cpp
deleted file mode 100644
index 118387ee4..000000000
--- a/modules/commands/cs_set_chanstats.cpp
+++ /dev/null
@@ -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)
diff --git a/modules/commands/cs_set_description.cpp b/modules/commands/cs_set_description.cpp
deleted file mode 100644
index a5ad525ab..000000000
--- a/modules/commands/cs_set_description.cpp
+++ /dev/null
@@ -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)
diff --git a/modules/commands/cs_set_founder.cpp b/modules/commands/cs_set_founder.cpp
deleted file mode 100644
index 25b43d481..000000000
--- a/modules/commands/cs_set_founder.cpp
+++ /dev/null
@@ -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)
diff --git a/modules/commands/cs_set_keeptopic.cpp b/modules/commands/cs_set_keeptopic.cpp
deleted file mode 100644
index 24b3d4f03..000000000
--- a/modules/commands/cs_set_keeptopic.cpp
+++ /dev/null
@@ -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)
diff --git a/modules/commands/cs_set_peace.cpp b/modules/commands/cs_set_peace.cpp
deleted file mode 100644
index 35459b59b..000000000
--- a/modules/commands/cs_set_peace.cpp
+++ /dev/null
@@ -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)
diff --git a/modules/commands/cs_set_persist.cpp b/modules/commands/cs_set_persist.cpp
deleted file mode 100644
index 03e5d3a84..000000000
--- a/modules/commands/cs_set_persist.cpp
+++ /dev/null
@@ -1,177 +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 CommandCSSetPersist : public Command
-{
- public:
- CommandCSSetPersist(Module *creator, const Anope::string &cname = "chanserv/set/persist") : Command(creator, cname, 2, 2)
- {
- this->SetDesc(_("Set the channel as permanent"));
- 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;
- }
-
- ChannelMode *cm = ModeManager::FindChannelModeByName(CMODE_PERM);
-
- if (params[1].equals_ci("ON"))
- {
- if (!ci->HasFlag(CI_PERSIST))
- {
- ci->SetFlag(CI_PERSIST);
- if (ci->c)
- ci->c->SetFlag(CH_PERSIST);
-
- /* Channel doesn't exist, create it */
- if (!ci->c)
- {
- Channel *c = new Channel(ci->name);
- if (ci->bi)
- ci->bi->Join(c);
- }
-
- /* No botserv bot, no channel mode, give them ChanServ.
- * Yes, this works fine with no Config->BotServ.
- */
- if (!ci->bi && !cm)
- {
- if (!ChanServ)
- {
- source.Reply(_("ChanServ is required to enable persist on this network."));
- return;
- }
- ChanServ->Assign(NULL, ci);
- if (!ci->c->FindUser(ChanServ))
- ChanServ->Join(ci->c);
- }
-
- /* Set the perm mode */
- if (cm)
- {
- if (ci->c && !ci->c->HasMode(CMODE_PERM))
- ci->c->SetMode(NULL, cm);
- /* Add it to the channels mlock */
- ci->SetMLock(cm, true);
- }
- }
-
- source.Reply(_("Channel \002%s\002 is now persistent."), ci->name.c_str());
- }
- else if (params[1].equals_ci("OFF"))
- {
- if (ci->HasFlag(CI_PERSIST))
- {
- ci->UnsetFlag(CI_PERSIST);
- if (ci->c)
- ci->c->UnsetFlag(CH_PERSIST);
-
- /* Unset perm mode */
- if (cm)
- {
- if (ci->c && ci->c->HasMode(CMODE_PERM))
- ci->c->RemoveMode(NULL, cm);
- /* Remove from mlock */
- ci->RemoveMLock(cm, true);
- }
-
- /* No channel mode, no BotServ, but using ChanServ as the botserv bot
- * which was assigned when persist was set on
- */
- if (!cm && Config->BotServ.empty() && ci->bi)
- {
- if (!ChanServ)
- {
- source.Reply(_("ChanServ is required to enable persist on this network."));
- return;
- }
- /* Unassign bot */
- ChanServ->UnAssign(NULL, ci);
- }
- }
-
- source.Reply(_("Channel \002%s\002 is no longer persistent."), ci->name.c_str());
- }
- else
- this->OnSyntaxError(source, "PERSIST");
-
- return;
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Enables or disables the persistent channel setting.\n"
- "When persistent is set, the service bot will remain\n"
- "in the channel when it has emptied of users.\n"
- " \n"
- "If your IRCd does not have a permanent (persistent) channel\n"
- "mode you must have a service bot in your channel to\n"
- "set persist on, and it can not be unassigned while persist\n"
- "is on.\n"
- " \n"
- "If this network does not have BotServ enabled and does\n"
- "not have a permanent channel mode, ChanServ will\n"
- "join your channel when you set persist on (and leave when\n"
- "it has been set off).\n"
- " \n"
- "If your IRCd has a permanent (persistent) channel mode\n"
- "and it is set or unset (for any reason, including MODE LOCK),\n"
- "persist is automatically set and unset for the channel aswell.\n"
- "Additionally, services will set or unset this mode when you\n"
- "set persist on or off."));
- return true;
- }
-};
-
-class CSSetPersist : public Module
-{
- CommandCSSetPersist commandcssetpeace;
-
- public:
- CSSetPersist(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
- commandcssetpeace(this)
- {
- this->SetAuthor("Anope");
-
- ModuleManager::Attach(I_OnDelChan, this);
- }
-
- void OnDelChan(ChannelInfo *ci) anope_override
- {
- if (ci->c && ci->HasFlag(CI_PERSIST))
- ci->c->RemoveMode(NULL, CMODE_PERM, "", false);
- }
-};
-
-MODULE_INIT(CSSetPersist)
diff --git a/modules/commands/cs_set_private.cpp b/modules/commands/cs_set_private.cpp
deleted file mode 100644
index a677aaf38..000000000
--- a/modules/commands/cs_set_private.cpp
+++ /dev/null
@@ -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)
diff --git a/modules/commands/cs_set_restricted.cpp b/modules/commands/cs_set_restricted.cpp
deleted file mode 100644
index 45a9b188e..000000000
--- a/modules/commands/cs_set_restricted.cpp
+++ /dev/null
@@ -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)
diff --git a/modules/commands/cs_set_secure.cpp b/modules/commands/cs_set_secure.cpp
deleted file mode 100644
index 7659c8674..000000000
--- a/modules/commands/cs_set_secure.cpp
+++ /dev/null
@@ -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)
diff --git a/modules/commands/cs_set_securefounder.cpp b/modules/commands/cs_set_securefounder.cpp
deleted file mode 100644
index d3d22f294..000000000
--- a/modules/commands/cs_set_securefounder.cpp
+++ /dev/null
@@ -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)
diff --git a/modules/commands/cs_set_secureops.cpp b/modules/commands/cs_set_secureops.cpp
deleted file mode 100644
index 9a95735be..000000000
--- a/modules/commands/cs_set_secureops.cpp
+++ /dev/null
@@ -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)
diff --git a/modules/commands/cs_set_signkick.cpp b/modules/commands/cs_set_signkick.cpp
deleted file mode 100644
index f3b482a67..000000000
--- a/modules/commands/cs_set_signkick.cpp
+++ /dev/null
@@ -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)
diff --git a/modules/commands/cs_set_successor.cpp b/modules/commands/cs_set_successor.cpp
deleted file mode 100644
index 8b36d6853..000000000
--- a/modules/commands/cs_set_successor.cpp
+++ /dev/null
@@ -1,115 +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 CommandCSSetSuccessor : public Command
-{
- public:
- CommandCSSetSuccessor(Module *creator, const Anope::string &cname = "chanserv/set/successor") : Command(creator, cname, 1, 2)
- {
- this->SetDesc(_("Set the successor for 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())
- {
- if (!source.AccessFor(ci).HasPriv("SET"))
- {
- source.Reply(ACCESS_DENIED);
- return;
- }
-
- if (ci->HasFlag(CI_SECUREFOUNDER) ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER"))
- {
- source.Reply(ACCESS_DENIED);
- return;
- }
- }
-
- NickCore *nc;
-
- if (params.size() > 1)
- {
- const NickAlias *na = NickAlias::Find(params[1]);
-
- if (!na)
- {
- source.Reply(NICK_X_NOT_REGISTERED, params[1].c_str());
- return;
- }
- if (na->nc == ci->GetFounder())
- {
- source.Reply(_("%s cannot be the successor on channel %s as they are the founder."), na->nick.c_str(), ci->name.c_str());
- return;
- }
- nc = na->nc;
- }
- else
- nc = NULL;
-
- Log(!source.permission.empty() ? LOG_ADMIN : LOG_COMMAND, source, this, ci) << "to change the successor from " << (ci->successor ? ci->successor->display : "(none)") << " to " << (nc ? nc->display : "(none)");
-
- ci->successor = nc;
-
- if (nc)
- source.Reply(_("Successor for \002%s\002 changed to \002%s\002."), ci->name.c_str(), nc->display.c_str());
- else
- source.Reply(_("Successor for \002%s\002 unset."), ci->name.c_str());
-
- return;
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Changes the successor of a channel. If the founder's\n"
- "nickname expires or is dropped while the channel is still\n"
- "registered, the successor will become the new founder of the\n"
- "channel. However, if the successor already has too many\n"
- "channels registered (%d), the channel will be dropped\n"
- "instead, just as if no successor had been set. The new\n"
- "nickname must be a registered one."), Config->CSMaxReg);
- return true;
- }
-};
-
-class CSSetSuccessor : public Module
-{
- CommandCSSetSuccessor commandcssetsuccessor;
-
- public:
- CSSetSuccessor(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
- commandcssetsuccessor(this)
- {
- this->SetAuthor("Anope");
-
- }
-};
-
-MODULE_INIT(CSSetSuccessor)
diff --git a/modules/commands/cs_set_topiclock.cpp b/modules/commands/cs_set_topiclock.cpp
deleted file mode 100644
index 9212d291d..000000000
--- a/modules/commands/cs_set_topiclock.cpp
+++ /dev/null
@@ -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)
diff --git a/modules/commands/ns_saset.cpp b/modules/commands/ns_saset.cpp
deleted file mode 100644
index ac3cb1d8f..000000000
--- a/modules/commands/ns_saset.cpp
+++ /dev/null
@@ -1,128 +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 CommandNSSASet : public Command
-{
- public:
- CommandNSSASet(Module *creator) : Command(creator, "nickserv/saset", 2, 4)
- {
- this->SetDesc(_("Set SET-options on another nickname"));
- this->SetSyntax(_("\037option\037 \037nickname\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(_("Sets various nickname options. \037option\037 can be one of:"));
- 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 = c_name;
- command->OnServHelp(source);
- }
- }
- }
- source.Reply(_("Type \002%s%s HELP SASET \037option\037\002 for more information\n"
- "on a specific option. The options will be set on the given\n"
- "\037nickname\037."), Config->UseStrictPrivMsgString.c_str(), Config->NickServ.c_str());
- return true;
- }
-};
-
-class CommandNSSASetPassword : public Command
-{
- public:
- CommandNSSASetPassword(Module *creator) : Command(creator, "nickserv/saset/password", 2, 2)
- {
- this->SetDesc(_("Set the nickname password"));
- this->SetSyntax(_("\037nickname\037 \037new-password\037"));
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- const NickAlias *setter_na = NickAlias::Find(params[0]);
- if (setter_na == NULL)
- {
- source.Reply(NICK_X_NOT_REGISTERED, params[0].c_str());
- return;
- }
- NickCore *nc = setter_na->nc;
-
- size_t len = params[1].length();
-
- if (Config->NSSecureAdmins && source.nc != nc && nc->IsServicesOper())
- {
- source.Reply(_("You may not change the password of other services operators."));
- return;
- }
- else if (nc->display.equals_ci(params[1]) || (Config->StrictPasswords && len < 5))
- {
- source.Reply(MORE_OBSCURE_PASSWORD);
- return;
- }
- else if (len > Config->PassLen)
- {
- source.Reply(PASSWORD_TOO_LONG);
- return;
- }
-
- Anope::Encrypt(params[1], nc->pass);
- Anope::string tmp_pass;
- if (Anope::Decrypt(nc->pass, tmp_pass) == 1)
- source.Reply(_("Password for \002%s\002 changed to \002%s\002."), nc->display.c_str(), tmp_pass.c_str());
- else
- source.Reply(_("Password for \002%s\002 changed."), nc->display.c_str());
-
- return;
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Changes the password used to identify as the nick's owner."));
- return true;
- }
-};
-
-class NSSASet : public Module
-{
- CommandNSSASet commandnssaset;
- CommandNSSASetPassword commandnssasetpassword;
-
- public:
- NSSASet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
- commandnssaset(this), commandnssasetpassword(this)
- {
- this->SetAuthor("Anope");
-
- }
-};
-
-MODULE_INIT(NSSASet)
diff --git a/modules/commands/ns_saset_noexpire.cpp b/modules/commands/ns_saset_noexpire.cpp
deleted file mode 100644
index ea3e946ae..000000000
--- a/modules/commands/ns_saset_noexpire.cpp
+++ /dev/null
@@ -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)
diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp
index bc6a67b35..9abe8a0f5 100644
--- a/modules/commands/ns_set.cpp
+++ b/modules/commands/ns_set.cpp
@@ -9,8 +9,6 @@
* Based on the original code of Services by Andy Church.
*/
-/*************************************************************************/
-
#include "module.h"
class CommandNSSet : public Command
@@ -33,6 +31,7 @@ class CommandNSSet : public Command
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Sets various nickname options. \037option\037 can be one of:"));
+
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)
{
@@ -49,8 +48,52 @@ class CommandNSSet : public Command
}
}
}
+
source.Reply(_("Type \002%s%s HELP %s \037option\037\002 for more information\n"
- "on a specific option."), Config->UseStrictPrivMsgString.c_str(), source.service->nick.c_str(), source.command.c_str());
+ "on a specific option."), Config->UseStrictPrivMsgString.c_str(), source.service->nick.c_str(), source.command.c_str());
+
+ return true;
+ }
+};
+
+class CommandNSSASet : public Command
+{
+ public:
+ CommandNSSASet(Module *creator) : Command(creator, "nickserv/saset", 2, 4)
+ {
+ this->SetDesc(_("Set SET-options on another nickname"));
+ this->SetSyntax(_("\037option\037 \037nickname\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(_("Sets various nickname options. \037option\037 can be one of:"));
+ 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 = c_name;
+ command->OnServHelp(source);
+ }
+ }
+ }
+ source.Reply(_("Type \002%s%s HELP SASET \037option\037\002 for more information\n"
+ "on a specific option. The options will be set on the given\n"
+ "\037nickname\037."), Config->UseStrictPrivMsgString.c_str(), Config->NickServ.c_str());
return true;
}
};
@@ -66,7 +109,6 @@ class CommandNSSetPassword : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
-
const Anope::string &param = params[1];
unsigned len = param.length();
@@ -87,6 +129,61 @@ class CommandNSSetPassword : public Command
source.Reply(_("Password for \002%s\002 changed to \002%s\002."), source.nc->display.c_str(), tmp_pass.c_str());
else
source.Reply(_("Password for \002%s\002 changed."), source.nc->display.c_str());
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Changes the password used to identify you as the nick's\n"
+ "owner."));
+ return true;
+ }
+};
+
+class CommandNSSASetPassword : public Command
+{
+ public:
+ CommandNSSASetPassword(Module *creator) : Command(creator, "nickserv/saset/password", 2, 2)
+ {
+ this->SetDesc(_("Set the nickname password"));
+ this->SetSyntax(_("\037nickname\037 \037new-password\037"));
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ const NickAlias *setter_na = NickAlias::Find(params[0]);
+ if (setter_na == NULL)
+ {
+ source.Reply(NICK_X_NOT_REGISTERED, params[0].c_str());
+ return;
+ }
+ NickCore *nc = setter_na->nc;
+
+ size_t len = params[1].length();
+
+ if (Config->NSSecureAdmins && source.nc != nc && nc->IsServicesOper())
+ {
+ source.Reply(_("You may not change the password of other services operators."));
+ return;
+ }
+ else if (nc->display.equals_ci(params[1]) || (Config->StrictPasswords && len < 5))
+ {
+ source.Reply(MORE_OBSCURE_PASSWORD);
+ return;
+ }
+ else if (len > Config->PassLen)
+ {
+ source.Reply(PASSWORD_TOO_LONG);
+ return;
+ }
+
+ Anope::Encrypt(params[1], nc->pass);
+ Anope::string tmp_pass;
+ if (Anope::Decrypt(nc->pass, tmp_pass) == 1)
+ source.Reply(_("Password for \002%s\002 changed to \002%s\002."), nc->display.c_str(), tmp_pass.c_str());
+ else
+ source.Reply(_("Password for \002%s\002 changed."), nc->display.c_str());
return;
}
@@ -95,8 +192,1120 @@ class CommandNSSetPassword : public Command
{
this->SendSyntax(source);
source.Reply(" ");
- source.Reply(_("Changes the password used to identify you as the nick's\n"
- "owner."));
+ source.Reply(_("Changes the password used to identify as the nick's owner."));
+ return true;
+ }
+};
+
+class CommandNSSetAutoOp : public Command
+{
+ public:
+ CommandNSSetAutoOp(Module *creator, const Anope::string &sname = "nickserv/set/autoop", size_t min = 1) : Command(creator, sname, min, min + 1)
+ {
+ this->SetDesc(_("Should services op you automatically."));
+ this->SetSyntax(_("{ON | OFF}"));
+ }
+
+ void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
+ {
+ const NickAlias *na = NickAlias::Find(user);
+ if (na == NULL)
+ {
+ source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
+ return;
+ }
+ NickCore *nc = na->nc;
+
+ EventReturn MOD_RESULT;
+ FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param));
+ if (MOD_RESULT == EVENT_STOP)
+ return;
+
+ if (param.equals_ci("ON"))
+ {
+ nc->SetFlag(NI_AUTOOP);
+ source.Reply(_("Services will now autoop %s in channels."), nc->display.c_str());
+ }
+ else if (param.equals_ci("OFF"))
+ {
+ nc->UnsetFlag(NI_AUTOOP);
+ source.Reply(_("Services will no longer autoop %s in channels."), nc->display.c_str());
+ }
+ else
+ this->OnSyntaxError(source, "AUTOOP");
+
+ return;
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->Run(source, source.nc->display, params[0]);
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Sets whether you will be opped automatically. Set to ON to \n"
+ "allow ChanServ to op you automatically when entering channels."));
+ return true;
+ }
+};
+
+class CommandNSSASetAutoOp : public CommandNSSetAutoOp
+{
+ public:
+ CommandNSSASetAutoOp(Module *creator) : CommandNSSetAutoOp(creator, "nickserv/saset/autoop", 2)
+ {
+ this->ClearSyntax();
+ this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->Run(source, params[0], params[1]);
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Sets whether the given nickname will be opped automatically.\n"
+ "Set to \002ON\002 to allow ChanServ to op the given nickname \n"
+ "omatically when joining channels."));
+ return true;
+ }
+};
+
+class CommandNSSetChanstats : public Command
+{
+ public:
+ CommandNSSetChanstats(Module *creator, const Anope::string &sname = "nickserv/set/chanstats", size_t min = 1 ) : Command(creator, sname, min, min + 1)
+ {
+ this->SetDesc(_("Turn chanstat statistic on or off"));
+ this->SetSyntax(_("{ON | OFF}"));
+ }
+ void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
+ {
+ NickAlias *na = NickAlias::Find(user);
+ if (!na)
+ {
+ source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
+ return;
+ }
+
+ EventReturn MOD_RESULT;
+ FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, na->nc, param));
+ if (MOD_RESULT == EVENT_STOP)
+ return;
+
+ if (param.equals_ci("ON"))
+ {
+ na->nc->SetFlag(NI_STATS);
+ source.Reply(_("Chanstat statistics are now enabled for your nick"));
+ }
+ else if (param.equals_ci("OFF"))
+ {
+ na->nc->UnsetFlag(NI_STATS);
+ source.Reply(_("Chanstat statistics are now disabled for your nick"));
+ }
+ else
+ this->OnSyntaxError(source, "CHANSTATS");
+
+ return;
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->Run(source, source.nc->display, params[0]);
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Turns Chanstats statistics ON or OFF"));
+ return true;
+ }
+};
+
+class CommandNSSASetChanstats : public CommandNSSetChanstats
+{
+ public:
+ CommandNSSASetChanstats(Module *creator) : CommandNSSetChanstats(creator, "nickserv/saset/chanstats", 2)
+ {
+ this->ClearSyntax();
+ this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->Run(source, params[0], params[1]);
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Turns chanstats channel statistics ON or OFF for this user"));
+ return true;
+ }
+};
+
+class CommandNSSetDisplay : public Command
+{
+ public:
+ CommandNSSetDisplay(Module *creator, const Anope::string &sname = "nickserv/set/display", size_t min = 1) : Command(creator, sname, min, min + 1)
+ {
+ this->SetDesc(_("Set the display of your group in Services"));
+ this->SetSyntax(_("\037new-display\037"));
+ }
+
+ void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
+ {
+ const NickAlias *user_na = NickAlias::Find(user), *na = NickAlias::Find(param);
+
+ if (!Config->NoNicknameOwnership)
+ {
+ source.Reply(_("This command may not be used on this network because nickname ownership is disabled."));
+ return;
+ }
+ if (user_na == NULL)
+ {
+ source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
+ return;
+ }
+ else if (!na || *na->nc != *user_na->nc)
+ {
+ source.Reply(_("The new display MUST be a nickname of the nickname group %s"), user_na->nc->display.c_str());
+ return;
+ }
+
+ EventReturn MOD_RESULT;
+ FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, user_na->nc, param));
+ if (MOD_RESULT == EVENT_STOP)
+ return;
+
+ user_na->nc->SetDisplay(na);
+ source.Reply(NICK_SET_DISPLAY_CHANGED, user_na->nc->display.c_str());
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->Run(source, source.nc->display, params[0]);
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Changes the display used to refer to your nickname group in \n"
+ "Services. The new display MUST be a nick of your group."));
+ return true;
+ }
+};
+
+class CommandNSSASetDisplay : public CommandNSSetDisplay
+{
+ public:
+ CommandNSSASetDisplay(Module *creator) : CommandNSSetDisplay(creator, "nickserv/saset/display", 2)
+ {
+ this->ClearSyntax();
+ this->SetSyntax(_("\037nickname\037 \037new-display\037"));
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->Run(source, params[0], params[1]);
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Changes the display used to refer to the nickname group in \n"
+ "Services. The new display MUST be a nick of your group."));
+ return true;
+ }
+};
+
+class CommandNSSetEmail : public Command
+{
+ static bool SendConfirmMail(User *u, const BotInfo *bi)
+ {
+ int chars[] = {
+ ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
+ 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y',
+ 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
+ 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y',
+ 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'
+ };
+ int idx, min = 1, max = 62;
+ Anope::string code;
+ for (idx = 0; idx < 9; ++idx)
+ code += chars[1 + static_cast<int>((static_cast<float>(max - min)) * static_cast<uint16_t>(rand()) / 65536.0) + min];
+
+ u->Account()->Extend("ns_set_email_passcode", new ExtensibleItemClass<Anope::string>(code));
+
+ Anope::string subject = Config->MailEmailchangeSubject;
+ Anope::string message = Config->MailEmailchangeMessage;
+
+ subject = subject.replace_all_cs("%e", u->Account()->email);
+ subject = subject.replace_all_cs("%N", Config->NetworkName);
+ subject = subject.replace_all_cs("%c", code);
+
+ message = message.replace_all_cs("%e", u->Account()->email);
+ message = message.replace_all_cs("%N", Config->NetworkName);
+ message = message.replace_all_cs("%c", code);
+
+ return Mail::Send(u, u->Account(), bi, subject, message);
+ }
+
+ public:
+ CommandNSSetEmail(Module *creator, const Anope::string &cname = "nickserv/set/email", size_t min = 0) : Command(creator, cname, min, min + 1)
+ {
+ this->SetDesc(_("Associate an E-mail address with your nickname"));
+ this->SetSyntax(_("\037address\037"));
+ }
+
+ void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
+ {
+ const NickAlias *na = NickAlias::Find(user);
+ if (!na)
+ {
+ source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
+ return;
+ }
+ NickCore *nc = na->nc;
+
+ if (param.empty() && Config->NSForceEmail)
+ {
+ source.Reply(_("You cannot unset the e-mail on this network."));
+ return;
+ }
+ else if (Config->NSSecureAdmins && source.nc != nc && nc->IsServicesOper())
+ {
+ source.Reply(_("You may not change the email of other services operators."));
+ return;
+ }
+ else if (!param.empty() && !Mail::Validate(param))
+ {
+ source.Reply(MAIL_X_INVALID, param.c_str());
+ return;
+ }
+
+ EventReturn MOD_RESULT;
+ FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param));
+ if (MOD_RESULT == EVENT_STOP)
+ return;
+
+ if (!param.empty() && Config->NSConfirmEmailChanges && !source.IsServicesOper())
+ {
+ source.nc->Extend("ns_set_email", new ExtensibleItemClass<Anope::string>(param));
+ Anope::string old = source.nc->email;
+ source.nc->email = param;
+ if (SendConfirmMail(source.GetUser(), source.service))
+ source.Reply(_("A confirmation email has been sent to \002%s\002. Follow the instructions in it to change your email address."), param.c_str());
+ source.nc->email = old;
+ }
+ else
+ {
+ if (!param.empty())
+ {
+ nc->email = param;
+ source.Reply(_("E-mail address for \002%s\002 changed to \002%s\002."), nc->display.c_str(), param.c_str());
+ }
+ else
+ {
+ nc->email.clear();
+ source.Reply(_("E-mail address for \002%s\002 unset."), nc->display.c_str());
+ }
+ }
+
+ return;
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->Run(source, source.nc->display, params.size() ? params[0] : "");
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Associates the given E-mail address with your nickname.\n"
+ "This address will be displayed whenever someone requests\n"
+ "information on the nickname with the \002INFO\002 command."));
+ return true;
+ }
+};
+
+class CommandNSSASetEmail : public CommandNSSetEmail
+{
+ public:
+ CommandNSSASetEmail(Module *creator) : CommandNSSetEmail(creator, "nickserv/saset/email", 2)
+ {
+ this->ClearSyntax();
+ this->SetSyntax(_("\037nickname\037 \037address\037"));
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->Run(source, params[0], params.size() > 1 ? params[1] : "");
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Associates the given E-mail address with the nickname."));
+ return true;
+ }
+};
+
+class CommandNSSetGreet : public Command
+{
+ public:
+ CommandNSSetGreet(Module *creator, const Anope::string &sname = "nickserv/set/greet", size_t min = 0) : Command(creator, sname, min, min + 1)
+ {
+ this->SetDesc(_("Associate a greet message with your nickname"));
+ this->SetSyntax(_("\037message\037"));
+ }
+
+ void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
+ {
+ const NickAlias *na = NickAlias::Find(user);
+ if (!na)
+ {
+ source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
+ return;
+ }
+ NickCore *nc = na->nc;
+
+ EventReturn MOD_RESULT;
+ FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param));
+ if (MOD_RESULT == EVENT_STOP)
+ return;
+
+ if (!param.empty())
+ {
+ nc->greet = param;
+ source.Reply(_("Greet message for \002%s\002 changed to \002%s\002."), nc->display.c_str(), nc->greet.c_str());
+ }
+ else
+ {
+ nc->greet.clear();
+ source.Reply(_("Greet message for \002%s\002 unset."), nc->display.c_str());
+ }
+
+ return;
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->Run(source, source.nc->display, params.size() > 0 ? params[0] : "");
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Makes the given message the greet of your nickname, that\n"
+ "will be displayed when joining a channel that has GREET\n"
+ "option enabled, provided that you have the necessary \n"
+ "access on it."));
+ return true;
+ }
+};
+
+class CommandNSSASetGreet : public CommandNSSetGreet
+{
+ public:
+ CommandNSSASetGreet(Module *creator) : CommandNSSetGreet(creator, "nickserv/saset/greet", 1)
+ {
+ this->ClearSyntax();
+ this->SetSyntax(_("\037nickname\037 \037message\037"));
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->Run(source, params[0], params.size() > 1 ? params[1] : "");
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Makes the given message the greet of the nickname, that\n"
+ "will be displayed when joining a channel that has GREET\n"
+ "option enabled, provided that the user has the necessary \n"
+ "access on it."));
+ return true;
+ }
+};
+
+class CommandNSSetHide : public Command
+{
+ public:
+ CommandNSSetHide(Module *creator, const Anope::string &sname = "nickserv/set/hide", size_t min = 2) : Command(creator, sname, min, min + 1)
+ {
+ this->SetDesc(_("Hide certain pieces of nickname information"));
+ this->SetSyntax(_("{EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}"));
+ }
+
+ void Run(CommandSource &source, const Anope::string &user, const Anope::string &param, const Anope::string &arg)
+ {
+ const NickAlias *na = NickAlias::Find(user);
+ if (!na)
+ {
+ source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
+ return;
+ }
+ NickCore *nc = na->nc;
+
+ EventReturn MOD_RESULT;
+ FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param));
+ if (MOD_RESULT == EVENT_STOP)
+ return;
+
+ Anope::string onmsg, offmsg;
+ NickCoreFlag flag;
+
+ if (param.equals_ci("EMAIL"))
+ {
+ flag = NI_HIDE_EMAIL;
+ onmsg = _("The E-mail address of \002%s\002 will now be hidden from %s INFO displays.");
+ offmsg = _("The E-mail address of \002%s\002 will now be shown in %s INFO displays.");
+ }
+ else if (param.equals_ci("USERMASK"))
+ {
+ flag = NI_HIDE_MASK;
+ onmsg = _("The last seen user@host mask of \002%s\002 will now be hidden from %s INFO displays.");
+ offmsg = _("The last seen user@host mask of \002%s\002 will now be shown in %s INFO displays.");
+ }
+ else if (param.equals_ci("STATUS"))
+ {
+ flag = NI_HIDE_STATUS;
+ onmsg = _("The services access status of \002%s\002 will now be hidden from %s INFO displays.");
+ offmsg = _("The services access status of \002%s\002 will now be shown in %s INFO displays.");
+ }
+ else if (param.equals_ci("QUIT"))
+ {
+ flag = NI_HIDE_QUIT;
+ onmsg = _("The last quit message of \002%s\002 will now be hidden from %s INFO displays.");
+ offmsg = _("The last quit message of \002%s\002 will now be shown in %s INFO displays.");
+ }
+ else
+ {
+ this->OnSyntaxError(source, "HIDE");
+ return;
+ }
+
+ if (arg.equals_ci("ON"))
+ {
+ nc->SetFlag(flag);
+ source.Reply(onmsg.c_str(), nc->display.c_str(), Config->NickServ.c_str());
+ }
+ else if (arg.equals_ci("OFF"))
+ {
+ nc->UnsetFlag(flag);
+ source.Reply(offmsg.c_str(), nc->display.c_str(), Config->NickServ.c_str());
+ }
+ else
+ this->OnSyntaxError(source, "HIDE");
+
+ return;
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->Run(source, source.nc->display, params[0], params[1]);
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Allows you to prevent certain pieces of information from\n"
+ "being displayed when someone does a %s \002INFO\002 on your\n"
+ "nick. You can hide your E-mail address (\002EMAIL\002), last seen\n"
+ "user@host mask (\002USERMASK\002), your services access status\n"
+ "(\002STATUS\002) and last quit message (\002QUIT\002).\n"
+ "The second parameter specifies whether the information should\n"
+ "be displayed (\002OFF\002) or hidden (\002ON\002)."), Config->NickServ.c_str());
+ return true;
+ }
+};
+
+class CommandNSSASetHide : public CommandNSSetHide
+{
+ public:
+ CommandNSSASetHide(Module *creator) : CommandNSSetHide(creator, "nickserv/saset/hide", 3)
+ {
+ this->SetSyntax("\037nickname\037 {EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}");
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->ClearSyntax();
+ this->Run(source, params[0], params[1], params[2]);
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Allows you to prevent certain pieces of information from\n"
+ "being displayed when someone does a %s \002INFO\002 on the\n"
+ "nick. You can hide the E-mail address (\002EMAIL\002), last seen\n"
+ "user@host mask (\002USERMASK\002), the services access status\n"
+ "(\002STATUS\002) and last quit message (\002QUIT\002).\n"
+ "The second parameter specifies whether the information should\n"
+ "be displayed (\002OFF\002) or hidden (\002ON\002)."), Config->NickServ.c_str());
+ return true;
+ }
+};
+
+class CommandNSSetKill : public Command
+{
+ public:
+ CommandNSSetKill(Module *creator, const Anope::string &sname = "nickserv/set/kill", size_t min = 1) : Command(creator, sname, min, min + 1)
+ {
+ this->SetDesc(_("Turn protection on or off"));
+ this->SetSyntax(_("{ON | QUICK | IMMED | OFF}"));
+ }
+
+ void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
+ {
+ if (Config->NoNicknameOwnership)
+ {
+ source.Reply(_("This command may not be used on this network because nickname ownership is disabled."));
+ return;
+ }
+
+ const NickAlias *na = NickAlias::Find(user);
+ if (!na)
+ {
+ source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
+ return;
+ }
+ NickCore *nc = na->nc;
+
+ EventReturn MOD_RESULT;
+ FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param));
+ if (MOD_RESULT == EVENT_STOP)
+ return;
+
+ if (param.equals_ci("ON"))
+ {
+ nc->SetFlag(NI_KILLPROTECT);
+ nc->UnsetFlag(NI_KILL_QUICK);
+ nc->UnsetFlag(NI_KILL_IMMED);
+ source.Reply(_("Protection is now \002on\002 for \002%s\002."), nc->display.c_str());
+ }
+ else if (param.equals_ci("QUICK"))
+ {
+ nc->SetFlag(NI_KILLPROTECT);
+ nc->SetFlag(NI_KILL_QUICK);
+ nc->UnsetFlag(NI_KILL_IMMED);
+ source.Reply(_("Protection is now \002on\002 for \002%s\002, with a reduced delay."), nc->display.c_str());
+ }
+ else if (param.equals_ci("IMMED"))
+ {
+ if (Config->NSAllowKillImmed)
+ {
+ nc->SetFlag(NI_KILLPROTECT);
+ nc->SetFlag(NI_KILL_IMMED);
+ nc->UnsetFlag(NI_KILL_QUICK);
+ source.Reply(_("Protection is now \002on\002 for \002%s\002, with no delay."), nc->display.c_str());
+ }
+ else
+ source.Reply(_("The \002IMMED\002 option is not available on this network."));
+ }
+ else if (param.equals_ci("OFF"))
+ {
+ nc->UnsetFlag(NI_KILLPROTECT);
+ nc->UnsetFlag(NI_KILL_QUICK);
+ nc->UnsetFlag(NI_KILL_IMMED);
+ source.Reply(_("Protection is now \002off\002 for \002%s\002."), nc->display.c_str());
+ }
+ else
+ this->OnSyntaxError(source, "KILL");
+
+ return;
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->Run(source, source.nc->display, params[0]);
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Turns the automatic protection option for your nick\n"
+ "on or off. With protection on, if another user\n"
+ "tries to take your nick, they will be given one minute to\n"
+ "change to another nick, after which %s will forcibly change\n"
+ "their nick.\n"
+ " \n"
+ "If you select \002QUICK\002, the user will be given only 20 seconds\n"
+ "to change nicks instead of the usual 60. If you select\n"
+ "\002IMMED\002, user's nick will be changed immediately \037without\037 being\n"
+ "warned first or given a chance to change their nick; please\n"
+ "do not use this option unless necessary. Also, your\n"
+ "network's administrators may have disabled this option."), Config->NickServ.c_str());
+ return true;
+ }
+};
+
+class CommandNSSASetKill : public CommandNSSetKill
+{
+ public:
+ CommandNSSASetKill(Module *creator) : CommandNSSetKill(creator, "nickserv/saset/kill", 2)
+ {
+ this->SetSyntax(_("\037nickname\037 {ON | QUICK | IMMED | OFF}"));
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->ClearSyntax();
+ this->Run(source, params[0], params[1]);
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Turns the automatic protection option for the nick\n"
+ "on or off. With protection on, if another user\n"
+ "tries to take the nick, they will be given one minute to\n"
+ "change to another nick, after which %s will forcibly change\n"
+ "their nick.\n"
+ " \n"
+ "If you select \002QUICK\002, the user will be given only 20 seconds\n"
+ "to change nicks instead of the usual 60. If you select\n"
+ "\002IMMED\002, the user's nick will be changed immediately \037without\037 being\n"
+ "warned first or given a chance to change their nick; please\n"
+ "do not use this option unless necessary. Also, your\n"
+ "network's administrators may have disabled this option."), Config->NickServ.c_str());
+ return true;
+ }
+};
+
+class CommandNSSetLanguage : public Command
+{
+ public:
+ CommandNSSetLanguage(Module *creator, const Anope::string &sname = "nickserv/set/language", size_t min = 1) : Command(creator, sname, min, min + 1)
+ {
+ this->SetDesc(_("Set the language Services will use when messaging you"));
+ this->SetSyntax(_("\037language\037"));
+ }
+
+ void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
+ {
+ const NickAlias *na = NickAlias::Find(user);
+ if (!na)
+ {
+ source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
+ return;
+ }
+ NickCore *nc = na->nc;
+
+ EventReturn MOD_RESULT;
+ FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param));
+ if (MOD_RESULT == EVENT_STOP)
+ return;
+
+ for (unsigned j = 0; j < Language::Languages.size(); ++j)
+ {
+ if (param == "en" || Language::Languages[j] == param)
+ break;
+ else if (j + 1 == Language::Languages.size())
+ {
+ this->OnSyntaxError(source, "");
+ return;
+ }
+ }
+
+ nc->language = param != "en" ? param : "";
+ source.Reply(_("Language changed to \002English\002."));
+
+ return;
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &param) anope_override
+ {
+ this->Run(source, source.nc->display, param[0]);
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Changes the language Services uses when sending messages to\n"
+ "you (for example, when responding to a command you send).\n"
+ "\037language\037 should be chosen from the following list of\n"
+ "supported languages:"));
+
+ source.Reply(" en (English)");
+ for (unsigned j = 0; j < Language::Languages.size(); ++j)
+ {
+ const Anope::string &langname = Language::Translate(Language::Languages[j].c_str(), _("English"));
+ if (langname == "English")
+ continue;
+ source.Reply(" %s (%s)", Language::Languages[j].c_str(), langname.c_str());
+ }
+
+ return true;
+ }
+};
+
+class CommandNSSASetLanguage : public CommandNSSetLanguage
+{
+ public:
+ CommandNSSASetLanguage(Module *creator) : CommandNSSetLanguage(creator, "nickserv/saset/language", 2)
+ {
+ this->ClearSyntax();
+ this->SetSyntax(_("\037nickname\037 \037language\037"));
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->Run(source, params[0], params[1]);
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Changes the language Services uses when sending messages to\n"
+ "the given user (for example, when responding to a command they send).\n"
+ "\037language\037 should be chosen from the following list of\n"
+ "supported languages:"));
+ source.Reply(" en (English)");
+ for (unsigned j = 0; j < Language::Languages.size(); ++j)
+ {
+ const Anope::string &langname = Language::Translate(Language::Languages[j].c_str(), _("English"));
+ if (langname == "English")
+ continue;
+ source.Reply(" %s (%s)", Language::Languages[j].c_str(), langname.c_str());
+ }
+ return true;
+ }
+};
+
+class CommandNSSetMessage : public Command
+{
+ public:
+ CommandNSSetMessage(Module *creator, const Anope::string &sname = "nickserv/set/message", size_t min = 1) : Command(creator, sname, min, min + 1)
+ {
+ this->SetDesc(_("Change the communication method of Services"));
+ this->SetSyntax(_("{ON | OFF}"));
+ }
+
+ void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
+ {
+ const NickAlias *na = NickAlias::Find(user);
+ if (!na)
+ {
+ source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
+ return;
+ }
+ NickCore *nc = na->nc;
+
+ if (!Config->UsePrivmsg)
+ {
+ source.Reply(_("You cannot %s on this network."), source.command.c_str());
+ return;
+ }
+
+ EventReturn MOD_RESULT;
+ FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param));
+ if (MOD_RESULT == EVENT_STOP)
+ return;
+
+ if (param.equals_ci("ON"))
+ {
+ nc->SetFlag(NI_MSG);
+ source.Reply(_("Services will now reply to \002%s\002 with \002messages\002."), nc->display.c_str());
+ }
+ else if (param.equals_ci("OFF"))
+ {
+ nc->UnsetFlag(NI_MSG);
+ source.Reply(_("Services will now reply to \002%s\002 with \002notices\002."), nc->display.c_str());
+ }
+ else
+ this->OnSyntaxError(source, "MSG");
+
+ return;
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->Run(source, source.nc->display, params[0]);
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Allows you to choose the way Services are communicating with \n"
+ "you. With \002MSG\002 set, Services will use messages, else they'll \n"
+ "use notices."));
+ return true;
+ }
+
+ void OnServHelp(CommandSource &source) anope_override
+ {
+ if (Config->UsePrivmsg)
+ Command::OnServHelp(source);
+ }
+};
+
+class CommandNSSASetMessage : public CommandNSSetMessage
+{
+ public:
+ CommandNSSASetMessage(Module *creator) : CommandNSSetMessage(creator, "nickserv/saset/message", 2)
+ {
+ this->ClearSyntax();
+ this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Allows you to choose the way Services are communicating with \n"
+ "the given user. With \002MSG\002 set, Services will use messages,\n"
+ "else they'll use notices."));
+ return true;
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->Run(source, params[0], params[1]);
+ }
+};
+
+class CommandNSSetPrivate : public Command
+{
+ public:
+ CommandNSSetPrivate(Module *creator, const Anope::string &sname = "nickserv/set/private", size_t min = 1) : Command(creator, sname, min, min + 1)
+ {
+ this->SetDesc(Anope::printf(_("Prevent the nickname from appearing in a \002%s%s LIST\002"), Config->UseStrictPrivMsgString.c_str(), Config->NickServ.c_str()));
+ this->SetSyntax(_("{ON | OFF}"));
+ }
+
+ void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
+ {
+ const NickAlias *na = NickAlias::Find(user);
+ if (!na)
+ {
+ source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
+ return;
+ }
+ NickCore *nc = na->nc;
+
+ EventReturn MOD_RESULT;
+ FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param));
+ if (MOD_RESULT == EVENT_STOP)
+ return;
+
+ if (param.equals_ci("ON"))
+ {
+ nc->SetFlag(NI_PRIVATE);
+ source.Reply(_("Private option is now \002on\002 for \002%s\002."), nc->display.c_str());
+ }
+ else if (param.equals_ci("OFF"))
+ {
+ nc->UnsetFlag(NI_PRIVATE);
+ source.Reply(_("Private option is now \002off\002 for \002%s\002."), nc->display.c_str());
+ }
+ else
+ this->OnSyntaxError(source, "PRIVATE");
+
+ return;
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->Run(source, source.nc->display, params[0]);
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Turns %s's privacy option on or off for your nick.\n"
+ "With \002PRIVATE\002 set, your nickname will not appear in\n"
+ "nickname lists generated with %s's \002LIST\002 command.\n"
+ "(However, anyone who knows your nickname can still get\n"
+ "information on it using the \002INFO\002 command.)"),
+ Config->NickServ.c_str(), Config->NickServ.c_str());
+ return true;
+ }
+};
+
+class CommandNSSASetPrivate : public CommandNSSetPrivate
+{
+ public:
+ CommandNSSASetPrivate(Module *creator) : CommandNSSetPrivate(creator, "nickserv/saset/private", 2)
+ {
+ this->ClearSyntax();
+ this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->Run(source, params[0], params[1]);
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Turns %s's privacy option on or off for the nick.\n"
+ "With \002PRIVATE\002 set, the nickname will not appear in\n"
+ "nickname lists generated with %s's \002LIST\002 command.\n"
+ "(However, anyone who knows the nickname can still get\n"
+ "information on it using the \002INFO\002 command.)"),
+ Config->NickServ.c_str(), Config->NickServ.c_str());
+ return true;
+ }
+};
+
+class CommandNSSetSecure : public Command
+{
+ public:
+ CommandNSSetSecure(Module *creator, const Anope::string &sname = "nickserv/set/secure", size_t min = 1) : Command(creator, sname, min, min + 1)
+ {
+ this->SetDesc(_("Turn nickname security on or off"));
+ this->SetSyntax(_("{ON | OFF}"));
+ }
+
+ void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
+ {
+ const NickAlias *na = NickAlias::Find(user);
+ if (!na)
+ {
+ source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
+ return;
+ }
+ NickCore *nc = na->nc;
+
+ EventReturn MOD_RESULT;
+ FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param));
+ if (MOD_RESULT == EVENT_STOP)
+ return;
+
+ if (param.equals_ci("ON"))
+ {
+ nc->SetFlag(NI_SECURE);
+ source.Reply(_("Secure option is now \002on\002 for \002%s\002."), nc->display.c_str());
+ }
+ else if (param.equals_ci("OFF"))
+ {
+ nc->UnsetFlag(NI_SECURE);
+ source.Reply(_("Secure option is now \002off\002 for \002%s\002."), nc->display.c_str());
+ }
+ else
+ this->OnSyntaxError(source, "SECURE");
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->Run(source, source.nc->display, params[0]);
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Turns %s's security features on or off for your\n"
+ "nick. With \002SECURE\002 set, you must enter your password\n"
+ "before you will be recognized as the owner of the nick,\n"
+ "regardless of whether your address is on the access\n"
+ "list. However, if you are on the access list, %s\n"
+ "will not auto-kill you regardless of the setting of the\n"
+ "\002KILL\002 option."), Config->NickServ.c_str(), Config->NickServ.c_str());
+ return true;
+ }
+};
+
+class CommandNSSASetSecure : public CommandNSSetSecure
+{
+ public:
+ CommandNSSASetSecure(Module *creator) : CommandNSSetSecure(creator, "nickserv/saset/secure", 2)
+ {
+ this->ClearSyntax();
+ this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
+ }
+
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ {
+ this->Run(source, params[0], params[1]);
+ }
+
+ bool OnHelp(CommandSource &source, const Anope::string &) anope_override
+ {
+ this->SendSyntax(source);
+ source.Reply(" ");
+ source.Reply(_("Turns %s's security features on or off for your\n"
+ "nick. With \002SECURE\002 set, you must enter your password\n"
+ "before you will be recognized as the owner of the nick,\n"
+ "regardless of whether your address is on the access\n"
+ "list. However, if you are on the access list, %s\n"
+ "will not auto-kill you regardless of the setting of the\n"
+ "\002KILL\002 option."), Config->NickServ.c_str(), Config->NickServ.c_str());
+ return true;
+ }
+};
+
+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;
}
};
@@ -104,14 +1313,106 @@ class CommandNSSetPassword : public Command
class NSSet : public Module
{
CommandNSSet commandnsset;
+ CommandNSSASet commandnssaset;
+
+ CommandNSSetAutoOp commandnssetautoop;
+ CommandNSSASetAutoOp commandnssasetautoop;
+
+ CommandNSSetChanstats commandnssetchanstats;
+ CommandNSSASetChanstats commandnssasetchanstats;
+ bool NSDefChanstats;
+
+ CommandNSSetDisplay commandnssetdisplay;
+ CommandNSSASetDisplay commandnssasetdisplay;
+
+ CommandNSSetEmail commandnssetemail;
+ CommandNSSASetEmail commandnssasetemail;
+
+ CommandNSSetGreet commandnssetgreet;
+ CommandNSSASetGreet commandnssasetgreet;
+
+ CommandNSSetHide commandnssethide;
+ CommandNSSASetHide commandnssasethide;
+
+ CommandNSSetKill commandnssetkill;
+ CommandNSSASetKill commandnssasetkill;
+
+ CommandNSSetLanguage commandnssetlanguage;
+ CommandNSSASetLanguage commandnssasetlanguage;
+
+ CommandNSSetMessage commandnssetmessage;
+ CommandNSSASetMessage commandnssasetmessage;
+
CommandNSSetPassword commandnssetpassword;
+ CommandNSSASetPassword commandnssasetpassword;
+
+ CommandNSSetPrivate commandnssetprivate;
+ CommandNSSASetPrivate commandnssasetprivate;
+
+ CommandNSSetSecure commandnssetsecure;
+ CommandNSSASetSecure commandnssasetsecure;
+
+ CommandNSSASetNoexpire commandnssasetnoexpire;
public:
NSSet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
- commandnsset(this), commandnssetpassword(this)
+ commandnsset(this), commandnssaset(this),
+ commandnssetautoop(this), commandnssasetautoop(this),
+ commandnssetchanstats(this), commandnssasetchanstats(this), NSDefChanstats(false),
+ commandnssetdisplay(this), commandnssasetdisplay(this),
+ commandnssetemail(this), commandnssasetemail(this),
+ commandnssetgreet(this), commandnssasetgreet(this),
+ commandnssethide(this), commandnssasethide(this),
+ commandnssetkill(this), commandnssasetkill(this),
+ commandnssetlanguage(this), commandnssasetlanguage(this),
+ commandnssetmessage(this), commandnssasetmessage(this),
+ commandnssetpassword(this), commandnssasetpassword(this),
+ commandnssetprivate(this), commandnssasetprivate(this),
+ commandnssetsecure(this), commandnssasetsecure(this),
+ commandnssasetnoexpire(this)
{
this->SetAuthor("Anope");
+ Implementation i[] = { I_OnReload, I_OnNickRegister, I_OnPreCommand };
+ ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
+
+ this->OnReload();
+ }
+
+ void OnReload() anope_override
+ {
+ ConfigReader config;
+ NSDefChanstats = config.ReadFlag("chanstats", "NSDefChanstats", "0", 0);
+ }
+
+ void OnNickRegister(NickAlias *na) anope_override
+ {
+ if (NSDefChanstats)
+ na->nc->SetFlag(NI_STATS);
+ }
+
+ EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> &params) anope_override
+ {
+ NickCore *uac = source.nc;
+
+ if (command->name == "nickserv/confirm" && !params.empty() && uac)
+ {
+ Anope::string *new_email = uac->GetExt<ExtensibleItemClass<Anope::string> *>("ns_set_email"), *passcode = uac->GetExt<ExtensibleItemClass<Anope::string> *>("ns_set_email_passcode");
+ if (new_email && passcode)
+ {
+ if (params[0] == *passcode)
+ {
+ uac->email = *new_email;
+ Log(LOG_COMMAND, source, command) << "to confirm their email address change to " << uac->email;
+ source.Reply(_("Your email address has been changed to \002%s\002."), uac->email.c_str());
+ uac->Shrink("ns_set_email");
+ uac->Shrink("ns_set_email_passcode");
+ return EVENT_STOP;
+ }
+ }
+ }
+
+ return EVENT_CONTINUE;
}
};
diff --git a/modules/commands/ns_set_autoop.cpp b/modules/commands/ns_set_autoop.cpp
deleted file mode 100644
index e6533875b..000000000
--- a/modules/commands/ns_set_autoop.cpp
+++ /dev/null
@@ -1,110 +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 CommandNSSetAutoOp : public Command
-{
- public:
- CommandNSSetAutoOp(Module *creator, const Anope::string &sname = "nickserv/set/autoop", size_t min = 1) : Command(creator, sname, min, min + 1)
- {
- this->SetDesc(_("Should services op you automatically."));
- this->SetSyntax(_("{ON | OFF}"));
- }
-
- void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
- {
- const NickAlias *na = NickAlias::Find(user);
- if (na == NULL)
- {
- source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
- return;
- }
- NickCore *nc = na->nc;
-
- EventReturn MOD_RESULT;
- FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param));
- if (MOD_RESULT == EVENT_STOP)
- return;
-
- if (param.equals_ci("ON"))
- {
- nc->SetFlag(NI_AUTOOP);
- source.Reply(_("Services will now autoop %s in channels."), nc->display.c_str());
- }
- else if (param.equals_ci("OFF"))
- {
- nc->UnsetFlag(NI_AUTOOP);
- source.Reply(_("Services will no longer autoop %s in channels."), nc->display.c_str());
- }
- else
- this->OnSyntaxError(source, "AUTOOP");
-
- return;
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->Run(source, source.nc->display, params[0]);
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Sets whether you will be opped automatically. Set to ON to \n"
- "allow ChanServ to op you automatically when entering channels."));
- return true;
- }
-};
-
-class CommandNSSASetAutoOp : public CommandNSSetAutoOp
-{
- public:
- CommandNSSASetAutoOp(Module *creator) : CommandNSSetAutoOp(creator, "nickserv/saset/autoop", 2)
- {
- this->ClearSyntax();
- this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->Run(source, params[0], params[1]);
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Sets whether the given nickname will be opped automatically.\n"
- "Set to \002ON\002 to allow ChanServ to op the given nickname \n"
- "omatically when joining channels."));
- return true;
- }
-};
-
-class NSSetAutoOp : public Module
-{
- CommandNSSetAutoOp commandnssetautoop;
- CommandNSSASetAutoOp commandnssasetautoop;
-
- public:
- NSSetAutoOp(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
- commandnssetautoop(this), commandnssasetautoop(this)
- {
- this->SetAuthor("Anope");
-
- }
-};
-
-MODULE_INIT(NSSetAutoOp)
diff --git a/modules/commands/ns_set_chanstats.cpp b/modules/commands/ns_set_chanstats.cpp
deleted file mode 100644
index 7b8f371ff..000000000
--- a/modules/commands/ns_set_chanstats.cpp
+++ /dev/null
@@ -1,120 +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 CommandNSSetChanstats : public Command
-{
- public:
- CommandNSSetChanstats(Module *creator, const Anope::string &sname = "nickserv/set/chanstats", size_t min = 1 ) : Command(creator, sname, min, min + 1)
- {
- this->SetDesc(_("Turn chanstat statistic on or off"));
- this->SetSyntax(_("{ON | OFF}"));
- }
- void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
- {
- NickAlias *na = NickAlias::Find(user);
- if (!na)
- {
- source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
- return;
- }
-
- EventReturn MOD_RESULT;
- FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, na->nc, param));
- if (MOD_RESULT == EVENT_STOP)
- return;
-
- if (param.equals_ci("ON"))
- {
- na->nc->SetFlag(NI_STATS);
- source.Reply(_("Chanstat statistics are now enabled for your nick"));
- }
- else if (param.equals_ci("OFF"))
- {
- na->nc->UnsetFlag(NI_STATS);
- source.Reply(_("Chanstat statistics are now disabled for your nick"));
- }
- else
- this->OnSyntaxError(source, "CHANSTATS");
-
- return;
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->Run(source, source.nc->display, params[0]);
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Turns Chanstats statistics ON or OFF"));
- return true;
- }
-};
-
-class CommandNSSASetChanstats : public CommandNSSetChanstats
-{
- public:
- CommandNSSASetChanstats(Module *creator) : CommandNSSetChanstats(creator, "nickserv/saset/chanstats", 2)
- {
- this->ClearSyntax();
- this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->Run(source, params[0], params[1]);
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Turns chanstats channel statistics ON or OFF for this user"));
- return true;
- }
-};
-
-class NSSetChanstats : public Module
-{
- CommandNSSetChanstats commandnssetchanstats;
- CommandNSSASetChanstats commandnssasetchanstats;
- bool NSDefChanstats;
-
- public:
- NSSetChanstats(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
- commandnssetchanstats(this), commandnssasetchanstats(this)
- {
- this->SetAuthor("Anope");
-
- Implementation i[] = { I_OnReload, I_OnNickRegister };
- ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
-
- this->OnReload();
- }
- void OnReload() anope_override
- {
- ConfigReader config;
- NSDefChanstats = config.ReadFlag("chanstats", "NSDefChanstats", "0", 0);
- }
- void OnNickRegister(NickAlias *na) anope_override
- {
- if (NSDefChanstats)
- na->nc->SetFlag(NI_STATS);
- }
-};
-
-MODULE_INIT(NSSetChanstats)
diff --git a/modules/commands/ns_set_display.cpp b/modules/commands/ns_set_display.cpp
deleted file mode 100644
index c532f4cf1..000000000
--- a/modules/commands/ns_set_display.cpp
+++ /dev/null
@@ -1,104 +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 CommandNSSetDisplay : public Command
-{
- public:
- CommandNSSetDisplay(Module *creator, const Anope::string &sname = "nickserv/set/display", size_t min = 1) : Command(creator, sname, min, min + 1)
- {
- this->SetDesc(_("Set the display of your group in Services"));
- this->SetSyntax(_("\037new-display\037"));
- }
-
- void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
- {
- const NickAlias *user_na = NickAlias::Find(user), *na = NickAlias::Find(param);
-
- if (user_na == NULL)
- {
- source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
- return;
- }
- else if (!na || *na->nc != *user_na->nc)
- {
- source.Reply(_("The new display MUST be a nickname of the nickname group %s"), user_na->nc->display.c_str());
- return;
- }
-
- EventReturn MOD_RESULT;
- FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, user_na->nc, param));
- if (MOD_RESULT == EVENT_STOP)
- return;
-
- user_na->nc->SetDisplay(na);
- source.Reply(NICK_SET_DISPLAY_CHANGED, user_na->nc->display.c_str());
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->Run(source, source.nc->display, params[0]);
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Changes the display used to refer to your nickname group in \n"
- "Services. The new display MUST be a nick of your group."));
- return true;
- }
-};
-
-class CommandNSSASetDisplay : public CommandNSSetDisplay
-{
- public:
- CommandNSSASetDisplay(Module *creator) : CommandNSSetDisplay(creator, "nickserv/saset/display", 2)
- {
- this->ClearSyntax();
- this->SetSyntax(_("\037nickname\037 \037new-display\037"));
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->Run(source, params[0], params[1]);
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Changes the display used to refer to the nickname group in \n"
- "Services. The new display MUST be a nick of your group."));
- return true;
- }
-};
-
-class NSSetDisplay : public Module
-{
- CommandNSSetDisplay commandnssetdisplay;
- CommandNSSASetDisplay commandnssasetdisplay;
-
- public:
- NSSetDisplay(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
- commandnssetdisplay(this), commandnssasetdisplay(this)
- {
- this->SetAuthor("Anope");
-
- if (Config->NoNicknameOwnership)
- throw ModuleException(modname + " can not be used with options:nonicknameownership enabled");
- }
-};
-
-MODULE_INIT(NSSetDisplay)
diff --git a/modules/commands/ns_set_email.cpp b/modules/commands/ns_set_email.cpp
deleted file mode 100644
index 82b4a0cc8..000000000
--- a/modules/commands/ns_set_email.cpp
+++ /dev/null
@@ -1,190 +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"
-
-static bool SendConfirmMail(User *u, const BotInfo *bi)
-{
- int chars[] = {
- ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
- 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y',
- 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y',
- 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'
- };
- int idx, min = 1, max = 62;
- Anope::string code;
- for (idx = 0; idx < 9; ++idx)
- code += chars[1 + static_cast<int>((static_cast<float>(max - min)) * static_cast<uint16_t>(rand()) / 65536.0) + min];
-
- u->Account()->Extend("ns_set_email_passcode", new ExtensibleItemClass<Anope::string>(code));
-
- Anope::string subject = Config->MailEmailchangeSubject;
- Anope::string message = Config->MailEmailchangeMessage;
-
- subject = subject.replace_all_cs("%e", u->Account()->email);
- subject = subject.replace_all_cs("%N", Config->NetworkName);
- subject = subject.replace_all_cs("%c", code);
-
- message = message.replace_all_cs("%e", u->Account()->email);
- message = message.replace_all_cs("%N", Config->NetworkName);
- message = message.replace_all_cs("%c", code);
-
- return Mail::Send(u, u->Account(), bi, subject, message);
-}
-
-class CommandNSSetEmail : public Command
-{
- public:
- CommandNSSetEmail(Module *creator, const Anope::string &cname = "nickserv/set/email", size_t min = 0) : Command(creator, cname, min, min + 1)
- {
- this->SetDesc(_("Associate an E-mail address with your nickname"));
- this->SetSyntax(_("\037address\037"));
- }
-
- void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
- {
- const NickAlias *na = NickAlias::Find(user);
- if (!na)
- {
- source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
- return;
- }
- NickCore *nc = na->nc;
-
- if (param.empty() && Config->NSForceEmail)
- {
- source.Reply(_("You cannot unset the e-mail on this network."));
- return;
- }
- else if (Config->NSSecureAdmins && source.nc != nc && nc->IsServicesOper())
- {
- source.Reply(_("You may not change the email of other services operators."));
- return;
- }
- else if (!param.empty() && !Mail::Validate(param))
- {
- source.Reply(MAIL_X_INVALID, param.c_str());
- return;
- }
-
- EventReturn MOD_RESULT;
- FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param));
- if (MOD_RESULT == EVENT_STOP)
- return;
-
- if (!param.empty() && Config->NSConfirmEmailChanges && !source.IsServicesOper())
- {
- source.nc->Extend("ns_set_email", new ExtensibleItemClass<Anope::string>(param));
- Anope::string old = source.nc->email;
- source.nc->email = param;
- if (SendConfirmMail(source.GetUser(), source.service))
- source.Reply(_("A confirmation email has been sent to \002%s\002. Follow the instructions in it to change your email address."), param.c_str());
- source.nc->email = old;
- }
- else
- {
- if (!param.empty())
- {
- nc->email = param;
- source.Reply(_("E-mail address for \002%s\002 changed to \002%s\002."), nc->display.c_str(), param.c_str());
- }
- else
- {
- nc->email.clear();
- source.Reply(_("E-mail address for \002%s\002 unset."), nc->display.c_str());
- }
- }
-
- return;
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->Run(source, source.nc->display, params.size() ? params[0] : "");
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Associates the given E-mail address with your nickname.\n"
- "This address will be displayed whenever someone requests\n"
- "information on the nickname with the \002INFO\002 command."));
- return true;
- }
-};
-
-class CommandNSSASetEmail : public CommandNSSetEmail
-{
- public:
- CommandNSSASetEmail(Module *creator) : CommandNSSetEmail(creator, "nickserv/saset/email", 2)
- {
- this->ClearSyntax();
- this->SetSyntax(_("\037nickname\037 \037address\037"));
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->Run(source, params[0], params.size() > 1 ? params[1] : "");
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Associates the given E-mail address with the nickname."));
- return true;
- }
-};
-
-class NSSetEmail : public Module
-{
- CommandNSSetEmail commandnssetemail;
- CommandNSSASetEmail commandnssasetemail;
-
- public:
- NSSetEmail(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
- commandnssetemail(this), commandnssasetemail(this)
- {
- this->SetAuthor("Anope");
-
- ModuleManager::Attach(I_OnPreCommand, this);
-
- }
-
- EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> &params) anope_override
- {
- NickCore *uac = source.nc;
- if (command->name == "nickserv/confirm" && !params.empty() && uac)
- {
- Anope::string *new_email = uac->GetExt<ExtensibleItemClass<Anope::string> *>("ns_set_email"), *passcode = uac->GetExt<ExtensibleItemClass<Anope::string> *>("ns_set_email_passcode");
- if (new_email && passcode)
- {
- if (params[0] == *passcode)
- {
- uac->email = *new_email;
- Log(LOG_COMMAND, source, command) << "to confirm their email address change to " << uac->email;
- source.Reply(_("Your email address has been changed to \002%s\002."), uac->email.c_str());
- uac->Shrink("ns_set_email");
- uac->Shrink("ns_set_email_passcode");
- return EVENT_STOP;
- }
- }
- }
-
- return EVENT_CONTINUE;
- }
-};
-
-MODULE_INIT(NSSetEmail)
diff --git a/modules/commands/ns_set_greet.cpp b/modules/commands/ns_set_greet.cpp
deleted file mode 100644
index b28edc2bb..000000000
--- a/modules/commands/ns_set_greet.cpp
+++ /dev/null
@@ -1,111 +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 CommandNSSetGreet : public Command
-{
- public:
- CommandNSSetGreet(Module *creator, const Anope::string &sname = "nickserv/set/greet", size_t min = 0) : Command(creator, sname, min, min + 1)
- {
- this->SetDesc(_("Associate a greet message with your nickname"));
- this->SetSyntax(_("\037message\037"));
- }
-
- void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
- {
- const NickAlias *na = NickAlias::Find(user);
- if (!na)
- {
- source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
- return;
- }
- NickCore *nc = na->nc;
-
- EventReturn MOD_RESULT;
- FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param));
- if (MOD_RESULT == EVENT_STOP)
- return;
-
- if (!param.empty())
- {
- nc->greet = param;
- source.Reply(_("Greet message for \002%s\002 changed to \002%s\002."), nc->display.c_str(), nc->greet.c_str());
- }
- else
- {
- nc->greet.clear();
- source.Reply(_("Greet message for \002%s\002 unset."), nc->display.c_str());
- }
-
- return;
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->Run(source, source.nc->display, params.size() > 0 ? params[0] : "");
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Makes the given message the greet of your nickname, that\n"
- "will be displayed when joining a channel that has GREET\n"
- "option enabled, provided that you have the necessary \n"
- "access on it."));
- return true;
- }
-};
-
-class CommandNSSASetGreet : public CommandNSSetGreet
-{
- public:
- CommandNSSASetGreet(Module *creator) : CommandNSSetGreet(creator, "nickserv/saset/greet", 1)
- {
- this->ClearSyntax();
- this->SetSyntax(_("\037nickname\037 \037message\037"));
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->Run(source, params[0], params.size() > 1 ? params[1] : "");
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Makes the given message the greet of the nickname, that\n"
- "will be displayed when joining a channel that has GREET\n"
- "option enabled, provided that the user has the necessary \n"
- "access on it."));
- return true;
- }
-};
-
-class NSSetGreet : public Module
-{
- CommandNSSetGreet commandnssetgreet;
- CommandNSSASetGreet commandnssasetgreet;
-
- public:
- NSSetGreet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
- commandnssetgreet(this), commandnssasetgreet(this)
- {
- this->SetAuthor("Anope");
-
- }
-};
-
-MODULE_INIT(NSSetGreet)
diff --git a/modules/commands/ns_set_hide.cpp b/modules/commands/ns_set_hide.cpp
deleted file mode 100644
index d7fe886ea..000000000
--- a/modules/commands/ns_set_hide.cpp
+++ /dev/null
@@ -1,152 +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 CommandNSSetHide : public Command
-{
- public:
- CommandNSSetHide(Module *creator, const Anope::string &sname = "nickserv/set/hide", size_t min = 2) : Command(creator, sname, min, min + 1)
- {
- this->SetDesc(_("Hide certain pieces of nickname information"));
- this->SetSyntax(_("{EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}"));
- }
-
- void Run(CommandSource &source, const Anope::string &user, const Anope::string &param, const Anope::string &arg)
- {
- const NickAlias *na = NickAlias::Find(user);
- if (!na)
- {
- source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
- return;
- }
- NickCore *nc = na->nc;
-
- EventReturn MOD_RESULT;
- FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param));
- if (MOD_RESULT == EVENT_STOP)
- return;
-
- Anope::string onmsg, offmsg;
- NickCoreFlag flag;
-
- if (param.equals_ci("EMAIL"))
- {
- flag = NI_HIDE_EMAIL;
- onmsg = _("The E-mail address of \002%s\002 will now be hidden from %s INFO displays.");
- offmsg = _("The E-mail address of \002%s\002 will now be shown in %s INFO displays.");
- }
- else if (param.equals_ci("USERMASK"))
- {
- flag = NI_HIDE_MASK;
- onmsg = _("The last seen user@host mask of \002%s\002 will now be hidden from %s INFO displays.");
- offmsg = _("The last seen user@host mask of \002%s\002 will now be shown in %s INFO displays.");
- }
- else if (param.equals_ci("STATUS"))
- {
- flag = NI_HIDE_STATUS;
- onmsg = _("The services access status of \002%s\002 will now be hidden from %s INFO displays.");
- offmsg = _("The services access status of \002%s\002 will now be shown in %s INFO displays.");
- }
- else if (param.equals_ci("QUIT"))
- {
- flag = NI_HIDE_QUIT;
- onmsg = _("The last quit message of \002%s\002 will now be hidden from %s INFO displays.");
- offmsg = _("The last quit message of \002%s\002 will now be shown in %s INFO displays.");
- }
- else
- {
- this->OnSyntaxError(source, "HIDE");
- return;
- }
-
- if (arg.equals_ci("ON"))
- {
- nc->SetFlag(flag);
- source.Reply(onmsg.c_str(), nc->display.c_str(), Config->NickServ.c_str());
- }
- else if (arg.equals_ci("OFF"))
- {
- nc->UnsetFlag(flag);
- source.Reply(offmsg.c_str(), nc->display.c_str(), Config->NickServ.c_str());
- }
- else
- this->OnSyntaxError(source, "HIDE");
-
- return;
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->Run(source, source.nc->display, params[0], params[1]);
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Allows you to prevent certain pieces of information from\n"
- "being displayed when someone does a %s \002INFO\002 on your\n"
- "nick. You can hide your E-mail address (\002EMAIL\002), last seen\n"
- "user@host mask (\002USERMASK\002), your services access status\n"
- "(\002STATUS\002) and last quit message (\002QUIT\002).\n"
- "The second parameter specifies whether the information should\n"
- "be displayed (\002OFF\002) or hidden (\002ON\002)."), Config->NickServ.c_str());
- return true;
- }
-};
-
-class CommandNSSASetHide : public CommandNSSetHide
-{
- public:
- CommandNSSASetHide(Module *creator) : CommandNSSetHide(creator, "nickserv/saset/hide", 3)
- {
- this->SetSyntax("\037nickname\037 {EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}");
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->ClearSyntax();
- this->Run(source, params[0], params[1], params[2]);
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Allows you to prevent certain pieces of information from\n"
- "being displayed when someone does a %s \002INFO\002 on the\n"
- "nick. You can hide the E-mail address (\002EMAIL\002), last seen\n"
- "user@host mask (\002USERMASK\002), the services access status\n"
- "(\002STATUS\002) and last quit message (\002QUIT\002).\n"
- "The second parameter specifies whether the information should\n"
- "be displayed (\002OFF\002) or hidden (\002ON\002)."), Config->NickServ.c_str());
- return true;
- }
-};
-
-class NSSetHide : public Module
-{
- CommandNSSetHide commandnssethide;
- CommandNSSASetHide commandnssasethide;
-
- public:
- NSSetHide(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
- commandnssethide(this), commandnssasethide(this)
- {
- this->SetAuthor("Anope");
-
- }
-};
-
-MODULE_INIT(NSSetHide)
diff --git a/modules/commands/ns_set_kill.cpp b/modules/commands/ns_set_kill.cpp
deleted file mode 100644
index 0f62a4ba0..000000000
--- a/modules/commands/ns_set_kill.cpp
+++ /dev/null
@@ -1,154 +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 CommandNSSetKill : public Command
-{
- public:
- CommandNSSetKill(Module *creator, const Anope::string &sname = "nickserv/set/kill", size_t min = 1) : Command(creator, sname, min, min + 1)
- {
- this->SetDesc(_("Turn protection on or off"));
- this->SetSyntax(_("{ON | QUICK | IMMED | OFF}"));
- }
-
- void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
- {
- const NickAlias *na = NickAlias::Find(user);
- if (!na)
- {
- source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
- return;
- }
- NickCore *nc = na->nc;
-
- EventReturn MOD_RESULT;
- FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param));
- if (MOD_RESULT == EVENT_STOP)
- return;
-
- if (param.equals_ci("ON"))
- {
- nc->SetFlag(NI_KILLPROTECT);
- nc->UnsetFlag(NI_KILL_QUICK);
- nc->UnsetFlag(NI_KILL_IMMED);
- source.Reply(_("Protection is now \002on\002 for \002%s\002."), nc->display.c_str());
- }
- else if (param.equals_ci("QUICK"))
- {
- nc->SetFlag(NI_KILLPROTECT);
- nc->SetFlag(NI_KILL_QUICK);
- nc->UnsetFlag(NI_KILL_IMMED);
- source.Reply(_("Protection is now \002on\002 for \002%s\002, with a reduced delay."), nc->display.c_str());
- }
- else if (param.equals_ci("IMMED"))
- {
- if (Config->NSAllowKillImmed)
- {
- nc->SetFlag(NI_KILLPROTECT);
- nc->SetFlag(NI_KILL_IMMED);
- nc->UnsetFlag(NI_KILL_QUICK);
- source.Reply(_("Protection is now \002on\002 for \002%s\002, with no delay."), nc->display.c_str());
- }
- else
- source.Reply(_("The \002IMMED\002 option is not available on this network."));
- }
- else if (param.equals_ci("OFF"))
- {
- nc->UnsetFlag(NI_KILLPROTECT);
- nc->UnsetFlag(NI_KILL_QUICK);
- nc->UnsetFlag(NI_KILL_IMMED);
- source.Reply(_("Protection is now \002off\002 for \002%s\002."), nc->display.c_str());
- }
- else
- this->OnSyntaxError(source, "KILL");
-
- return;
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->Run(source, source.nc->display, params[0]);
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Turns the automatic protection option for your nick\n"
- "on or off. With protection on, if another user\n"
- "tries to take your nick, they will be given one minute to\n"
- "change to another nick, after which %s will forcibly change\n"
- "their nick.\n"
- " \n"
- "If you select \002QUICK\002, the user will be given only 20 seconds\n"
- "to change nicks instead of the usual 60. If you select\n"
- "\002IMMED\002, user's nick will be changed immediately \037without\037 being\n"
- "warned first or given a chance to change their nick; please\n"
- "do not use this option unless necessary. Also, your\n"
- "network's administrators may have disabled this option."), Config->NickServ.c_str());
- return true;
- }
-};
-
-class CommandNSSASetKill : public CommandNSSetKill
-{
- public:
- CommandNSSASetKill(Module *creator) : CommandNSSetKill(creator, "nickserv/saset/kill", 2)
- {
- this->SetSyntax(_("\037nickname\037 {ON | QUICK | IMMED | OFF}"));
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->ClearSyntax();
- this->Run(source, params[0], params[1]);
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Turns the automatic protection option for the nick\n"
- "on or off. With protection on, if another user\n"
- "tries to take the nick, they will be given one minute to\n"
- "change to another nick, after which %s will forcibly change\n"
- "their nick.\n"
- " \n"
- "If you select \002QUICK\002, the user will be given only 20 seconds\n"
- "to change nicks instead of the usual 60. If you select\n"
- "\002IMMED\002, the user's nick will be changed immediately \037without\037 being\n"
- "warned first or given a chance to change their nick; please\n"
- "do not use this option unless necessary. Also, your\n"
- "network's administrators may have disabled this option."), Config->NickServ.c_str());
- return true;
- }
-};
-
-class NSSetKill : public Module
-{
- CommandNSSetKill commandnssetkill;
- CommandNSSASetKill commandnssasetkill;
-
- public:
- NSSetKill(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
- commandnssetkill(this), commandnssasetkill(this)
- {
- this->SetAuthor("Anope");
-
- if (Config->NoNicknameOwnership)
- throw ModuleException(modname + " can not be used with options:nonicknameownership enabled");
- }
-};
-
-MODULE_INIT(NSSetKill)
diff --git a/modules/commands/ns_set_language.cpp b/modules/commands/ns_set_language.cpp
deleted file mode 100644
index d2830d4b8..000000000
--- a/modules/commands/ns_set_language.cpp
+++ /dev/null
@@ -1,132 +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 CommandNSSetLanguage : public Command
-{
- public:
- CommandNSSetLanguage(Module *creator, const Anope::string &sname = "nickserv/set/language", size_t min = 1) : Command(creator, sname, min, min + 1)
- {
- this->SetDesc(_("Set the language Services will use when messaging you"));
- this->SetSyntax(_("\037language\037"));
- }
-
- void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
- {
- const NickAlias *na = NickAlias::Find(user);
- if (!na)
- {
- source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
- return;
- }
- NickCore *nc = na->nc;
-
- EventReturn MOD_RESULT;
- FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param));
- if (MOD_RESULT == EVENT_STOP)
- return;
-
- for (unsigned j = 0; j < Language::Languages.size(); ++j)
- {
- if (param == "en" || Language::Languages[j] == param)
- break;
- else if (j + 1 == Language::Languages.size())
- {
- this->OnSyntaxError(source, "");
- return;
- }
- }
-
- nc->language = param != "en" ? param : "";
- source.Reply(_("Language changed to \002English\002."));
-
- return;
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &param) anope_override
- {
- this->Run(source, source.nc->display, param[0]);
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Changes the language Services uses when sending messages to\n"
- "you (for example, when responding to a command you send).\n"
- "\037language\037 should be chosen from the following list of\n"
- "supported languages:"));
-
- source.Reply(" en (English)");
- for (unsigned j = 0; j < Language::Languages.size(); ++j)
- {
- const Anope::string &langname = Language::Translate(Language::Languages[j].c_str(), _("English"));
- if (langname == "English")
- continue;
- source.Reply(" %s (%s)", Language::Languages[j].c_str(), langname.c_str());
- }
-
- return true;
- }
-};
-
-class CommandNSSASetLanguage : public CommandNSSetLanguage
-{
- public:
- CommandNSSASetLanguage(Module *creator) : CommandNSSetLanguage(creator, "nickserv/saset/language", 2)
- {
- this->ClearSyntax();
- this->SetSyntax(_("\037nickname\037 \037language\037"));
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->Run(source, params[0], params[1]);
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Changes the language Services uses when sending messages to\n"
- "the given user (for example, when responding to a command they send).\n"
- "\037language\037 should be chosen from the following list of\n"
- "supported languages:"));
- source.Reply(" en (English)");
- for (unsigned j = 0; j < Language::Languages.size(); ++j)
- {
- const Anope::string &langname = Language::Translate(Language::Languages[j].c_str(), _("English"));
- if (langname == "English")
- continue;
- source.Reply(" %s (%s)", Language::Languages[j].c_str(), langname.c_str());
- }
- return true;
- }
-};
-
-class NSSetLanguage : public Module
-{
- CommandNSSetLanguage commandnssetlanguage;
- CommandNSSASetLanguage commandnssasetlanguage;
-
- public:
- NSSetLanguage(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
- commandnssetlanguage(this), commandnssasetlanguage(this)
- {
- this->SetAuthor("Anope");
-
- }
-};
-
-MODULE_INIT(NSSetLanguage)
diff --git a/modules/commands/ns_set_message.cpp b/modules/commands/ns_set_message.cpp
deleted file mode 100644
index f515b22c1..000000000
--- a/modules/commands/ns_set_message.cpp
+++ /dev/null
@@ -1,123 +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 CommandNSSetMessage : public Command
-{
- public:
- CommandNSSetMessage(Module *creator, const Anope::string &sname = "nickserv/set/message", size_t min = 1) : Command(creator, sname, min, min + 1)
- {
- this->SetDesc(_("Change the communication method of Services"));
- this->SetSyntax(_("{ON | OFF}"));
- }
-
- void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
- {
- const NickAlias *na = NickAlias::Find(user);
- if (!na)
- {
- source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
- return;
- }
- NickCore *nc = na->nc;
-
- if (!Config->UsePrivmsg)
- {
- source.Reply(_("You cannot %s on this network."), source.command.c_str());
- return;
- }
-
- EventReturn MOD_RESULT;
- FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param));
- if (MOD_RESULT == EVENT_STOP)
- return;
-
- if (param.equals_ci("ON"))
- {
- nc->SetFlag(NI_MSG);
- source.Reply(_("Services will now reply to \002%s\002 with \002messages\002."), nc->display.c_str());
- }
- else if (param.equals_ci("OFF"))
- {
- nc->UnsetFlag(NI_MSG);
- source.Reply(_("Services will now reply to \002%s\002 with \002notices\002."), nc->display.c_str());
- }
- else
- this->OnSyntaxError(source, "MSG");
-
- return;
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->Run(source, source.nc->display, params[0]);
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Allows you to choose the way Services are communicating with \n"
- "you. With \002MSG\002 set, Services will use messages, else they'll \n"
- "use notices."));
- return true;
- }
-
- void OnServHelp(CommandSource &source) anope_override
- {
- if (Config->UsePrivmsg)
- Command::OnServHelp(source);
- }
-};
-
-class CommandNSSASetMessage : public CommandNSSetMessage
-{
- public:
- CommandNSSASetMessage(Module *creator) : CommandNSSetMessage(creator, "nickserv/saset/message", 2)
- {
- this->ClearSyntax();
- this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Allows you to choose the way Services are communicating with \n"
- "the given user. With \002MSG\002 set, Services will use messages,\n"
- "else they'll use notices."));
- return true;
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->Run(source, params[0], params[1]);
- }
-};
-
-class NSSetMessage : public Module
-{
- CommandNSSetMessage commandnssetmessage;
- CommandNSSASetMessage commandnssasetmessage;
-
- public:
- NSSetMessage(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
- commandnssetmessage(this), commandnssasetmessage(this)
- {
- this->SetAuthor("Anope");
-
- }
-};
-
-MODULE_INIT(NSSetMessage)
diff --git a/modules/commands/ns_set_private.cpp b/modules/commands/ns_set_private.cpp
deleted file mode 100644
index 8f953fcc0..000000000
--- a/modules/commands/ns_set_private.cpp
+++ /dev/null
@@ -1,117 +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 CommandNSSetPrivate : public Command
-{
- public:
- CommandNSSetPrivate(Module *creator, const Anope::string &sname = "nickserv/set/private", size_t min = 1) : Command(creator, sname, min, min + 1)
- {
- this->SetDesc(Anope::printf(_("Prevent the nickname from appearing in a \002%s%s LIST\002"), Config->UseStrictPrivMsgString.c_str(), Config->NickServ.c_str()));
- this->SetSyntax(_("{ON | OFF}"));
- }
-
- void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
- {
- const NickAlias *na = NickAlias::Find(user);
- if (!na)
- {
- source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
- return;
- }
- NickCore *nc = na->nc;
-
- EventReturn MOD_RESULT;
- FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param));
- if (MOD_RESULT == EVENT_STOP)
- return;
-
- if (param.equals_ci("ON"))
- {
- nc->SetFlag(NI_PRIVATE);
- source.Reply(_("Private option is now \002on\002 for \002%s\002."), nc->display.c_str());
- }
- else if (param.equals_ci("OFF"))
- {
- nc->UnsetFlag(NI_PRIVATE);
- source.Reply(_("Private option is now \002off\002 for \002%s\002."), nc->display.c_str());
- }
- else
- this->OnSyntaxError(source, "PRIVATE");
-
- return;
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->Run(source, source.nc->display, params[0]);
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Turns %s's privacy option on or off for your nick.\n"
- "With \002PRIVATE\002 set, your nickname will not appear in\n"
- "nickname lists generated with %s's \002LIST\002 command.\n"
- "(However, anyone who knows your nickname can still get\n"
- "information on it using the \002INFO\002 command.)"),
- Config->NickServ.c_str(), Config->NickServ.c_str());
- return true;
- }
-};
-
-class CommandNSSASetPrivate : public CommandNSSetPrivate
-{
- public:
- CommandNSSASetPrivate(Module *creator) : CommandNSSetPrivate(creator, "nickserv/saset/private", 2)
- {
- this->ClearSyntax();
- this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->Run(source, params[0], params[1]);
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Turns %s's privacy option on or off for the nick.\n"
- "With \002PRIVATE\002 set, the nickname will not appear in\n"
- "nickname lists generated with %s's \002LIST\002 command.\n"
- "(However, anyone who knows the nickname can still get\n"
- "information on it using the \002INFO\002 command.)"),
- Config->NickServ.c_str(), Config->NickServ.c_str());
- return true;
- }
-};
-
-class NSSetPrivate : public Module
-{
- CommandNSSetPrivate commandnssetprivate;
- CommandNSSASetPrivate commandnssasetprivate;
-
- public:
- NSSetPrivate(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
- commandnssetprivate(this), commandnssasetprivate(this)
- {
- this->SetAuthor("Anope");
-
- }
-};
-
-MODULE_INIT(NSSetPrivate)
diff --git a/modules/commands/ns_set_secure.cpp b/modules/commands/ns_set_secure.cpp
deleted file mode 100644
index b7dd79969..000000000
--- a/modules/commands/ns_set_secure.cpp
+++ /dev/null
@@ -1,117 +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 CommandNSSetSecure : public Command
-{
- public:
- CommandNSSetSecure(Module *creator, const Anope::string &sname = "nickserv/set/secure", size_t min = 1) : Command(creator, sname, min, min + 1)
- {
- this->SetDesc(_("Turn nickname security on or off"));
- this->SetSyntax(_("{ON | OFF}"));
- }
-
- void Run(CommandSource &source, const Anope::string &user, const Anope::string &param)
- {
- const NickAlias *na = NickAlias::Find(user);
- if (!na)
- {
- source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
- return;
- }
- NickCore *nc = na->nc;
-
- EventReturn MOD_RESULT;
- FOREACH_RESULT(I_OnSetNickOption, OnSetNickOption(source, this, nc, param));
- if (MOD_RESULT == EVENT_STOP)
- return;
-
- if (param.equals_ci("ON"))
- {
- nc->SetFlag(NI_SECURE);
- source.Reply(_("Secure option is now \002on\002 for \002%s\002."), nc->display.c_str());
- }
- else if (param.equals_ci("OFF"))
- {
- nc->UnsetFlag(NI_SECURE);
- source.Reply(_("Secure option is now \002off\002 for \002%s\002."), nc->display.c_str());
- }
- else
- this->OnSyntaxError(source, "SECURE");
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->Run(source, source.nc->display, params[0]);
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Turns %s's security features on or off for your\n"
- "nick. With \002SECURE\002 set, you must enter your password\n"
- "before you will be recognized as the owner of the nick,\n"
- "regardless of whether your address is on the access\n"
- "list. However, if you are on the access list, %s\n"
- "will not auto-kill you regardless of the setting of the\n"
- "\002KILL\002 option."), Config->NickServ.c_str(), Config->NickServ.c_str());
- return true;
- }
-};
-
-class CommandNSSASetSecure : public CommandNSSetSecure
-{
- public:
- CommandNSSASetSecure(Module *creator) : CommandNSSetSecure(creator, "nickserv/saset/secure", 2)
- {
- this->ClearSyntax();
- this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
- }
-
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
- {
- this->Run(source, params[0], params[1]);
- }
-
- bool OnHelp(CommandSource &source, const Anope::string &) anope_override
- {
- this->SendSyntax(source);
- source.Reply(" ");
- source.Reply(_("Turns %s's security features on or off for your\n"
- "nick. With \002SECURE\002 set, you must enter your password\n"
- "before you will be recognized as the owner of the nick,\n"
- "regardless of whether your address is on the access\n"
- "list. However, if you are on the access list, %s\n"
- "will not auto-kill you regardless of the setting of the\n"
- "\002KILL\002 option."), Config->NickServ.c_str(), Config->NickServ.c_str());
- return true;
- }
-};
-
-class NSSetSecure : public Module
-{
- CommandNSSetSecure commandnssetsecure;
- CommandNSSASetSecure commandnssasetsecure;
-
- public:
- NSSetSecure(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
- commandnssetsecure(this), commandnssasetsecure(this)
- {
- this->SetAuthor("Anope");
-
- }
-};
-
-MODULE_INIT(NSSetSecure)
diff --git a/modules/extra/m_statusupdate.cpp b/modules/extra/cs_statusupdate.cpp
index 41ea8833e..41ea8833e 100644
--- a/modules/extra/m_statusupdate.cpp
+++ b/modules/extra/cs_statusupdate.cpp
diff --git a/modules/extra/ns_maxemail.cpp b/modules/extra/ns_maxemail.cpp
index 121da057b..356721e03 100644
--- a/modules/extra/ns_maxemail.cpp
+++ b/modules/extra/ns_maxemail.cpp
@@ -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"