mirror of
https://github.com/anope/anope.git
synced 2026-06-12 22:34:46 +02:00
Compare commits
78 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 258daf6c26 | |||
| 57e8b4305e | |||
| db4f845fe7 | |||
| d15ac93a8f | |||
| 4e0f94bcce | |||
| 1c1645096f | |||
| e0ac5509b4 | |||
| 190c37a68b | |||
| a67bef2dee | |||
| 893bbf9251 | |||
| 5441093211 | |||
| ee7455daa8 | |||
| 579af3c442 | |||
| 25bdcfcbc4 | |||
| 26919f41d2 | |||
| 5f735b2570 | |||
| 9c80f9e34e | |||
| b5b3c74477 | |||
| 73d4ac6de0 | |||
| 7640fad30c | |||
| 9f6d378755 | |||
| 642e68f53a | |||
| eb658f87a3 | |||
| 1e87849e5c | |||
| 5fa4acb195 | |||
| 79f215606d | |||
| 2fd4b45f81 | |||
| d3b4a4bd05 | |||
| d914febbec | |||
| 2962a0be8c | |||
| 6be4df3b39 | |||
| 4789751e50 | |||
| 57674f5869 | |||
| c6cb4ba159 | |||
| e341cac8d6 | |||
| 83dd96b9f2 | |||
| cabaa079df | |||
| 273e7f249c | |||
| 8c9ca23900 | |||
| 8e3da86283 | |||
| 97b65b2255 | |||
| b26f198489 | |||
| a99a00d7c5 | |||
| 283137841f | |||
| 3290ebd36a | |||
| c4e9c0bf85 | |||
| 84ad85ee85 | |||
| 9789c3bd8c | |||
| a75afb597b | |||
| f93d9e7698 | |||
| 7423fa9998 | |||
| 7cba665270 | |||
| 9502567453 | |||
| 14472c5a95 | |||
| d4f4bcf23c | |||
| 82fa7e1467 | |||
| aefbb4fbda | |||
| 9b77fdf5b6 | |||
| 7a6979c814 | |||
| c4ab550ec7 | |||
| 3ecf6b495b | |||
| 8475697e3b | |||
| 85687781d1 | |||
| ccfaca32a2 | |||
| 07373c8cf2 | |||
| 89594d4557 | |||
| b478a1cb53 | |||
| 1fb77e414d | |||
| 22fe5bb724 | |||
| 909b9b2679 | |||
| 49ea709027 | |||
| 4ea2bc5e46 | |||
| eabc8b641e | |||
| 2f1ed186d1 | |||
| 4cc68397dc | |||
| 2b7872139c | |||
| e47ad6ed3f | |||
| f3b14694c6 |
+7
-24
@@ -170,7 +170,7 @@ if(MSVC)
|
||||
string(REPLACE "/GX " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
string(REPLACE "/W3 " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
# Set the compile flags to have warnings on the max setting (but disable a few annoying ones), exception handling turned on, the proper defines
|
||||
set(CXXFLAGS "${CXXFLAGS} /W4 /wd4100 /wd4127 /wd4250 /wd4251 /wd4355 /wd4706 /wd4800 /wd4996 /EHs")
|
||||
set(CXXFLAGS "${CXXFLAGS} /W4 /wd4100 /wd4127 /wd4250 /wd4251 /wd4267 /wd4275 /wd4355 /wd4706 /wd4800 /wd4996 /EHs")
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
# Otherwise, we're not using Visual Studio
|
||||
else()
|
||||
@@ -183,6 +183,12 @@ if(CMAKE_DL_LIBS)
|
||||
list(APPEND LINK_LIBS ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
||||
# Find the linker flags required for using threads.
|
||||
find_package("Threads" REQUIRED)
|
||||
if(CMAKE_THREAD_LIBS_INIT)
|
||||
list(APPEND LINK_LIBS ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif()
|
||||
|
||||
# Under MinGW, the -shared flag isn't properly set in the module-specific linker flags, add it from the C flags for shared libraries
|
||||
if(MINGW)
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
|
||||
@@ -200,29 +206,6 @@ if(NOT MSVC)
|
||||
if(HAVE_PIPE_FLAG)
|
||||
set(CXXFLAGS "${CXXFLAGS} -pipe")
|
||||
endif()
|
||||
|
||||
# The following are additional library checks, they are not required for Windows
|
||||
if(NOT WIN32)
|
||||
# Check if socket is within the socket library (if the library exists), and add it to the linker flags if needed
|
||||
check_library_exists(socket socket "" HAVE_SOCKET_LIB)
|
||||
if(HAVE_SOCKET_LIB)
|
||||
list(APPEND LINK_LIBS socket)
|
||||
endif()
|
||||
# Check if inet_addr is within the nsl library (if the library exists), and add it to the linker flags if needed
|
||||
check_library_exists(nsl inet_addr "" HAVE_NSL_LIB)
|
||||
if(HAVE_NSL_LIB)
|
||||
list(APPEND LINK_LIBS nsl)
|
||||
endif()
|
||||
# Check if pthread_create is within the pthread library (if the library exists), and add it to the linker flags if needed
|
||||
check_library_exists(pthread pthread_create "" HAVE_PTHREAD)
|
||||
if(HAVE_PTHREAD)
|
||||
if(NOT APPLE)
|
||||
set(LDFLAGS "${LDFLAGS} -pthread")
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "The pthread library is required to build Anope")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# If DEFUMASK wasn't passed to CMake, set a default depending on if RUNGROUP was passed in or not
|
||||
|
||||
+21
-15
@@ -302,30 +302,31 @@ networkinfo
|
||||
/*
|
||||
* Set this to the maximum allowed nick length on your network.
|
||||
* Be sure to set this correctly, as setting this wrong can result in
|
||||
* Anope being disconnected from the network.
|
||||
* Anope being disconnected from the network. Defaults to 31.
|
||||
*/
|
||||
nicklen = 31
|
||||
#nicklen = 31
|
||||
|
||||
/* Set this to the maximum allowed ident length on your network.
|
||||
* Be sure to set this correctly, as setting this wrong can result in
|
||||
* Anope being disconnected from the network.
|
||||
* Anope being disconnected from the network. Defaults to 10.
|
||||
*/
|
||||
userlen = 10
|
||||
#userlen = 10
|
||||
|
||||
/* Set this to the maximum allowed hostname length on your network.
|
||||
* Be sure to set this correctly, as setting this wrong can result in
|
||||
* Anope being disconnected from the network.
|
||||
* Anope being disconnected from the network. Defaults to 64.
|
||||
*/
|
||||
hostlen = 64
|
||||
#hostlen = 64
|
||||
|
||||
/* Set this to the maximum allowed channel length on your network.
|
||||
* Defaults to 32.
|
||||
*/
|
||||
chanlen = 32
|
||||
#chanlen = 32
|
||||
|
||||
/* The maximum number of list modes settable on a channel (such as b, e, I).
|
||||
* Comment out or set to 0 to disable.
|
||||
* Set to 0 to disable. Defaults to 100.
|
||||
*/
|
||||
modelistsize = 100
|
||||
#modelistsize = 100
|
||||
|
||||
/*
|
||||
* Characters allowed in nicknames. This always includes the characters described
|
||||
@@ -522,6 +523,12 @@ options
|
||||
*/
|
||||
hideregisteredcommands = yes
|
||||
|
||||
/*
|
||||
* If set, the maximum difference between an invalid and valid command name to allow
|
||||
* as a suggestion. Defaults to 4.
|
||||
*/
|
||||
didyoumeandifference = 4
|
||||
|
||||
/* The regex engine to use, as provided by the regex modules.
|
||||
* Leave commented to disable regex matching.
|
||||
*
|
||||
@@ -748,7 +755,6 @@ log
|
||||
* You may define groups of commands and privileges, as well as who may use them.
|
||||
*
|
||||
* This block is recommended, as without it you will be unable to access most oper commands.
|
||||
* It replaces the old ServicesRoot directive amongst others.
|
||||
*
|
||||
* The command names below are defaults and are configured in the *serv.conf's. If you configure
|
||||
* additional commands with permissions, such as commands from third party modules, the permissions
|
||||
@@ -766,9 +772,9 @@ log
|
||||
* memoserv/info - Can see any information with /MEMOSERV INFO
|
||||
* memoserv/set-limit - Can set the limit of max stored memos on any user and channel
|
||||
* memoserv/no-limit - Can send memos through limits and throttles
|
||||
* nickserv/access - Can modify other users access and certificate lists
|
||||
* nickserv/alist - Can see the channel access list of other users
|
||||
* nickserv/auspex - Can see any information with /NICKSERV INFO
|
||||
* nickserv/cert - Can modify other users certificate lists
|
||||
* nickserv/confirm - Can confirm other users nicknames
|
||||
* nickserv/drop - Can drop other users nicks
|
||||
* nickserv/recover - Can recover other users nicks
|
||||
@@ -789,10 +795,10 @@ log
|
||||
*
|
||||
* nickserv/getemail nickserv/suspend nickserv/ajoin nickserv/list
|
||||
*
|
||||
* nickserv/saset/autoop nickserv/saset/email nickserv/saset/greet nickserv/saset/password
|
||||
* nickserv/saset/display nickserv/saset/kill nickserv/saset/language nickserv/saset/message
|
||||
* nickserv/saset/private nickserv/saset/secure nickserv/saset/url nickserv/saset/noexpire
|
||||
* nickserv/saset/keepmodes nickserv/saset/neverop
|
||||
* nickserv/saset/autoop nickserv/saset/display nickserv/saset/email nickserv/saset/greet
|
||||
* nickserv/saset/kill nickserv/saset/keepmodes nickserv/saset/language nickserv/saset/message
|
||||
* nickserv/saset/neverop nickserv/saset/noexpire nickserv/saset/password nickserv/saset/private
|
||||
* nickserv/saset/url
|
||||
*
|
||||
* hostserv/set hostserv/del hostserv/list
|
||||
*
|
||||
|
||||
@@ -76,8 +76,6 @@ module
|
||||
* access level or superior
|
||||
* - cs_private: Hide the channel from ChanServ's LIST command
|
||||
* - restricted: Kick/ban users who are restricted from the channel
|
||||
* - cs_secure: Enable channel security, requiring the user to be identified with NickServ in
|
||||
* order to be considered for being on the access list of the channel
|
||||
* - secureops: Only allow operator status to be given if the user is on the access list
|
||||
* - securefounder: Only allow the real founder of the channel to drop the channel, change its
|
||||
* password, or change the founder or successor
|
||||
@@ -93,10 +91,10 @@ module
|
||||
* to be a registered nick, otherwise the channel will be dropped.
|
||||
* - none: No defaults
|
||||
*
|
||||
* This directive is optional, if left blank, the options will default to keeptopic, peace, cs_secure,
|
||||
* This directive is optional, if left blank, the options will default to keeptopic, peace,
|
||||
* securefounder, and signkick. If you really want no defaults, use "none" by itself as the option.
|
||||
*/
|
||||
defaults = "keeptopic peace cs_secure securefounder signkick"
|
||||
defaults = "keeptopic peace securefounder signkick"
|
||||
|
||||
/*
|
||||
* The maximum number of channels which may be registered to a single nickname.
|
||||
|
||||
@@ -783,7 +783,7 @@ module { name = "sasl" }
|
||||
* xmlrpc
|
||||
*
|
||||
* Allows remote applications (websites) to execute queries in real time to retrieve data from Anope.
|
||||
* By itself this module does nothing, but allows other modules (m_xmlrpc_main) to receive and send XMLRPC queries.
|
||||
* By itself this module does nothing, but allows other modules (xmlrpc_main) to receive and send XMLRPC queries.
|
||||
*/
|
||||
#module
|
||||
{
|
||||
|
||||
@@ -96,8 +96,6 @@ module
|
||||
* option and the killprotect option must be specified with this one
|
||||
* - kill_immed: Kill nick immediately if not identified, this one overrides both the killprotect
|
||||
* and kill_quick options and the killprotect option must be specified with this one
|
||||
* - ns_secure: Enable nickname security, requiring the nick's password before any operations
|
||||
* can be done on it
|
||||
* - ns_private: Hide the nick from NickServ's LIST command
|
||||
* - hide_email: Hide the nick's e-mail address from NickServ's INFO command
|
||||
* - hide_mask: Hide the nick's last or current user@host from NickServ's INFO command
|
||||
@@ -112,10 +110,10 @@ module
|
||||
* to be enabled as well
|
||||
* - ns_keep_modes: Enables keepmodes, which retains user modes across sessions
|
||||
*
|
||||
* This directive is optional, if left blank, the options will default to ns_secure, memo_signon, and
|
||||
* This directive is optional, if left blank, the options will default to memo_signon, and
|
||||
* memo_receive. If you really want no defaults, use "none" by itself as the option.
|
||||
*/
|
||||
defaults = "killprotect ns_secure ns_private hide_email hide_mask memo_signon memo_receive autoop"
|
||||
defaults = "killprotect ns_private hide_email hide_mask memo_signon memo_receive autoop"
|
||||
|
||||
/*
|
||||
* The minimum length of time between consecutive uses of NickServ's REGISTER command. This
|
||||
@@ -211,16 +209,16 @@ module
|
||||
/*
|
||||
* The minimum length of passwords
|
||||
*
|
||||
* This directive is optional. If not set it defaults to 8.
|
||||
* This directive is optional. If not set it defaults to 10.
|
||||
*/
|
||||
minpasslen = 8
|
||||
minpasslen = 10
|
||||
|
||||
/*
|
||||
* The maximum length of passwords
|
||||
*
|
||||
* This directive is optional. If not set it defaults to 32.
|
||||
* This directive is optional. If not set it defaults to 50.
|
||||
*/
|
||||
maxpasslen = 32
|
||||
maxpasslen = 50
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -248,33 +246,6 @@ command_group
|
||||
/* Give it a help command. */
|
||||
command { service = "NickServ"; name = "HELP"; command = "generic/help"; }
|
||||
|
||||
/*
|
||||
* ns_access
|
||||
*
|
||||
* Provides the command nickserv/access.
|
||||
*
|
||||
* Used for configuring what hosts have access to your account.
|
||||
*/
|
||||
module
|
||||
{
|
||||
name = "ns_access"
|
||||
|
||||
/*
|
||||
* The maximum number of entries allowed on a nickname's access list.
|
||||
* If not set, the default is 32. This number cannot be set to 0.
|
||||
*/
|
||||
accessmax = 32
|
||||
|
||||
/*
|
||||
* If set, Anope will add the usermask of registering users to the access list of their
|
||||
* newly created account. If not set, users will always have to identify to NickServ before
|
||||
* being recognized, unless they manually add an address to the access list of their account.
|
||||
* This directive is optional.
|
||||
*/
|
||||
addaccessonreg = no
|
||||
}
|
||||
command { service = "NickServ"; name = "ACCESS"; command = "nickserv/access"; }
|
||||
|
||||
/*
|
||||
* ns_ajoin
|
||||
*
|
||||
@@ -530,10 +501,9 @@ command { service = "NickServ"; name = "RESETPASS"; command = "nickserv/resetpas
|
||||
* 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 password.
|
||||
* nickserv/set/secure, nickserv/saset/secure - Used for configuring whether a user can identify by simply being recognized by nickserv/access.
|
||||
* nickserv/set/neverop, nickserv/saset/neverop - Used to configure whether a user can be added to access lists
|
||||
* nickserv/saset/noexpire - Used for configuring noexpire, which prevents nicks from expiring.
|
||||
* nickserv/set/password, nickserv/saset/password - Used for changing a users password.
|
||||
*/
|
||||
module
|
||||
{
|
||||
@@ -574,9 +544,6 @@ command { service = "NickServ"; name = "SASET MESSAGE"; command = "nickserv/sase
|
||||
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 SECURE"; command = "nickserv/set/secure"; }
|
||||
command { service = "NickServ"; name = "SASET SECURE"; command = "nickserv/saset/secure"; permission = "nickserv/saset/secure"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET NEVEROP"; command = "nickserv/set/neverop"; }
|
||||
command { service = "NickServ"; name = "SASET NEVEROP"; command = "nickserv/saset/neverop"; permission = "nickserv/saset/neverop"; }
|
||||
|
||||
@@ -601,17 +568,6 @@ command { service = "NickServ"; name = "SASET URL"; command = "nickserv/saset/mi
|
||||
#command { service = "NickServ"; name = "SET MASTODON"; command = "nickserv/set/misc"; misc_description = _("Associate a Mastodon account with your account"); }
|
||||
#command { service = "NickServ"; name = "SASET MASTODON"; command = "nickserv/saset/misc"; misc_description = _("Associate a Mastodon account with this account"); permission = "nickserv/saset/mastodon"; group = "nickserv/admin"; }
|
||||
|
||||
|
||||
/*
|
||||
* ns_status
|
||||
*
|
||||
* Provides the nickserv/status command.
|
||||
*
|
||||
* Used to determine if a user is recognized or identified by services.
|
||||
*/
|
||||
module { name = "ns_status" }
|
||||
command { service = "NickServ"; name = "STATUS"; command = "nickserv/status"; }
|
||||
|
||||
/*
|
||||
* ns_suspend
|
||||
*
|
||||
|
||||
@@ -283,25 +283,26 @@ networkinfo
|
||||
/*
|
||||
* Set this to the maximum allowed nick length on your network.
|
||||
* Be sure to set this correctly, as setting this wrong can result in
|
||||
* Anope being disconnected from the network.
|
||||
* Anope being disconnected from the network. Defaults to 31.
|
||||
*/
|
||||
nicklen = 31
|
||||
#nicklen = 31
|
||||
|
||||
/* Set this to the maximum allowed ident length on your network.
|
||||
* Be sure to set this correctly, as setting this wrong can result in
|
||||
* Anope being disconnected from the network.
|
||||
* Anope being disconnected from the network. Defaults to 10.
|
||||
*/
|
||||
userlen = 10
|
||||
#userlen = 10
|
||||
|
||||
/* Set this to the maximum allowed hostname length on your network.
|
||||
* Be sure to set this correctly, as setting this wrong can result in
|
||||
* Anope being disconnected from the network.
|
||||
* Anope being disconnected from the network. Defaults to 64.
|
||||
*/
|
||||
hostlen = 64
|
||||
#hostlen = 64
|
||||
|
||||
/* Set this to the maximum allowed channel length on your network.
|
||||
* Defaults to 64.
|
||||
*/
|
||||
chanlen = 32
|
||||
#chanlen = 32
|
||||
|
||||
/* The maximum number of list modes settable on a channel (such as b, e, I).
|
||||
* Comment out or set to 0 to disable.
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
Anope Version 2.1.3
|
||||
-------------------
|
||||
Added alternate command suggestions when a user runs an invalid command.
|
||||
Added support for the IRCv3 +draft/channel-context tag.
|
||||
Added support for the IRCv3 +draft/reply tag.
|
||||
Allow using more than one fingerprint in an oper block.
|
||||
Changed chanserv/drop to use confirmation codes to confirm a channel drop.
|
||||
Cleaned up more of the codebase to use Modern C++17.
|
||||
Enabled using more field limits sent by the IRC server instead of requiring the user to configure them.
|
||||
Fixed NickServ lying about the minimum password length.
|
||||
Fixed a crash when sending emails.
|
||||
Fixed bs_kick not using the correct kick message for automatic kicks.
|
||||
Increased the security of randomly generated confirmation codes.
|
||||
Removed the ns_access module and associated cs_secure and ns_secure options.
|
||||
Removed the ns_status module.
|
||||
Reworked how messages are sent in protocol modules to allow sending message tags.
|
||||
|
||||
Anope Version 2.1.2
|
||||
-------------------
|
||||
Bumped the minimum OpenSSL version to 1.1.0.
|
||||
|
||||
+24
-4
@@ -1,9 +1,29 @@
|
||||
Anope Version 2.1.3
|
||||
-------------------
|
||||
Added options:didyoumeandifference.
|
||||
Added support for multiple SSL fingerprints in oper:certfp.
|
||||
Added the chanserv/cert oper privilege for modifying other user's certificate lists.
|
||||
Changed networkinfo:chanlen to default to 32 if not set.
|
||||
Changed networkinfo:hostlen to default to 64 if not set.
|
||||
Changed networkinfo:modelistsize to default to 100 if not set.
|
||||
Changed networkinfo:nicklen to default to 31 if not set.
|
||||
Changed networkinfo:userlen to default to 10 if not set.
|
||||
Increased the default maximum password length to 50 characters.
|
||||
Increased the default minimum password length to 10 characters.
|
||||
Removed the cs_secure option in module:defaults from the chanserv module (now always enabled).
|
||||
Removed the nickserv/saset/secure command.
|
||||
Removed the nickserv/saset/secure oper privilege.
|
||||
Removed the nickserv/set/secure command.
|
||||
Removed the nickserv/status command.
|
||||
Removed the ns_access module.
|
||||
Removed the ns_secure option in module:defaults from the nickserv module (now always enabled).
|
||||
|
||||
Anope Version 2.1.2
|
||||
-------------------
|
||||
Added module:tlsv10 to m_ssl_openssl for configuring whether TLSv1.0 is usable (defaults to no).
|
||||
Added module:tlsv11 to m_ssl_openssl for configuring whether TLSv1.0 is usable (defaults to yes).
|
||||
Added module:tlsv12 to m_ssl_openssl for configuring whether TLSv1.0 is usable (defaults to yes)
|
||||
Removed module:sslv3 from m_ssl_openssl.
|
||||
Added module:tlsv10 to the ssl_openssl module for configuring whether TLSv1.0 is usable (defaults to no).
|
||||
Added module:tlsv11 to the ssl_openssl module for configuring whether TLSv1.1 is usable (defaults to yes).
|
||||
Added module:tlsv12 to the ssl_openssl module for configuring whether TLSv1.2 is usable (defaults to yes).
|
||||
Removed module:sslv3 from the ssl_openssl module (now always disabled).
|
||||
Removed the m_ prefix from the names of the chanstats, dns, dnsbl, helpchan, httpd, ldap, ldap_oper, mysql, proxyscan, redis, regex_pcre2, regex_posix, regex_stdlib, regex_tre, rewrite, sasl, sql_log, sql_oper, sqlite, ssl_gnutls, ssl_openssl, xmlrpc, and xmlrpc_main modules.
|
||||
|
||||
Anope Version 2.1.1
|
||||
|
||||
+2
-2
@@ -98,7 +98,7 @@ public:
|
||||
NickCore *GetAccount() const;
|
||||
|
||||
void Serialize(Serialize::Data &data) const override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
static const unsigned int MAX_DEPTH = 4;
|
||||
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
* @param nc The account
|
||||
* @param next Next channel to check if any
|
||||
*/
|
||||
virtual bool Matches(const User *u, const NickCore *nc, ChannelInfo* &next) const;
|
||||
virtual bool Matches(const User *u, const NickCore *nc, ChannelInfo *&next) const;
|
||||
|
||||
/** Check if this access entry has the given privilege.
|
||||
* @param name The privilege name
|
||||
|
||||
+8
-58
@@ -56,7 +56,7 @@ public:
|
||||
~NickAlias();
|
||||
|
||||
void Serialize(Serialize::Data &data) const override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
/** Set a vhost for the user
|
||||
* @param ident The ident
|
||||
@@ -85,6 +85,11 @@ public:
|
||||
*/
|
||||
const Anope::string &GetVhostHost() const;
|
||||
|
||||
/** Retrieve the vhost mask
|
||||
* @param the mask
|
||||
*/
|
||||
Anope::string GetVhostMask() const;
|
||||
|
||||
/** Retrieve the vhost creator
|
||||
* @return the creator
|
||||
*/
|
||||
@@ -122,9 +127,6 @@ public:
|
||||
Anope::string email;
|
||||
/* Locale name of the language of the user. Empty means default language */
|
||||
Anope::string language;
|
||||
/* Access list, contains user@host masks of users who get certain privileges based
|
||||
* on if NI_SECURE is set and what (if any) kill protection is enabled. */
|
||||
std::vector<Anope::string> access;
|
||||
MemoInfo memos;
|
||||
std::map<Anope::string, Anope::string> last_modes;
|
||||
|
||||
@@ -153,7 +155,7 @@ public:
|
||||
~NickCore();
|
||||
|
||||
void Serialize(Serialize::Data &data) const override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
/** Changes the display for this account
|
||||
* @param na The new display, must be grouped to this account.
|
||||
@@ -165,66 +167,14 @@ public:
|
||||
*/
|
||||
virtual bool IsServicesOper() const;
|
||||
|
||||
/** Add an entry to the nick's access list
|
||||
*
|
||||
* @param entry The nick!ident@host entry to add to the access list
|
||||
*
|
||||
* Adds a new entry into the access list.
|
||||
*/
|
||||
void AddAccess(const Anope::string &entry);
|
||||
|
||||
/** Get an entry from the nick's access list by index
|
||||
*
|
||||
* @param entry Index in the access list vector to retrieve
|
||||
* @return The access list entry of the given index if within bounds, an empty string if the vector is empty or the index is out of bounds
|
||||
*
|
||||
* Retrieves an entry from the access list corresponding to the given index.
|
||||
*/
|
||||
Anope::string GetAccess(unsigned entry) const;
|
||||
|
||||
/** Get the number of entries on the access list for this account.
|
||||
*/
|
||||
unsigned GetAccessCount() const;
|
||||
|
||||
/** Retrieves the account id for this user */
|
||||
uint64_t GetId();
|
||||
|
||||
/** Find an entry in the nick's access list
|
||||
*
|
||||
* @param entry The nick!ident@host entry to search for
|
||||
* @return True if the entry is found in the access list, false otherwise
|
||||
*
|
||||
* Search for an entry within the access list.
|
||||
*/
|
||||
bool FindAccess(const Anope::string &entry);
|
||||
|
||||
/** Erase an entry from the nick's access list
|
||||
*
|
||||
* @param entry The nick!ident@host entry to remove
|
||||
*
|
||||
* Removes the specified access list entry from the access list.
|
||||
*/
|
||||
void EraseAccess(const Anope::string &entry);
|
||||
|
||||
/** Clears the entire nick's access list
|
||||
*
|
||||
* Deletes all the memory allocated in the access list vector and then clears the vector.
|
||||
*/
|
||||
void ClearAccess();
|
||||
|
||||
/** Is the given user on this accounts access list?
|
||||
*
|
||||
* @param u The user
|
||||
*
|
||||
* @return true if the user is on the access list
|
||||
*/
|
||||
bool IsOnAccess(const User *u) const;
|
||||
|
||||
/** Finds an account
|
||||
* @param nick The account name to find
|
||||
* @return The account, if it exists
|
||||
*/
|
||||
static NickCore* Find(const Anope::string &nick);
|
||||
static NickCore *Find(const Anope::string &nick);
|
||||
|
||||
void AddChannelReference(ChannelInfo *ci);
|
||||
void RemoveChannelReference(ChannelInfo *ci);
|
||||
|
||||
+22
-11
@@ -140,8 +140,8 @@ namespace Anope
|
||||
*/
|
||||
inline void push_back(char c) { return this->_string.push_back(c); }
|
||||
|
||||
inline string& append(const string &s) { this->_string.append(s.str()); return *this; }
|
||||
inline string& append(const char *s, size_t n) { this->_string.append(s, n); return *this; }
|
||||
inline string &append(const string &s) { this->_string.append(s.str()); return *this; }
|
||||
inline string &append(const char *s, size_t n) { this->_string.append(s, n); return *this; }
|
||||
|
||||
/**
|
||||
* Resizes the string content to n characters.
|
||||
@@ -159,21 +159,21 @@ namespace Anope
|
||||
* Trim leading and trailing white spaces from the string.
|
||||
*/
|
||||
|
||||
inline string& ltrim(const Anope::string &what = " \t\r\n")
|
||||
inline string <rim(const Anope::string &what = " \t\r\n")
|
||||
{
|
||||
while (!this->_string.empty() && what.find(this->_string[0]) != Anope::string::npos)
|
||||
this->_string.erase(this->_string.begin());
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline string& rtrim(const Anope::string &what = " \t\r\n")
|
||||
inline string &rtrim(const Anope::string &what = " \t\r\n")
|
||||
{
|
||||
while (!this->_string.empty() && what.find(this->_string[this->_string.length() - 1]) != Anope::string::npos)
|
||||
this->_string.erase(this->_string.length() - 1);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline string& trim(const Anope::string &what = " \t\r\n")
|
||||
inline string &trim(const Anope::string &what = " \t\r\n")
|
||||
{
|
||||
this->ltrim(what);
|
||||
this->rtrim(what);
|
||||
@@ -210,9 +210,9 @@ namespace Anope
|
||||
inline size_type find_last_not_of(const string &_str, size_type pos = npos) const { return this->_string.find_last_not_of(_str._string, pos); }
|
||||
inline size_type find_last_not_of_ci(const string &_str, size_type pos = npos) const { return ci::string(this->_string.c_str()).find_last_not_of(ci::string(_str._string.c_str()), pos); }
|
||||
|
||||
inline int compare(size_t pos, size_t len, const string& str) const { return ci::string(this->_string.c_str()).compare(pos, len, ci::string(str.c_str())); }
|
||||
inline int compare(size_t pos, size_t len, const string& str, size_t subpos, size_type sublen = npos) const { return ci::string(this->_string.c_str()).compare(pos, len, ci::string(str.c_str()), subpos, sublen); }
|
||||
inline int compare(size_t pos, size_t len, const char* s, size_type n = npos) const { return ci::string(this->_string.c_str()).compare(pos, len, s, n); }
|
||||
inline int compare(size_t pos, size_t len, const string &str) const { return ci::string(this->_string.c_str()).compare(pos, len, ci::string(str.c_str())); }
|
||||
inline int compare(size_t pos, size_t len, const string &str, size_t subpos, size_type sublen = npos) const { return ci::string(this->_string.c_str()).compare(pos, len, ci::string(str.c_str()), subpos, sublen); }
|
||||
inline int compare(size_t pos, size_t len, const char *s, size_type n = npos) const { return ci::string(this->_string.c_str()).compare(pos, len, s, n); }
|
||||
|
||||
/**
|
||||
* Determine if string consists of only numbers.
|
||||
@@ -495,7 +495,7 @@ namespace Anope
|
||||
/** Return the last error, uses errno/GetLastError() to determine this
|
||||
* @return An error message
|
||||
*/
|
||||
extern CoreExport const string LastError();
|
||||
extern CoreExport string LastError();
|
||||
|
||||
/** Determines if a path is a file
|
||||
*/
|
||||
@@ -557,6 +557,12 @@ namespace Anope
|
||||
* @param len The length of the string returned
|
||||
*/
|
||||
extern CoreExport Anope::string Random(size_t len);
|
||||
|
||||
/** Calculates the levenshtein distance between two strings.
|
||||
* @param s1 The first string.
|
||||
* @param s2 The second string.
|
||||
*/
|
||||
extern CoreExport size_t Distance(const Anope::string &s1, const Anope::string &s2);
|
||||
}
|
||||
|
||||
/** sepstream allows for splitting token separated lists.
|
||||
@@ -600,7 +606,7 @@ public:
|
||||
/** Gets every token from this stream
|
||||
* @param token Tokens are pushed back here
|
||||
*/
|
||||
template<typename T> void GetTokens(T& token)
|
||||
template<typename T> void GetTokens(T &token)
|
||||
{
|
||||
token.clear();
|
||||
Anope::string t;
|
||||
@@ -623,7 +629,7 @@ public:
|
||||
/** Fetch the entire remaining stream, without tokenizing
|
||||
* @return The remaining part of the stream
|
||||
*/
|
||||
const Anope::string GetRemaining();
|
||||
Anope::string GetRemaining();
|
||||
|
||||
/** Returns true if the end of the stream has been reached
|
||||
* @return True if the end of the stream has been reached, otherwise false
|
||||
@@ -728,6 +734,11 @@ public:
|
||||
|
||||
/** Convert something to a string
|
||||
*/
|
||||
inline Anope::string stringify(const Anope::string &x)
|
||||
{
|
||||
return x;
|
||||
}
|
||||
|
||||
template<typename T> inline Anope::string stringify(const T &x)
|
||||
{
|
||||
std::ostringstream stream;
|
||||
|
||||
+2
-2
@@ -103,14 +103,14 @@ public:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inline T* operator->()
|
||||
inline T *operator->()
|
||||
{
|
||||
if (operator bool())
|
||||
return this->ref;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inline T* operator*()
|
||||
inline T *operator*()
|
||||
{
|
||||
if (operator bool())
|
||||
return this->ref;
|
||||
|
||||
+5
-4
@@ -56,7 +56,7 @@ public:
|
||||
virtual ~BotInfo();
|
||||
|
||||
void Serialize(Serialize::Data &data) const;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
void GenerateUID();
|
||||
|
||||
@@ -108,8 +108,9 @@ public:
|
||||
/** Called when a user messages this bot
|
||||
* @param u The user
|
||||
* @param message The users' message
|
||||
* @params tags Message tags
|
||||
*/
|
||||
virtual void OnMessage(User *u, const Anope::string &message);
|
||||
virtual void OnMessage(User *u, const Anope::string &message, const Anope::map<Anope::string> &tags);
|
||||
|
||||
/** Link a command name to a command in services
|
||||
* @param cname The command name
|
||||
@@ -117,7 +118,7 @@ public:
|
||||
* @param permission Permission required to execute the command, if any
|
||||
* @return The commandinfo for the newly created command
|
||||
*/
|
||||
CommandInfo& SetCommand(const Anope::string &cname, const Anope::string &sname, const Anope::string &permission = "");
|
||||
CommandInfo &SetCommand(const Anope::string &cname, const Anope::string &sname, const Anope::string &permission = "");
|
||||
|
||||
/** Get command info for a command
|
||||
* @param cname The command name
|
||||
@@ -130,5 +131,5 @@ public:
|
||||
* @param nick_only True to only look by nick, and not by UID
|
||||
* @return The bot, if it exists
|
||||
*/
|
||||
static BotInfo* Find(const Anope::string &nick, bool nick_only = false);
|
||||
static BotInfo *Find(const Anope::string &nick, bool nick_only = false);
|
||||
};
|
||||
|
||||
+2
-2
@@ -110,7 +110,7 @@ public:
|
||||
* @param status The status to give the user, if any
|
||||
* @return The UserContainer for the user
|
||||
*/
|
||||
ChanUserContainer* JoinUser(User *u, const ChannelStatus *status);
|
||||
ChanUserContainer *JoinUser(User *u, const ChannelStatus *status);
|
||||
|
||||
/** Remove a user internally from the channel
|
||||
* @param u The user
|
||||
@@ -302,7 +302,7 @@ public:
|
||||
* @param name The channel to find
|
||||
* @return The channel, if found
|
||||
*/
|
||||
static Channel* Find(const Anope::string &name);
|
||||
static Channel *Find(const Anope::string &name);
|
||||
|
||||
/** Finds or creates a channel
|
||||
* @param name The channel name
|
||||
|
||||
+6
-3
@@ -44,6 +44,7 @@ struct CoreExport CommandReply
|
||||
{
|
||||
virtual ~CommandReply() = default;
|
||||
virtual void SendMessage(BotInfo *source, const Anope::string &msg) = 0;
|
||||
virtual void SendMessage(CommandSource &source, const Anope::string &msg);
|
||||
};
|
||||
|
||||
/* The source for a command */
|
||||
@@ -61,15 +62,17 @@ public:
|
||||
/* Where the reply should go */
|
||||
CommandReply *reply;
|
||||
/* Channel the command was executed on (fantasy) */
|
||||
Reference<Channel> c;
|
||||
Reference<Channel> c = nullptr;
|
||||
/* The service this command is on */
|
||||
Reference<BotInfo> service;
|
||||
/* The actual name of the command being executed */
|
||||
Anope::string command;
|
||||
/* The permission of the command being executed */
|
||||
Anope::string permission;
|
||||
/* The unique identifier of the executing message. */
|
||||
Anope::string msgid;
|
||||
|
||||
CommandSource(const Anope::string &n, User *user, NickCore *core, CommandReply *reply, BotInfo *bi);
|
||||
CommandSource(const Anope::string &n, User *user, NickCore *core, CommandReply *reply, BotInfo *bi, const Anope::string &m = "");
|
||||
|
||||
const Anope::string &GetNick() const;
|
||||
User *GetUser();
|
||||
@@ -179,5 +182,5 @@ public:
|
||||
* @param name If found, is set to the command name, eg REGISTER
|
||||
* @return true if the given command service exists
|
||||
*/
|
||||
static bool FindCommandFromService(const Anope::string &command_service, BotInfo* &bi, Anope::string &name);
|
||||
static bool FindCommandFromService(const Anope::string &command_service, BotInfo *&bi, Anope::string &name);
|
||||
};
|
||||
|
||||
+4
-11
@@ -42,17 +42,10 @@ namespace Configuration
|
||||
Block(const Anope::string &);
|
||||
const Anope::string &GetName() const;
|
||||
int CountBlock(const Anope::string &name) const;
|
||||
const Block* GetBlock(const Anope::string &name, int num = 0) const;
|
||||
Block* GetMutableBlock(const Anope::string &name, int num = 0);
|
||||
const Block *GetBlock(const Anope::string &name, int num = 0) const;
|
||||
Block *GetMutableBlock(const Anope::string &name, int num = 0);
|
||||
|
||||
template<typename T> inline T Get(const Anope::string &tag) const
|
||||
{
|
||||
return this->Get<T>(tag, "");
|
||||
}
|
||||
/* VS 2008 has an issue with having a default argument here (def = ""), which is why the above
|
||||
* function exists.
|
||||
*/
|
||||
template<typename T> T Get(const Anope::string &tag, const Anope::string &def) const
|
||||
template<typename T> T Get(const Anope::string &tag, const Anope::string &def = "") const
|
||||
{
|
||||
const Anope::string &value = this->Get<const Anope::string>(tag, def);
|
||||
if (!value.empty())
|
||||
@@ -68,7 +61,7 @@ namespace Configuration
|
||||
const item_map &GetItems() const;
|
||||
};
|
||||
|
||||
template<> CoreExport const Anope::string Block::Get(const Anope::string &tag, const Anope::string& def) const;
|
||||
template<> CoreExport const Anope::string Block::Get(const Anope::string &tag, const Anope::string &def) const;
|
||||
template<> CoreExport time_t Block::Get(const Anope::string &tag, const Anope::string &def) const;
|
||||
template<> CoreExport bool Block::Get(const Anope::string &tag, const Anope::string &def) const;
|
||||
} // namespace Internal
|
||||
|
||||
+20
-20
@@ -41,12 +41,12 @@ public:
|
||||
|
||||
void UnsetExtensibles();
|
||||
|
||||
template<typename T> T* GetExt(const Anope::string &name) const;
|
||||
template<typename T> T *GetExt(const Anope::string &name) const;
|
||||
bool HasExt(const Anope::string &name) const;
|
||||
|
||||
template<typename T> T* Extend(const Anope::string &name, const T &what);
|
||||
template<typename T> T* Extend(const Anope::string &name);
|
||||
template<typename T> T* Require(const Anope::string &name);
|
||||
template<typename T> T *Extend(const Anope::string &name, const T &what);
|
||||
template<typename T> T *Extend(const Anope::string &name);
|
||||
template<typename T> T *Require(const Anope::string &name);
|
||||
template<typename T> void Shrink(const Anope::string &name);
|
||||
|
||||
static void ExtensibleSerialize(const Extensible *, const Serializable *, Serialize::Data &data);
|
||||
@@ -77,17 +77,17 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
T* Set(Extensible *obj, const T &value)
|
||||
T *Set(Extensible *obj, const T &value)
|
||||
{
|
||||
T* t = Set(obj);
|
||||
T *t = Set(obj);
|
||||
if (t)
|
||||
*t = value;
|
||||
return t;
|
||||
}
|
||||
|
||||
T* Set(Extensible *obj)
|
||||
T *Set(Extensible *obj)
|
||||
{
|
||||
T* t = Create(obj);
|
||||
T *t = Create(obj);
|
||||
Unset(obj);
|
||||
items[obj] = t;
|
||||
obj->extension_items.insert(this);
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
delete value;
|
||||
}
|
||||
|
||||
T* Get(const Extensible *obj) const
|
||||
T *Get(const Extensible *obj) const
|
||||
{
|
||||
std::map<Extensible *, void *>::const_iterator it = items.find(const_cast<Extensible *>(obj));
|
||||
if (it != items.end())
|
||||
@@ -115,9 +115,9 @@ public:
|
||||
return items.find(const_cast<Extensible *>(obj)) != items.end();
|
||||
}
|
||||
|
||||
T* Require(Extensible *obj)
|
||||
T *Require(Extensible *obj)
|
||||
{
|
||||
T* t = Get(obj);
|
||||
T *t = Get(obj);
|
||||
if (t)
|
||||
return t;
|
||||
|
||||
@@ -130,7 +130,7 @@ class ExtensibleItem
|
||||
: public BaseExtensibleItem<T>
|
||||
{
|
||||
protected:
|
||||
T* Create(Extensible *obj) override
|
||||
T *Create(Extensible *obj) override
|
||||
{
|
||||
return new T(obj);
|
||||
}
|
||||
@@ -143,7 +143,7 @@ class PrimitiveExtensibleItem
|
||||
: public BaseExtensibleItem<T>
|
||||
{
|
||||
protected:
|
||||
T* Create(Extensible *obj) override
|
||||
T *Create(Extensible *obj) override
|
||||
{
|
||||
return new T();
|
||||
}
|
||||
@@ -155,7 +155,7 @@ template<>
|
||||
class PrimitiveExtensibleItem<bool> : public BaseExtensibleItem<bool>
|
||||
{
|
||||
protected:
|
||||
bool* Create(Extensible *) override
|
||||
bool *Create(Extensible *) override
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -172,7 +172,7 @@ public:
|
||||
|
||||
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override
|
||||
{
|
||||
T* t = this->Get(e);
|
||||
T *t = this->Get(e);
|
||||
data[this->name] << *t;
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ struct ExtensibleRef final
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
T* Extensible::GetExt(const Anope::string &name) const
|
||||
T *Extensible::GetExt(const Anope::string &name) const
|
||||
{
|
||||
ExtensibleRef<T> ref(name);
|
||||
if (ref)
|
||||
@@ -227,16 +227,16 @@ T* Extensible::GetExt(const Anope::string &name) const
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T* Extensible::Extend(const Anope::string &name, const T &what)
|
||||
T *Extensible::Extend(const Anope::string &name, const T &what)
|
||||
{
|
||||
T* t = Extend<T>(name);
|
||||
T *t = Extend<T>(name);
|
||||
if (t)
|
||||
*t = what;
|
||||
return t;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T* Extensible::Extend(const Anope::string &name)
|
||||
T *Extensible::Extend(const Anope::string &name)
|
||||
{
|
||||
ExtensibleRef<T> ref(name);
|
||||
if (ref)
|
||||
@@ -247,7 +247,7 @@ T* Extensible::Extend(const Anope::string &name)
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T* Extensible::Require(const Anope::string &name)
|
||||
T *Extensible::Require(const Anope::string &name)
|
||||
{
|
||||
if (HasExt(name))
|
||||
return GetExt<T>(name);
|
||||
|
||||
+2
-4
@@ -90,8 +90,6 @@ namespace Language
|
||||
#define UNKNOWN _("<unknown>")
|
||||
#define NO_EXPIRE _("does not expire")
|
||||
#define LIST_INCORRECT_RANGE _("Incorrect range specified. The correct syntax is \002#\037from\037-\037to\037\002.")
|
||||
#define NICK_IS_REGISTERED _("This nick is owned by someone else. Please choose another.\n" \
|
||||
"(If this is your nick, type \002%s%s IDENTIFY \037password\037\002.)")
|
||||
#define NICK_IS_SECURE _("This nickname is registered and protected. If it is your\n" \
|
||||
"nick, type \002%s%s IDENTIFY \037password\037\002. Otherwise,\n" \
|
||||
"please choose a different nick.")
|
||||
@@ -124,7 +122,7 @@ namespace Language
|
||||
#define BOT_NOT_ON_CHANNEL _("Bot is not on channel \002%s\002.")
|
||||
#define HOST_SET_ERROR _("A vHost must be in the format of a valid hostname.")
|
||||
#define HOST_SET_IDENT_ERROR _("A vHost ident must be in the format of a valid ident.")
|
||||
#define HOST_SET_TOOLONG _("Error! The vHost is too long, please use a hostname shorter than %d characters.")
|
||||
#define HOST_SET_IDENTTOOLONG _("Error! The vHost ident is too long, please use an ident shorter than %d characters.")
|
||||
#define HOST_SET_TOOLONG _("Error! The vHost is too long, please use a hostname shorter than %zu characters.")
|
||||
#define HOST_SET_IDENTTOOLONG _("Error! The vHost ident is too long, please use an ident shorter than %zu characters.")
|
||||
#define HOST_NOT_ASSIGNED _("Please contact an Operator to get a vHost assigned to this nick.")
|
||||
#define HOST_NO_VIDENT _("Your IRCd does not support vIdent's, if this is incorrect, please report this as a possible bug")
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ public:
|
||||
~Memo();
|
||||
|
||||
void Serialize(Serialize::Data &data) const override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
Anope::string owner;
|
||||
/* When it was sent */
|
||||
|
||||
+16
-16
@@ -24,7 +24,7 @@ namespace Message
|
||||
struct CoreExport Away
|
||||
: IRCDMessage
|
||||
{
|
||||
Away(Module *creator, const Anope::string &mname = "AWAY") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Away(Module *creator, const Anope::string &mname = "AWAY") : IRCDMessage(creator, mname, 0) { SetFlag(FLAG_REQUIRE_USER); SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
@@ -32,7 +32,7 @@ namespace Message
|
||||
struct CoreExport Capab
|
||||
: IRCDMessage
|
||||
{
|
||||
Capab(Module *creator, const Anope::string &mname = "CAPAB") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Capab(Module *creator, const Anope::string &mname = "CAPAB") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
@@ -48,7 +48,7 @@ namespace Message
|
||||
struct CoreExport Invite
|
||||
: IRCDMessage
|
||||
{
|
||||
Invite(Module *creator, const Anope::string &mname = "INVITE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Invite(Module *creator, const Anope::string &mname = "INVITE") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_REQUIRE_USER); SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
@@ -56,7 +56,7 @@ namespace Message
|
||||
struct CoreExport Join
|
||||
: IRCDMessage
|
||||
{
|
||||
Join(Module *creator, const Anope::string &mname = "JOIN") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Join(Module *creator, const Anope::string &mname = "JOIN") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_REQUIRE_USER); SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace Message
|
||||
struct CoreExport Kick
|
||||
: IRCDMessage
|
||||
{
|
||||
Kick(Module *creator, const Anope::string &mname = "KICK") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Kick(Module *creator, const Anope::string &mname = "KICK") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
@@ -91,7 +91,7 @@ namespace Message
|
||||
struct CoreExport Mode
|
||||
: IRCDMessage
|
||||
{
|
||||
Mode(Module *creator, const Anope::string &mname = "MODE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Mode(Module *creator, const Anope::string &mname = "MODE") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
@@ -107,7 +107,7 @@ namespace Message
|
||||
struct CoreExport Notice
|
||||
: IRCDMessage
|
||||
{
|
||||
Notice(Module *creator, const Anope::string &mname = "NOTICE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
|
||||
Notice(Module *creator, const Anope::string &mname = "NOTICE") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_REQUIRE_USER); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
@@ -115,7 +115,7 @@ namespace Message
|
||||
struct CoreExport Part
|
||||
: IRCDMessage
|
||||
{
|
||||
Part(Module *creator, const Anope::string &mname = "PART") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Part(Module *creator, const Anope::string &mname = "PART") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_REQUIRE_USER); SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
@@ -123,7 +123,7 @@ namespace Message
|
||||
struct CoreExport Ping
|
||||
: IRCDMessage
|
||||
{
|
||||
Ping(Module *creator, const Anope::string &mname = "PING") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Ping(Module *creator, const Anope::string &mname = "PING") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
@@ -131,7 +131,7 @@ namespace Message
|
||||
struct CoreExport Privmsg
|
||||
: IRCDMessage
|
||||
{
|
||||
Privmsg(Module *creator, const Anope::string &mname = "PRIVMSG") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
|
||||
Privmsg(Module *creator, const Anope::string &mname = "PRIVMSG") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_REQUIRE_USER); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
@@ -139,7 +139,7 @@ namespace Message
|
||||
struct CoreExport Quit
|
||||
: IRCDMessage
|
||||
{
|
||||
Quit(Module *creator, const Anope::string &mname = "QUIT") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
|
||||
Quit(Module *creator, const Anope::string &mname = "QUIT") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_REQUIRE_USER); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
@@ -155,7 +155,7 @@ namespace Message
|
||||
struct CoreExport Stats
|
||||
: IRCDMessage
|
||||
{
|
||||
Stats(Module *creator, const Anope::string &mname = "STATS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Stats(Module *creator, const Anope::string &mname = "STATS") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_REQUIRE_USER); SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
@@ -163,7 +163,7 @@ namespace Message
|
||||
struct CoreExport Time
|
||||
: IRCDMessage
|
||||
{
|
||||
Time(Module *creator, const Anope::string &mname = "TIME") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Time(Module *creator, const Anope::string &mname = "TIME") : IRCDMessage(creator, mname, 0) { SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
@@ -171,7 +171,7 @@ namespace Message
|
||||
struct CoreExport Topic
|
||||
: IRCDMessage
|
||||
{
|
||||
Topic(Module *creator, const Anope::string &mname = "TOPIC") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
|
||||
Topic(Module *creator, const Anope::string &mname = "TOPIC") : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_REQUIRE_USER); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
@@ -179,7 +179,7 @@ namespace Message
|
||||
struct CoreExport Version
|
||||
: IRCDMessage
|
||||
{
|
||||
Version(Module *creator, const Anope::string &mname = "VERSION") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Version(Module *creator, const Anope::string &mname = "VERSION") : IRCDMessage(creator, mname, 0) { SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
@@ -187,7 +187,7 @@ namespace Message
|
||||
struct CoreExport Whois
|
||||
: IRCDMessage
|
||||
{
|
||||
Whois(Module *creator, const Anope::string &mname = "WHOIS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
Whois(Module *creator, const Anope::string &mname = "WHOIS") : IRCDMessage(creator, mname, 1) { SetFlag(FLAG_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
+2
-2
@@ -419,9 +419,9 @@ public:
|
||||
/** Get the banned mask for this entry
|
||||
* @return The mask
|
||||
*/
|
||||
const Anope::string GetMask() const;
|
||||
Anope::string GetMask() const;
|
||||
|
||||
const Anope::string GetNUHMask() const;
|
||||
Anope::string GetNUHMask() const;
|
||||
|
||||
/** Check if this entry matches a user
|
||||
* @param u The user
|
||||
|
||||
+10
-30
@@ -777,23 +777,6 @@ public:
|
||||
*/
|
||||
virtual void OnChangeCoreDisplay(NickCore *nc, const Anope::string &newdisplay) { throw NotImplementedException(); }
|
||||
|
||||
/** called from NickCore::ClearAccess()
|
||||
* @param nc pointer to the NickCore
|
||||
*/
|
||||
virtual void OnNickClearAccess(NickCore *nc) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a user adds an entry to their access list
|
||||
* @param nc The nick
|
||||
* @param entry The entry
|
||||
*/
|
||||
virtual void OnNickAddAccess(NickCore *nc, const Anope::string &entry) { throw NotImplementedException(); }
|
||||
|
||||
/** Called from NickCore::EraseAccess()
|
||||
* @param nc pointer to the NickCore
|
||||
* @param entry The access mask
|
||||
*/
|
||||
virtual void OnNickEraseAccess(NickCore *nc, const Anope::string &entry) { throw NotImplementedException(); }
|
||||
|
||||
/** called from NickCore::ClearCert()
|
||||
* @param nc pointer to the NickCore
|
||||
*/
|
||||
@@ -964,23 +947,26 @@ public:
|
||||
* @param u The user sending the PRIVMSG
|
||||
* @param bi The target of the PRIVMSG
|
||||
* @param message The message
|
||||
* @param tags Message tags
|
||||
* @return EVENT_STOP to halt processing
|
||||
*/
|
||||
virtual EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message, const Anope::map<Anope::string> &tags) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when we receive a NOTICE for one of our clients
|
||||
* @param u The user sending the NOTICE
|
||||
* @param bi The target of the NOTICE
|
||||
* @param tags Message tags
|
||||
* @param message The message
|
||||
*/
|
||||
virtual void OnBotNotice(User *u, BotInfo *bi, Anope::string &message) { throw NotImplementedException(); }
|
||||
virtual void OnBotNotice(User *u, BotInfo *bi, Anope::string &message, const Anope::map<Anope::string> &tags) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when we receive a PRIVMSG for a registered channel we are in
|
||||
* @param u The source of the message
|
||||
* @param c The channel
|
||||
* @param msg The message
|
||||
* @param tags Message tags
|
||||
*/
|
||||
virtual void OnPrivmsg(User *u, Channel *c, Anope::string &msg) { throw NotImplementedException(); }
|
||||
virtual void OnPrivmsg(User *u, Channel *c, Anope::string &msg, const Anope::map<Anope::string> &tags) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a message is logged
|
||||
* @param l The log message
|
||||
@@ -1051,9 +1037,10 @@ public:
|
||||
* @param source The source of the message
|
||||
* @param command The command being executed
|
||||
* @param params Parameters
|
||||
* @param tags Tags
|
||||
* @return EVENT_STOP to prevent the protocol module from processing this message
|
||||
*/
|
||||
virtual EventReturn OnMessage(MessageSource &source, Anope::string &command, std::vector<Anope::string> ¶m) { throw NotImplementedException(); }
|
||||
virtual EventReturn OnMessage(MessageSource &source, Anope::string &command, std::vector<Anope::string> ¶ms, Anope::map<Anope::string> &tagss) { throw NotImplementedException(); }
|
||||
|
||||
/** Called to determine if a channel mode can be set by a user
|
||||
* @param u The user
|
||||
@@ -1075,13 +1062,6 @@ public:
|
||||
* @return EVENT_STOP to force the user off of the nick
|
||||
*/
|
||||
virtual EventReturn OnNickValidate(User *u, NickAlias *na) { throw NotImplementedException(); }
|
||||
|
||||
/** Called when a certain user has to be unbanned on a certain channel.
|
||||
* May be used to send protocol-specific messages.
|
||||
* @param u The user to be unbanned
|
||||
* @param c The channel that user has to be unbanned on
|
||||
*/
|
||||
virtual void OnChannelUnban(User *u, ChannelInfo *ci) { throw NotImplementedException(); }
|
||||
};
|
||||
|
||||
enum Implementation
|
||||
@@ -1099,7 +1079,7 @@ enum Implementation
|
||||
I_OnCreateChan, I_OnDelChan, I_OnChannelCreate, I_OnChannelDelete, I_OnAkickAdd, I_OnAkickDel, I_OnCheckKick,
|
||||
I_OnChanInfo, I_OnCheckPriv, I_OnGroupCheckPriv, I_OnNickDrop, I_OnNickGroup, I_OnNickIdentify,
|
||||
I_OnUserLogin, I_OnNickLogout, I_OnNickRegister, I_OnNickConfirm, I_OnNickSuspend, I_OnNickUnsuspended, I_OnDelNick, I_OnNickCoreCreate,
|
||||
I_OnDelCore, I_OnChangeCoreDisplay, I_OnNickClearAccess, I_OnNickAddAccess, I_OnNickEraseAccess, I_OnNickClearCert,
|
||||
I_OnDelCore, I_OnChangeCoreDisplay, I_OnNickClearCert,
|
||||
I_OnNickAddCert, I_OnNickEraseCert, I_OnNickInfo, I_OnBotInfo, I_OnCheckAuthentication, I_OnNickUpdate,
|
||||
I_OnFingerprint, I_OnUserAway, I_OnInvite, I_OnDeleteVhost, I_OnSetVhost, I_OnSetDisplayedHost, I_OnMemoSend, I_OnMemoDel,
|
||||
I_OnChannelModeSet, I_OnChannelModeUnset, I_OnUserModeSet, I_OnUserModeUnset, I_OnChannelModeAdd, I_OnUserModeAdd,
|
||||
@@ -1107,7 +1087,7 @@ enum Implementation
|
||||
I_OnPrivmsg, I_OnLog, I_OnLogMessage, I_OnDnsRequest, I_OnCheckModes, I_OnChannelSync, I_OnSetCorrectModes,
|
||||
I_OnSerializeCheck, I_OnSerializableConstruct, I_OnSerializableDestruct, I_OnSerializableUpdate,
|
||||
I_OnSerializeTypeCreate, I_OnSetChannelOption, I_OnSetNickOption, I_OnMessage, I_OnCanSet, I_OnCheckDelete,
|
||||
I_OnExpireTick, I_OnNickValidate, I_OnChannelUnban,
|
||||
I_OnExpireTick, I_OnNickValidate,
|
||||
I_SIZE
|
||||
};
|
||||
|
||||
|
||||
@@ -46,13 +46,13 @@ struct BadWords
|
||||
* @param type The type (SINGLE START END)
|
||||
* @return The badword
|
||||
*/
|
||||
virtual BadWord* AddBadWord(const Anope::string &word, BadWordType type) = 0;
|
||||
virtual BadWord *AddBadWord(const Anope::string &word, BadWordType type) = 0;
|
||||
|
||||
/** Get a badword structure by index
|
||||
* @param index The index
|
||||
* @return The badword
|
||||
*/
|
||||
virtual BadWord* GetBadWord(unsigned index) const = 0;
|
||||
virtual BadWord *GetBadWord(unsigned index) const = 0;
|
||||
|
||||
/** Get how many badwords are on this channel
|
||||
* @return The number of badwords in the vector
|
||||
|
||||
@@ -33,5 +33,5 @@ public:
|
||||
delete (*this)->at(i - 1);
|
||||
}
|
||||
|
||||
virtual EntryMsg* Create() = 0;
|
||||
virtual EntryMsg *Create() = 0;
|
||||
};
|
||||
|
||||
@@ -27,9 +27,9 @@ struct HTTPReply final
|
||||
std::vector<cookie> cookies;
|
||||
|
||||
HTTPReply() = default;
|
||||
HTTPReply& operator=(const HTTPReply &) = default;
|
||||
HTTPReply &operator=(const HTTPReply &) = default;
|
||||
|
||||
HTTPReply(const HTTPReply& other) : error(other.error), length(other.length)
|
||||
HTTPReply(const HTTPReply &other) : error(other.error), length(other.length)
|
||||
{
|
||||
content_type = other.content_type;
|
||||
headers = other.headers;
|
||||
@@ -169,7 +169,7 @@ public:
|
||||
|
||||
virtual bool RegisterPage(HTTPPage *page) = 0;
|
||||
virtual void UnregisterPage(HTTPPage *page) = 0;
|
||||
virtual HTTPPage* FindPage(const Anope::string &name) = 0;
|
||||
virtual HTTPPage *FindPage(const Anope::string &name) = 0;
|
||||
};
|
||||
|
||||
namespace HTTPUtils
|
||||
@@ -180,7 +180,7 @@ namespace HTTPUtils
|
||||
|
||||
for (unsigned i = 0; i < url.length(); ++i)
|
||||
{
|
||||
const char& c = url[i];
|
||||
const char &c = url[i];
|
||||
|
||||
if (c == '%' && i + 2 < url.length())
|
||||
{
|
||||
|
||||
@@ -54,6 +54,15 @@ public:
|
||||
*/
|
||||
virtual void EraseCert(const Anope::string &entry) = 0;
|
||||
|
||||
/** Replaces a fingerprint in the nick's certificate list
|
||||
*
|
||||
* @param oldentry The old fingerprint to remove
|
||||
* @param newentry The new fingerprint to add
|
||||
*
|
||||
* Replaces the specified fingerprint in the cert list.
|
||||
*/
|
||||
virtual void ReplaceCert(const Anope::string &oldentry, const Anope::string &newentry) = 0;
|
||||
|
||||
/** Clears the entire nick's cert list
|
||||
*
|
||||
* Deletes all the memory allocated in the certificate list vector and then clears the vector.
|
||||
@@ -69,5 +78,5 @@ class CertService
|
||||
public:
|
||||
CertService(Module *c) : Service(c, "CertService", "certs") { }
|
||||
|
||||
virtual NickCore* FindAccountFromCert(const Anope::string &cert) = 0;
|
||||
virtual NickCore *FindAccountFromCert(const Anope::string &cert) = 0;
|
||||
};
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
|
||||
virtual void RemoveForbid(ForbidData *d) = 0;
|
||||
|
||||
virtual ForbidData* CreateForbid() = 0;
|
||||
virtual ForbidData *CreateForbid() = 0;
|
||||
|
||||
virtual ForbidData *FindForbid(const Anope::string &mask, ForbidType type) = 0;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ struct Exception final
|
||||
|
||||
Exception() : Serializable("Exception") { }
|
||||
void Serialize(Serialize::Data &data) const override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data);
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data);
|
||||
};
|
||||
|
||||
class SessionService
|
||||
@@ -70,7 +70,7 @@ void Exception::Serialize(Serialize::Data &data) const
|
||||
data["expires"] << this->expires;
|
||||
}
|
||||
|
||||
Serializable* Exception::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
Serializable *Exception::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
{
|
||||
if (!session_service)
|
||||
return NULL;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace SASL
|
||||
|
||||
virtual Anope::string GetAgent() = 0;
|
||||
|
||||
virtual Session* GetSession(const Anope::string &uid) = 0;
|
||||
virtual Session *GetSession(const Anope::string &uid) = 0;
|
||||
|
||||
virtual void SendMessage(SASL::Session *session, const Anope::string &type, const Anope::string &data) = 0;
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace SASL
|
||||
public:
|
||||
Mechanism(Module *o, const Anope::string &sname) : Service(o, "SASL::Mechanism", sname) { }
|
||||
|
||||
virtual Session* CreateSession(const Anope::string &uid) { return new Session(this, uid); }
|
||||
virtual Session *CreateSession(const Anope::string &uid) { return new Session(this, uid); }
|
||||
|
||||
virtual void ProcessMessage(Session *session, const Message &) = 0;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace SQL
|
||||
Clear();
|
||||
}
|
||||
|
||||
std::iostream& operator[](const Anope::string &key) override
|
||||
std::iostream &operator[](const Anope::string &key) override
|
||||
{
|
||||
std::stringstream *&ss = data[key];
|
||||
if (!ss)
|
||||
@@ -107,7 +107,7 @@ namespace SQL
|
||||
Query() { }
|
||||
Query(const Anope::string &q) : query(q) { }
|
||||
|
||||
Query& operator=(const Anope::string &q)
|
||||
Query &operator=(const Anope::string &q)
|
||||
{
|
||||
this->query = q;
|
||||
this->parameters.clear();
|
||||
@@ -124,7 +124,7 @@ namespace SQL
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
template<typename T> void SetValue(const Anope::string &key, const T& value, bool escape = true)
|
||||
template<typename T> void SetValue(const Anope::string &key, const T &value, bool escape = true)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
Anope::string name;
|
||||
Anope::string id;
|
||||
std::deque<Anope::string> data;
|
||||
HTTPReply& r;
|
||||
HTTPReply &r;
|
||||
|
||||
XMLRPCRequest(HTTPReply &_r) : r(_r) { }
|
||||
inline void reply(const Anope::string &dname, const Anope::string &ddata) { this->replies.emplace(dname, ddata); }
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2024 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
enum
|
||||
{
|
||||
RPL_STATSLINKINFO = 211,
|
||||
RPL_ENDOFSTATS = 219,
|
||||
RPL_STATSUPTIME = 242,
|
||||
RPL_STATSOLINE = 243,
|
||||
RPL_STATSCONN = 250,
|
||||
RPL_WHOISREGNICK = 307,
|
||||
RPL_WHOISUSER = 311,
|
||||
RPL_WHOISSERVER = 312,
|
||||
RPL_WHOISOPERATOR = 313,
|
||||
RPL_WHOISIDLE = 317,
|
||||
RPL_ENDOFWHOIS = 318,
|
||||
RPL_VERSION = 351,
|
||||
RPL_MOTD = 372,
|
||||
RPL_MOTDSTART = 375,
|
||||
RPL_ENDOFMOTD = 376,
|
||||
RPL_YOUREOPER = 381,
|
||||
RPL_TIME = 391,
|
||||
ERR_NOSUCHNICK = 401,
|
||||
ERR_NOMOTD = 422,
|
||||
};
|
||||
+3
-3
@@ -23,7 +23,7 @@ struct CoreExport Oper
|
||||
/* Whether the user must be an IRC operator (umode +o) to be considered a services operator */
|
||||
bool require_oper = true;
|
||||
Anope::string password;
|
||||
Anope::string certfp;
|
||||
std::vector<Anope::string> certfp;
|
||||
/* Hosts allowed to use this operator block */
|
||||
std::vector<Anope::string> hosts;
|
||||
Anope::string vhost;
|
||||
@@ -115,10 +115,10 @@ public:
|
||||
/** Gets the icommands for this opertype
|
||||
* @return A list of commands
|
||||
*/
|
||||
const std::list<Anope::string> GetCommands() const;
|
||||
std::list<Anope::string> GetCommands() const;
|
||||
|
||||
/** Gets the privileges for this opertype
|
||||
* @return A list of privileges
|
||||
*/
|
||||
const std::list<Anope::string> GetPrivs() const;
|
||||
std::list<Anope::string> GetPrivs() const;
|
||||
};
|
||||
|
||||
+150
-57
@@ -25,56 +25,85 @@ class CoreExport IRCDProto
|
||||
protected:
|
||||
IRCDProto(Module *creator, const Anope::string &proto_name);
|
||||
public:
|
||||
/** Retrieves the protocol name. */
|
||||
const Anope::string &GetProtocolName() const { return proto_name; }
|
||||
|
||||
virtual ~IRCDProto();
|
||||
|
||||
virtual void SendSVSKillInternal(const MessageSource &, User *, const Anope::string &);
|
||||
virtual void SendModeInternal(const MessageSource &, const Channel *, const Anope::string &);
|
||||
virtual void SendModeInternal(const MessageSource &, User *, const Anope::string &);
|
||||
virtual void SendKickInternal(const MessageSource &, const Channel *, User *, const Anope::string &);
|
||||
virtual void SendNoticeInternal(const MessageSource &, const Anope::string &dest, const Anope::string &msg);
|
||||
virtual void SendPrivmsgInternal(const MessageSource &, const Anope::string &dest, const Anope::string &buf);
|
||||
virtual void SendQuitInternal(User *, const Anope::string &buf);
|
||||
virtual void SendPartInternal(User *, const Channel *chan, const Anope::string &buf);
|
||||
virtual void SendGlobopsInternal(const MessageSource &, const Anope::string &buf);
|
||||
virtual void SendNoticeInternal(const MessageSource &, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags = {});
|
||||
virtual void SendPrivmsgInternal(const MessageSource &, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags = {});
|
||||
virtual void SendCTCPInternal(const MessageSource &, const Anope::string &dest, const Anope::string &buf);
|
||||
virtual void SendNumericInternal(int numeric, const Anope::string &dest, const Anope::string &buf);
|
||||
|
||||
const Anope::string &GetProtocolName();
|
||||
virtual bool Parse(const Anope::string &, Anope::map<Anope::string> &, Anope::string &, Anope::string &, std::vector<Anope::string> &);
|
||||
virtual Anope::string Format(const Anope::string &source, const Anope::string &message);
|
||||
/** Parses an incoming message from the IRC server.
|
||||
* @param message The message to parse.
|
||||
* @param tags The location to store tags.
|
||||
* @param source The location to store the source.
|
||||
* @param command The location to store the command name.
|
||||
* @param params The location to store the parameters.
|
||||
* @return If the message was well formed then true; otherwise, false.
|
||||
*/
|
||||
virtual bool Parse(const Anope::string &message, Anope::map<Anope::string> &tags, Anope::string &source, Anope::string &command, std::vector<Anope::string> ¶ms);
|
||||
|
||||
/* Formats an outgoing message so it can be sent to the IRC server.
|
||||
* @param message The location to store the formatted message.
|
||||
* @param tags IRCv3 message tags.
|
||||
* @param source Source of the message.
|
||||
* @param command Command name.
|
||||
* @param params Any extra parameters.
|
||||
* @return If the message was formatted then true; otherwise, false.
|
||||
*/
|
||||
virtual bool Format(Anope::string &message, const Anope::map<Anope::string> &tags, const MessageSource &source, const Anope::string &command, const std::vector<Anope::string> ¶ms);
|
||||
|
||||
/* Modes used by default by our clients */
|
||||
Anope::string DefaultPseudoclientModes;
|
||||
Anope::string DefaultPseudoclientModes = "+io";
|
||||
|
||||
/* Can we force change a users's nick? */
|
||||
bool CanSVSNick;
|
||||
bool CanSVSNick = false;
|
||||
|
||||
/* Can we force join or part users? */
|
||||
bool CanSVSJoin;
|
||||
/* Can we set vhosts/vidents on users? */
|
||||
bool CanSetVHost, CanSetVIdent;
|
||||
bool CanSVSJoin = false;
|
||||
|
||||
/* Can we set vhosts on users? */
|
||||
bool CanSetVHost = false;
|
||||
|
||||
/* Can we set vidents on users? */
|
||||
bool CanSetVIdent = false;
|
||||
|
||||
/* Can we ban specific gecos from being used? */
|
||||
bool CanSNLine;
|
||||
bool CanSNLine = false;
|
||||
|
||||
/* Can we ban specific nicknames from being used? */
|
||||
bool CanSQLine;
|
||||
bool CanSQLine = false;
|
||||
|
||||
/* Can we ban specific channel names from being used? */
|
||||
bool CanSQLineChannel;
|
||||
bool CanSQLineChannel = false;
|
||||
|
||||
/* Can we ban by IP? */
|
||||
bool CanSZLine;
|
||||
bool CanSZLine = false;
|
||||
|
||||
/* Can we place temporary holds on specific nicknames? */
|
||||
bool CanSVSHold;
|
||||
bool CanSVSHold = false;
|
||||
|
||||
/* See ns_cert */
|
||||
bool CanCertFP;
|
||||
/* Can we send arbitrary message tags? */
|
||||
bool CanSendTags;
|
||||
bool CanCertFP = false;
|
||||
|
||||
/* Can users log out before being fully connected? */
|
||||
bool CanSVSLogout;
|
||||
bool CanSVSLogout = false;
|
||||
|
||||
/* Whether this IRCd requires unique IDs for each user or server. See TS6/P10. */
|
||||
bool RequiresID;
|
||||
bool RequiresID = false;
|
||||
|
||||
/* If this IRCd has unique ids, whether the IDs and nicknames are ambiguous */
|
||||
bool AmbiguousID;
|
||||
bool AmbiguousID = false;
|
||||
|
||||
/** Can we ask the server to unban a user? */
|
||||
bool CanClearBans = false;
|
||||
|
||||
/* The maximum number of modes we are allowed to set with one MODE command */
|
||||
unsigned MaxModes;
|
||||
unsigned MaxModes = 3;
|
||||
|
||||
/* The maximum number of bytes a line may have */
|
||||
unsigned MaxLine;
|
||||
unsigned MaxLine = 512;
|
||||
|
||||
/* Retrieves the next free UID or SID */
|
||||
virtual Anope::string UID_Retrieve();
|
||||
@@ -127,19 +156,30 @@ public:
|
||||
/** Kills a user
|
||||
* @param source Who is doing the kill
|
||||
* @param user The user to be killed
|
||||
* @param fmt Kill reason
|
||||
* @param msg Kill reason
|
||||
*/
|
||||
virtual void SendSVSKill(const MessageSource &source, User *user, const char *fmt, ...) ATTR_FORMAT(4, 5);
|
||||
virtual void SendSVSKill(const MessageSource &source, User *user, const Anope::string &msg);
|
||||
|
||||
virtual void SendMode(const MessageSource &source, const Channel *dest, const char *fmt, ...) ATTR_FORMAT(4, 5);
|
||||
virtual void SendMode(const MessageSource &source, User *u, const char *fmt, ...) ATTR_FORMAT(4, 5);
|
||||
virtual void SendModeInternal(const MessageSource &source, Channel *chan, const Anope::string &modes, const std::vector<Anope::string> &values);
|
||||
template <typename... Args>
|
||||
void SendMode(const MessageSource &source, Channel *chan, const Anope::string &modes, Args &&...args)
|
||||
{
|
||||
SendModeInternal(source, chan, modes, { stringify(args)... });
|
||||
}
|
||||
|
||||
virtual void SendModeInternal(const MessageSource &source, User *u, const Anope::string &modes, const std::vector<Anope::string> &values);
|
||||
template <typename... Args>
|
||||
void SendMode(const MessageSource &source, User *u, const Anope::string &modes, Args &&...args)
|
||||
{
|
||||
SendModeInternal(source, u, modes, { stringify(args)... });
|
||||
}
|
||||
|
||||
/** Introduces a client to the rest of the network
|
||||
* @param u The client to introduce
|
||||
*/
|
||||
virtual void SendClientIntroduction(User *u) = 0;
|
||||
|
||||
virtual void SendKick(const MessageSource &source, const Channel *chan, User *user, const char *fmt, ...) ATTR_FORMAT(5, 6);
|
||||
virtual void SendKick(const MessageSource &source, const Channel *chan, User *user, const Anope::string &msg);
|
||||
|
||||
virtual void SendNotice(const MessageSource &source, const Anope::string &dest, const char *fmt, ...) ATTR_FORMAT(4, 5);
|
||||
virtual void SendPrivmsg(const MessageSource &source, const Anope::string &dest, const char *fmt, ...) ATTR_FORMAT(4, 5);
|
||||
@@ -149,7 +189,10 @@ public:
|
||||
virtual void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) = 0;
|
||||
virtual void SendGlobalPrivmsg(BotInfo *bi, const Server *desc, const Anope::string &msg) = 0;
|
||||
|
||||
virtual void SendQuit(User *u, const char *fmt, ...) ATTR_FORMAT(3, 4);
|
||||
virtual void SendContextNotice(BotInfo *bi, User *target, Channel *context, const Anope::string &msg);
|
||||
virtual void SendContextPrivmsg(BotInfo *bi, User *target, Channel *context, const Anope::string &msg);
|
||||
|
||||
virtual void SendQuit(User *u, const Anope::string &msg);
|
||||
virtual void SendPing(const Anope::string &servname, const Anope::string &who);
|
||||
virtual void SendPong(const Anope::string &servname, const Anope::string &who);
|
||||
|
||||
@@ -161,7 +204,7 @@ public:
|
||||
* stacker to be set "soon".
|
||||
*/
|
||||
virtual void SendJoin(User *u, Channel *c, const ChannelStatus *status) = 0;
|
||||
virtual void SendPart(User *u, const Channel *chan, const char *fmt, ...) ATTR_FORMAT(4, 5);
|
||||
virtual void SendPart(User *u, const Channel *chan, const Anope::string &msg);
|
||||
|
||||
/** Force joins a user that isn't ours to a channel.
|
||||
* @param bi The source of the message
|
||||
@@ -180,7 +223,7 @@ public:
|
||||
virtual void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) { }
|
||||
|
||||
virtual void SendInvite(const MessageSource &source, const Channel *c, User *u);
|
||||
virtual void SendGlobops(const MessageSource &source, const char *fmt, ...) ATTR_FORMAT(3, 4);
|
||||
virtual void SendGlobops(const MessageSource &source, const Anope::string &msg);
|
||||
|
||||
/** Sends a nick change of one of our clients.
|
||||
*/
|
||||
@@ -211,7 +254,12 @@ public:
|
||||
virtual void SendServer(const Server *) = 0;
|
||||
virtual void SendSquit(Server *, const Anope::string &message);
|
||||
|
||||
virtual void SendNumeric(int numeric, const Anope::string &dest, const char *fmt, ...) ATTR_FORMAT(4, 5);
|
||||
virtual void SendNumericInternal(int numeric, const Anope::string &dest, const std::vector<Anope::string> ¶ms);
|
||||
template <typename... Args>
|
||||
void SendNumeric(int numeric, const Anope::string &dest, Args &&...args)
|
||||
{
|
||||
SendNumericInternal(numeric, dest, { stringify(args)... });
|
||||
}
|
||||
|
||||
virtual void SendLogin(User *u, NickAlias *na) = 0;
|
||||
virtual void SendLogout(User *u) = 0;
|
||||
@@ -226,6 +274,8 @@ public:
|
||||
*/
|
||||
virtual void SendOper(User *u);
|
||||
|
||||
virtual void SendClearBans(const MessageSource &user, Channel *c, User* u) { }
|
||||
|
||||
virtual void SendSASLMechanisms(std::vector<Anope::string> &) { }
|
||||
virtual void SendSASLMessage(const SASL::Message &) { }
|
||||
virtual void SendSVSLogin(const Anope::string &uid, NickAlias *na) { }
|
||||
@@ -235,14 +285,26 @@ public:
|
||||
virtual bool IsIdentValid(const Anope::string &);
|
||||
virtual bool IsHostValid(const Anope::string &);
|
||||
virtual bool IsExtbanValid(const Anope::string &) { return false; }
|
||||
virtual bool IsTagValid(const Anope::string &, const Anope::string &) { return false; }
|
||||
|
||||
/** Retrieve the maximum number of list modes settable on this channel
|
||||
* Defaults to Config->ListSize
|
||||
*/
|
||||
virtual unsigned GetMaxListFor(Channel *c);
|
||||
virtual unsigned GetMaxListFor(Channel *c, ChannelMode *cm);
|
||||
virtual size_t GetMaxListFor(Channel *c, ChannelMode *cm);
|
||||
|
||||
virtual Anope::string NormalizeMask(const Anope::string &mask);
|
||||
|
||||
/** Retrieves the maximum length of a channel name. */
|
||||
virtual size_t GetMaxChannel();
|
||||
|
||||
/** Retrieves the maximum length of a hostname. */
|
||||
virtual size_t GetMaxHost();
|
||||
|
||||
/** Retrieves the maximum length of a nickname. */
|
||||
virtual size_t GetMaxNick();
|
||||
|
||||
/** Retrieves the maximum length of a username. */
|
||||
virtual size_t GetMaxUser();
|
||||
};
|
||||
|
||||
class CoreExport MessageSource final
|
||||
@@ -252,7 +314,7 @@ class CoreExport MessageSource final
|
||||
Server *s = nullptr;
|
||||
|
||||
public:
|
||||
MessageSource(const Anope::string &);
|
||||
explicit MessageSource(const Anope::string &);
|
||||
MessageSource(User *u);
|
||||
MessageSource(Server *s);
|
||||
const Anope::string &GetName() const;
|
||||
@@ -262,26 +324,57 @@ public:
|
||||
Server *GetServer() const;
|
||||
};
|
||||
|
||||
enum IRCDMessageFlag
|
||||
{
|
||||
IRCDMESSAGE_SOFT_LIMIT,
|
||||
IRCDMESSAGE_REQUIRE_SERVER,
|
||||
IRCDMESSAGE_REQUIRE_USER
|
||||
};
|
||||
|
||||
/** Base class for protocol module message handlers. */
|
||||
class CoreExport IRCDMessage
|
||||
: public Service
|
||||
{
|
||||
Anope::string name;
|
||||
unsigned param_count;
|
||||
std::set<IRCDMessageFlag> flags;
|
||||
public:
|
||||
IRCDMessage(Module *owner, const Anope::string &n, unsigned p = 0);
|
||||
unsigned GetParamCount() const;
|
||||
virtual void Run(MessageSource &, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) = 0;
|
||||
/** An enumeration of potential flags a command can have. */
|
||||
enum Flag
|
||||
: uint8_t
|
||||
{
|
||||
/** The parameter count is a minimum instead of an exact limit. */
|
||||
FLAG_SOFT_LIMIT,
|
||||
|
||||
void SetFlag(IRCDMessageFlag f) { flags.insert(f); }
|
||||
bool HasFlag(IRCDMessageFlag f) const { return flags.count(f); }
|
||||
/** The message must come from a server. */
|
||||
FLAG_REQUIRE_SERVER,
|
||||
|
||||
/** The message must come from a user. */
|
||||
FLAG_REQUIRE_USER,
|
||||
|
||||
/** The highest flag possible. */
|
||||
FLAG_MAX,
|
||||
};
|
||||
|
||||
private:
|
||||
/** The name of the message (e.g. PRIVMSG). */
|
||||
const Anope::string name;
|
||||
|
||||
/** The number of parameters this command takes. */
|
||||
const size_t param_count;
|
||||
|
||||
/** The flags that are set on the command. */
|
||||
std::bitset<FLAG_MAX> flags;
|
||||
|
||||
public:
|
||||
IRCDMessage(Module *o, const Anope::string &n, size_t pc = 0);
|
||||
|
||||
/** Retrieves the parameter count. */
|
||||
inline size_t GetParamCount() const { return param_count; }
|
||||
|
||||
/** Runs the handler for this message.
|
||||
* @param source Entity that sent the message.
|
||||
* @param params Message parameters
|
||||
* @param tags Message tags
|
||||
*/
|
||||
virtual void Run(MessageSource &source, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) = 0;
|
||||
|
||||
/** Sets the flags for this message. */
|
||||
inline void SetFlag(Flag flag, bool value = true) { flags.set(flag, value); }
|
||||
|
||||
/** Determines if a flag is set. */
|
||||
inline bool HasFlag(Flag flag) const { return flags[flag]; }
|
||||
};
|
||||
|
||||
/** MessageTokenizer allows tokens in the IRC wire format to be read from a string */
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
AutoKick();
|
||||
~AutoKick();
|
||||
void Serialize(Serialize::Data &data) const override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
|
||||
};
|
||||
|
||||
/* It matters that Base is here before Extensible (it is inherited by Serializable)
|
||||
@@ -95,10 +95,10 @@ public:
|
||||
ChannelInfo(const ChannelInfo &ci);
|
||||
|
||||
~ChannelInfo();
|
||||
ChannelInfo& operator=(const ChannelInfo &) = default;
|
||||
ChannelInfo &operator=(const ChannelInfo &) = default;
|
||||
|
||||
void Serialize(Serialize::Data &data) const override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
/** Change the founder of the channel
|
||||
* @params nc The new founder
|
||||
@@ -169,7 +169,7 @@ public:
|
||||
* @param t The time the akick was added, defaults to now
|
||||
* @param lu The time the akick was last used, defaults to never
|
||||
*/
|
||||
AutoKick* AddAkick(const Anope::string &user, NickCore *akicknc, const Anope::string &reason, time_t t = Anope::CurTime, time_t lu = 0);
|
||||
AutoKick *AddAkick(const Anope::string &user, NickCore *akicknc, const Anope::string &reason, time_t t = Anope::CurTime, time_t lu = 0);
|
||||
|
||||
/** Add an akick entry to the channel by reason
|
||||
* @param user The user who added the akick
|
||||
@@ -178,13 +178,13 @@ public:
|
||||
* @param t The time the akick was added, defaults to now
|
||||
* @param lu The time the akick was last used, defaults to never
|
||||
*/
|
||||
AutoKick* AddAkick(const Anope::string &user, const Anope::string &mask, const Anope::string &reason, time_t t = Anope::CurTime, time_t lu = 0);
|
||||
AutoKick *AddAkick(const Anope::string &user, const Anope::string &mask, const Anope::string &reason, time_t t = Anope::CurTime, time_t lu = 0);
|
||||
|
||||
/** Get an entry from the channel akick list
|
||||
* @param index The index in the akick vector
|
||||
* @return The akick structure, or NULL if not found
|
||||
*/
|
||||
AutoKick* GetAkick(unsigned index) const;
|
||||
AutoKick *GetAkick(unsigned index) const;
|
||||
|
||||
/** Get the size of the akick vector for this channel
|
||||
* @return The akick vector size
|
||||
@@ -238,7 +238,7 @@ public:
|
||||
* @param name channel name to lookup
|
||||
* @return the ChannelInfo associated with the channel
|
||||
*/
|
||||
static ChannelInfo* Find(const Anope::string &name);
|
||||
static ChannelInfo *Find(const Anope::string &name);
|
||||
|
||||
void AddChannelReference(const Anope::string &what);
|
||||
void RemoveChannelReference(const Anope::string &what);
|
||||
|
||||
+10
-10
@@ -29,7 +29,7 @@ namespace Serialize
|
||||
|
||||
virtual ~Data() = default;
|
||||
|
||||
virtual std::iostream& operator[](const Anope::string &key) = 0;
|
||||
virtual std::iostream &operator[](const Anope::string &key) = 0;
|
||||
virtual std::set<Anope::string> KeySet() const { throw CoreException("Not supported"); }
|
||||
virtual size_t Hash() const { throw CoreException("Not supported"); }
|
||||
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
/** Get the type of serializable object this is
|
||||
* @return The serializable object type
|
||||
*/
|
||||
Serialize::Type* GetSerializableType() const { return this->s_type; }
|
||||
Serialize::Type *GetSerializableType() const { return this->s_type; }
|
||||
|
||||
virtual void Serialize(Serialize::Data &data) const = 0;
|
||||
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
class CoreExport Serialize::Type final
|
||||
: public Base
|
||||
{
|
||||
typedef Serializable* (*unserialize_func)(Serializable *obj, Serialize::Data &);
|
||||
typedef Serializable *(*unserialize_func)(Serializable *obj, Serialize::Data &);
|
||||
|
||||
static std::vector<Anope::string> TypeOrder;
|
||||
static std::map<Anope::string, Serialize::Type *> Types;
|
||||
@@ -168,7 +168,7 @@ public:
|
||||
*/
|
||||
void UpdateTimestamp();
|
||||
|
||||
Module* GetOwner() const { return this->owner; }
|
||||
Module *GetOwner() const { return this->owner; }
|
||||
|
||||
static Serialize::Type *Find(const Anope::string &name);
|
||||
|
||||
@@ -201,23 +201,23 @@ class Serialize::Checker
|
||||
public:
|
||||
Checker(const Anope::string &n) : name(n) { }
|
||||
|
||||
inline const T* operator->() const
|
||||
inline const T *operator->() const
|
||||
{
|
||||
this->Check();
|
||||
return &this->obj;
|
||||
}
|
||||
inline T* operator->()
|
||||
inline T *operator->()
|
||||
{
|
||||
this->Check();
|
||||
return &this->obj;
|
||||
}
|
||||
|
||||
inline const T& operator*() const
|
||||
inline const T &operator*() const
|
||||
{
|
||||
this->Check();
|
||||
return this->obj;
|
||||
}
|
||||
inline T& operator*()
|
||||
inline T &operator*()
|
||||
{
|
||||
this->Check();
|
||||
return this->obj;
|
||||
@@ -305,7 +305,7 @@ public:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inline T* operator*() const
|
||||
inline T *operator*() const
|
||||
{
|
||||
if (!this->invalid)
|
||||
{
|
||||
@@ -318,7 +318,7 @@ public:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inline T* operator->() const
|
||||
inline T *operator->() const
|
||||
{
|
||||
if (!this->invalid)
|
||||
{
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ namespace Servers
|
||||
* the only server whose uplink *is* Me that is not a juped server.
|
||||
* @return Our uplink, or NULL if not uplinked to anything
|
||||
*/
|
||||
extern CoreExport Server* GetUplink();
|
||||
extern CoreExport Server *GetUplink();
|
||||
|
||||
/* Server maps by name and id */
|
||||
extern CoreExport Anope::map<Server *> ByName;
|
||||
|
||||
+1
-1
@@ -313,7 +313,7 @@ public:
|
||||
|
||||
/** Gets the new line from the input buffer, if any
|
||||
*/
|
||||
const Anope::string GetLine();
|
||||
Anope::string GetLine();
|
||||
|
||||
/** Write to the socket
|
||||
* @param message The message
|
||||
|
||||
@@ -29,10 +29,6 @@
|
||||
#ifdef _WIN32
|
||||
# define popen _popen
|
||||
# define pclose _pclose
|
||||
# ifdef _MSC_VER
|
||||
# define PATH_MAX MAX_PATH
|
||||
# endif
|
||||
# define sleep(x) Sleep(x * 1000)
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__
|
||||
|
||||
@@ -26,7 +26,7 @@ private:
|
||||
|
||||
public:
|
||||
/* Handle for this thread */
|
||||
std::thread *handle = nullptr;
|
||||
std::unique_ptr<std::thread> handle;
|
||||
|
||||
/** Threads destructor
|
||||
*/
|
||||
|
||||
+26
-17
@@ -13,10 +13,36 @@
|
||||
|
||||
#include "sockets.h"
|
||||
#include "protocol.h"
|
||||
#include "servers.h"
|
||||
|
||||
namespace Uplink
|
||||
{
|
||||
extern void Connect();
|
||||
extern CoreExport void SendInternal(const Anope::map<Anope::string> &, const MessageSource &, const Anope::string &, const std::vector<Anope::string> &);
|
||||
|
||||
template<typename... Args>
|
||||
void Send(const Anope::map<Anope::string> &tags, const MessageSource &source, const Anope::string &command, Args &&...args)
|
||||
{
|
||||
SendInternal(tags, source, command, { stringify(args)... });
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
void Send(const Anope::map<Anope::string> &tags, const Anope::string &command, Args &&...args)
|
||||
{
|
||||
SendInternal(tags, Me, command, { stringify(args)... });
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
void Send(const MessageSource &source, const Anope::string &command, Args &&...args)
|
||||
{
|
||||
SendInternal({}, source, command, { stringify(args)... });
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
void Send(const Anope::string &command, Args &&...args)
|
||||
{
|
||||
SendInternal({}, Me, command, { stringify(args)... });
|
||||
}
|
||||
}
|
||||
|
||||
/* This is the socket to our uplink */
|
||||
@@ -31,22 +57,5 @@ public:
|
||||
bool ProcessRead() override;
|
||||
void OnConnect() override;
|
||||
void OnError(const Anope::string &) override;
|
||||
|
||||
/* A message sent over the uplink socket */
|
||||
class CoreExport Message final
|
||||
{
|
||||
MessageSource source;
|
||||
std::stringstream buffer;
|
||||
|
||||
public:
|
||||
Message();
|
||||
Message(const MessageSource &);
|
||||
~Message();
|
||||
template<typename T> Message &operator<<(const T &val)
|
||||
{
|
||||
this->buffer << val;
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
};
|
||||
extern CoreExport UplinkSocket *UplinkSock;
|
||||
|
||||
+7
-12
@@ -44,8 +44,6 @@ protected:
|
||||
Anope::string vident;
|
||||
Anope::string ident;
|
||||
Anope::string uid;
|
||||
/* If the user is on the access list of the nick they're on */
|
||||
bool on_access;
|
||||
/* Map of user modes and the params this user has (if any) */
|
||||
ModeList modes;
|
||||
/* NickCore account the user is currently logged in as, if they are logged in */
|
||||
@@ -116,7 +114,7 @@ protected:
|
||||
virtual ~User();
|
||||
|
||||
public:
|
||||
static User* OnIntroduce(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, const Anope::string &sip, Server *sserver, const Anope::string &srealname, time_t ts, const Anope::string &smodes, const Anope::string &suid, NickCore *nc);
|
||||
static User *OnIntroduce(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, const Anope::string &sip, Server *sserver, const Anope::string &srealname, time_t ts, const Anope::string &smodes, const Anope::string &suid, NickCore *nc);
|
||||
|
||||
/** Update the nickname of a user record accordingly, should be
|
||||
* called from ircd protocol.
|
||||
@@ -193,6 +191,7 @@ public:
|
||||
*/
|
||||
void SendMessage(BotInfo *source, const char *fmt, ...) ATTR_FORMAT(3, 4);
|
||||
void SendMessage(BotInfo *source, const Anope::string &msg) override;
|
||||
void SendMessage(CommandSource &source, const Anope::string &msg) override;
|
||||
|
||||
/** Identify the user to a nick.
|
||||
* updates last_seen, logs the user in,
|
||||
@@ -222,12 +221,6 @@ public:
|
||||
*/
|
||||
bool IsIdentified(bool check_nick = false) const;
|
||||
|
||||
/** Check if the user is recognized for their nick (on the nicks access list)
|
||||
* @param check_secure Only returns true if the user has secure off
|
||||
* @return true or false
|
||||
*/
|
||||
bool IsRecognized(bool check_secure = true) const;
|
||||
|
||||
/** Check if the user is connected securely.
|
||||
* @return True if the user is connected securely; otherwise, false.
|
||||
*/
|
||||
@@ -250,8 +243,7 @@ public:
|
||||
*/
|
||||
bool HasPriv(const Anope::string &privstr);
|
||||
|
||||
/** Update the last usermask stored for a user, and check to see if they are recognized
|
||||
*/
|
||||
/** Update the last usermask stored for a user. */
|
||||
void UpdateHost();
|
||||
|
||||
/** Check if the user has a mode
|
||||
@@ -368,12 +360,15 @@ public:
|
||||
*/
|
||||
bool BadPassword();
|
||||
|
||||
/** Determines whether this user should receive a PRIVMSG instead of a NOTICE. */
|
||||
bool ShouldPrivmsg() const;
|
||||
|
||||
/** Finds a user by nick, or possibly UID
|
||||
* @param name The nick, or possibly UID, to lookup
|
||||
* @param nick_only set to true to only look up by nick, not UID
|
||||
* @return the user, if they exist
|
||||
*/
|
||||
static User* Find(const Anope::string &name, bool nick_only = false);
|
||||
static User *Find(const Anope::string &name, bool nick_only = false);
|
||||
|
||||
/** Quits all users who are pending to be quit
|
||||
*/
|
||||
|
||||
+3
-3
@@ -45,7 +45,7 @@ public:
|
||||
bool IsRegex() const;
|
||||
|
||||
void Serialize(Serialize::Data &data) const override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data);
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data);
|
||||
};
|
||||
|
||||
/* Managers XLines. There is one XLineManager per type of XLine. */
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
* @param index The index
|
||||
* @return The XLine, or NULL if the index is out of bounds
|
||||
*/
|
||||
XLine* GetEntry(unsigned index);
|
||||
XLine *GetEntry(unsigned index);
|
||||
|
||||
/** Clear the XLine vector
|
||||
* Note: This does not remove the XLines from the IRCd
|
||||
@@ -145,7 +145,7 @@ public:
|
||||
* @param mask The mask
|
||||
* @return The XLine the user matches, or NULL
|
||||
*/
|
||||
XLine* HasEntry(const Anope::string &mask);
|
||||
XLine *HasEntry(const Anope::string &mask);
|
||||
|
||||
/** Check a user against all of the xlines in this XLineManager
|
||||
* @param u The user
|
||||
|
||||
+36
-226
@@ -1,5 +1,5 @@
|
||||
# Anope IRC Services language file
|
||||
# Copyright (C) 2014-2020
|
||||
# Copyright (C) 2014-2024
|
||||
# This file is distributed under the same license as the Anope IRC Services package.
|
||||
# Adam <adam@anope.org>, 2014.
|
||||
#
|
||||
@@ -7,8 +7,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Anope\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-01-08 13:20+0000\n"
|
||||
"PO-Revision-Date: 2024-01-08 13:26+0000\n"
|
||||
"POT-Creation-Date: 2024-03-04 10:34+0000\n"
|
||||
"PO-Revision-Date: 2024-03-04 10:34+0000\n"
|
||||
"Last-Translator: Sadie Powell <sadie@witchery.services>\n"
|
||||
"Language-Team: English\n"
|
||||
"Language: en_US\n"
|
||||
@@ -46,10 +46,6 @@ msgstr "%s added to %s autokick list."
|
||||
msgid "%s added to %s bad words list."
|
||||
msgstr "%s added to %s bad words list."
|
||||
|
||||
#, c-format
|
||||
msgid "%s added to %s's access list."
|
||||
msgstr "%s added to %s's access list."
|
||||
|
||||
#, c-format
|
||||
msgid "%s added to %s's certificate list."
|
||||
msgstr "%s added to %s's certificate list."
|
||||
@@ -186,10 +182,6 @@ msgstr "%s deleted from %s autokick list."
|
||||
msgid "%s deleted from %s bad words list."
|
||||
msgstr "%s deleted from %s bad words list."
|
||||
|
||||
#, c-format
|
||||
msgid "%s deleted from %s's access list."
|
||||
msgstr "%s deleted from %s's access list."
|
||||
|
||||
#, c-format
|
||||
msgid "%s deleted from %s's certificate list."
|
||||
msgstr "%s deleted from %s's certificate list."
|
||||
@@ -346,10 +338,6 @@ msgstr "%s not found on %s autokick list."
|
||||
msgid "%s not found on %s bad words list."
|
||||
msgstr "%s not found on %s bad words list."
|
||||
|
||||
#, c-format
|
||||
msgid "%s not found on %s's access list."
|
||||
msgstr "%s not found on %s's access list."
|
||||
|
||||
#, c-format
|
||||
msgid "%s not found on %s's certificate list."
|
||||
msgstr "%s not found on %s's certificate list."
|
||||
@@ -496,9 +484,6 @@ msgstr "channel"
|
||||
msgid "channel bantype"
|
||||
msgstr "channel bantype"
|
||||
|
||||
msgid "channel channel"
|
||||
msgstr "channel channel"
|
||||
|
||||
msgid "channel command method [status]"
|
||||
msgstr "channel command method [status]"
|
||||
|
||||
@@ -601,6 +586,9 @@ msgstr "channel VIEW [mask | entry-num | list]"
|
||||
msgid "channel VIEW [mask | list]"
|
||||
msgstr "channel VIEW [mask | list]"
|
||||
|
||||
msgid "channel [code]"
|
||||
msgstr "channel [code]"
|
||||
|
||||
msgid "channel [description]"
|
||||
msgstr "channel [description]"
|
||||
|
||||
@@ -1605,10 +1593,6 @@ msgstr "%s will now notify you of memos when you log on or unset /AWAY."
|
||||
msgid "%s!%s@%s (%s) added to the bot list."
|
||||
msgstr "%s!%s@%s (%s) added to the bot list."
|
||||
|
||||
#, c-format
|
||||
msgid "%s's access list is empty."
|
||||
msgstr "%s's access list is empty."
|
||||
|
||||
#, c-format
|
||||
msgid "%s's auto join list is empty."
|
||||
msgstr "%s's auto join list is empty."
|
||||
@@ -1745,9 +1729,6 @@ msgstr "ADD [+expiry] mask limit reason"
|
||||
msgid "ADD [nickname] channel [key]"
|
||||
msgstr "ADD [nickname] channel [key]"
|
||||
|
||||
msgid "ADD [nickname] mask"
|
||||
msgstr "ADD [nickname] mask"
|
||||
|
||||
msgid "ADD [nickname] [fingerprint]"
|
||||
msgstr "ADD [nickname] [fingerprint]"
|
||||
|
||||
@@ -1822,9 +1803,6 @@ msgstr "Account"
|
||||
msgid "Account %s has already reached the maximum number of simultaneous logins (%u)."
|
||||
msgstr "Account %s has already reached the maximum number of simultaneous logins (%u)."
|
||||
|
||||
msgid "Activate security features"
|
||||
msgstr "Activate security features"
|
||||
|
||||
msgid "Activate the requested vHost for the given nick."
|
||||
msgstr "Activate the requested vHost for the given nick."
|
||||
|
||||
@@ -1961,10 +1939,6 @@ msgstr "All user modes on %s have been synced."
|
||||
msgid "All vhosts in the group %s have been set to %s."
|
||||
msgstr "All vhosts in the group %s have been set to %s."
|
||||
|
||||
#, c-format
|
||||
msgid "All vhosts in the group %s have been set to %s@%s."
|
||||
msgstr "All vhosts in the group %s have been set to %s@%s."
|
||||
|
||||
msgid "Allowed to (de)halfop themself"
|
||||
msgstr "Allowed to (de)halfop themself"
|
||||
|
||||
@@ -2627,15 +2601,15 @@ msgid "Bot bans will no longer automatically expire."
|
||||
msgstr "Bot bans will no longer automatically expire."
|
||||
|
||||
#, c-format
|
||||
msgid "Bot hosts may only be %d characters long."
|
||||
msgstr "Bot hosts may only be %d characters long."
|
||||
msgid "Bot hosts may only be %zu characters long."
|
||||
msgstr "Bot hosts may only be %zu characters long."
|
||||
|
||||
msgid "Bot hosts may only contain valid host characters."
|
||||
msgstr "Bot hosts may only contain valid host characters."
|
||||
|
||||
#, c-format
|
||||
msgid "Bot idents may only be %d characters long."
|
||||
msgstr "Bot idents may only be %d characters long."
|
||||
msgid "Bot idents may only be %zu characters long."
|
||||
msgstr "Bot idents may only be %zu characters long."
|
||||
|
||||
msgid "Bot idents may only contain valid ident characters."
|
||||
msgstr "Bot idents may only contain valid ident characters."
|
||||
@@ -2651,8 +2625,8 @@ msgid "Bot nick"
|
||||
msgstr "Bot nick"
|
||||
|
||||
#, c-format
|
||||
msgid "Bot nicks may only be %d characters long."
|
||||
msgstr "Bot nicks may only be %d characters long."
|
||||
msgid "Bot nicks may only be %zu characters long."
|
||||
msgstr "Bot nicks may only be %zu characters long."
|
||||
|
||||
msgid "Bot nicks may only contain valid nick characters."
|
||||
msgstr "Bot nicks may only contain valid nick characters."
|
||||
@@ -3195,9 +3169,6 @@ msgstr "DEL [nickname] channel"
|
||||
msgid "DEL [nickname] fingerprint"
|
||||
msgstr "DEL [nickname] fingerprint"
|
||||
|
||||
msgid "DEL [nickname] mask"
|
||||
msgstr "DEL [nickname] mask"
|
||||
|
||||
msgid "DEL {mask | entry-num | list | id}"
|
||||
msgstr "DEL {mask | entry-num | list | id}"
|
||||
|
||||
@@ -3671,17 +3642,6 @@ msgstr ""
|
||||
"modes is enabled, services will remember your usermodes\n"
|
||||
"and attempt to re-set them the next time you authenticate."
|
||||
|
||||
msgid ""
|
||||
"Enables or disables security features for a\n"
|
||||
"channel. When SECURE is set, only users who have\n"
|
||||
"identified to services, and are not only recognized, will be\n"
|
||||
"given access to channels from account-based access entries."
|
||||
msgstr ""
|
||||
"Enables or disables security features for a\n"
|
||||
"channel. When SECURE is set, only users who have\n"
|
||||
"identified to services, and are not only recognized, will be\n"
|
||||
"given access to channels from account-based access entries."
|
||||
|
||||
msgid ""
|
||||
"Enables or disables signed kicks for a\n"
|
||||
"channel. When SIGNKICK is set, kicks issued with\n"
|
||||
@@ -3918,12 +3878,12 @@ msgid "Error reloading configuration file: %s"
|
||||
msgstr "Error reloading configuration file: %s"
|
||||
|
||||
#, c-format
|
||||
msgid "Error! The vHost ident is too long, please use an ident shorter than %d characters."
|
||||
msgstr "Error! The vHost ident is too long, please use an ident shorter than %d characters."
|
||||
msgid "Error! The vHost ident is too long, please use an ident shorter than %zu characters."
|
||||
msgstr "Error! The vHost ident is too long, please use an ident shorter than %zu characters."
|
||||
|
||||
#, c-format
|
||||
msgid "Error! The vHost is too long, please use a hostname shorter than %d characters."
|
||||
msgstr "Error! The vHost is too long, please use a hostname shorter than %d characters."
|
||||
msgid "Error! The vHost is too long, please use a hostname shorter than %zu characters."
|
||||
msgstr "Error! The vHost is too long, please use a hostname shorter than %zu characters."
|
||||
|
||||
msgid ""
|
||||
"Examples:\n"
|
||||
@@ -4839,10 +4799,6 @@ msgstr "Manipulate the topic of the specified channel"
|
||||
msgid "Mask"
|
||||
msgstr "Mask"
|
||||
|
||||
#, c-format
|
||||
msgid "Mask %s already present on %s's access list."
|
||||
msgstr "Mask %s already present on %s's access list."
|
||||
|
||||
msgid "Mask must be in the form user@host."
|
||||
msgstr "Mask must be in the form user@host."
|
||||
|
||||
@@ -4933,48 +4889,6 @@ msgstr "Modes"
|
||||
msgid "Modes cleared on %s and the channel destroyed."
|
||||
msgstr "Modes cleared on %s and the channel destroyed."
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Modifies or displays the access list for your nick. This\n"
|
||||
"is the list of addresses which will be automatically\n"
|
||||
"recognized by %s as allowed to use the nick. If\n"
|
||||
"you want to use the nick from a different address, you\n"
|
||||
"need to send an IDENTIFY command to make %s\n"
|
||||
"recognize you. Services Operators may provide a nick\n"
|
||||
"to modify other users' access lists.\n"
|
||||
" \n"
|
||||
"Examples:\n"
|
||||
" \n"
|
||||
" ACCESS ADD anyone@*.bepeg.com\n"
|
||||
" Allows access to user anyone from any machine in\n"
|
||||
" the bepeg.com domain.\n"
|
||||
" \n"
|
||||
" ACCESS DEL anyone@*.bepeg.com\n"
|
||||
" Reverses the previous command.\n"
|
||||
" \n"
|
||||
" ACCESS LIST\n"
|
||||
" Displays the current access list."
|
||||
msgstr ""
|
||||
"Modifies or displays the access list for your nick. This\n"
|
||||
"is the list of addresses which will be automatically\n"
|
||||
"recognized by %s as allowed to use the nick. If\n"
|
||||
"you want to use the nick from a different address, you\n"
|
||||
"need to send an IDENTIFY command to make %s\n"
|
||||
"recognize you. Services Operators may provide a nick\n"
|
||||
"to modify other users' access lists.\n"
|
||||
" \n"
|
||||
"Examples:\n"
|
||||
" \n"
|
||||
" ACCESS ADD anyone@*.bepeg.com\n"
|
||||
" Allows access to user anyone from any machine in\n"
|
||||
" the bepeg.com domain.\n"
|
||||
" \n"
|
||||
" ACCESS DEL anyone@*.bepeg.com\n"
|
||||
" Reverses the previous command.\n"
|
||||
" \n"
|
||||
" ACCESS LIST\n"
|
||||
" Displays the current access list."
|
||||
|
||||
msgid ""
|
||||
"Modifies or displays the certificate list for your nick.\n"
|
||||
"If you connect to IRC and provide a client certificate with a\n"
|
||||
@@ -4994,9 +4908,6 @@ msgstr ""
|
||||
msgid "Modify the list of %s users"
|
||||
msgstr "Modify the list of %s users"
|
||||
|
||||
msgid "Modify the list of authorized addresses"
|
||||
msgstr "Modify the list of authorized addresses"
|
||||
|
||||
msgid "Modify the list of privileged users"
|
||||
msgstr "Modify the list of privileged users"
|
||||
|
||||
@@ -5107,8 +5018,8 @@ msgid "Nick %s isn't registered."
|
||||
msgstr "Nick %s isn't registered."
|
||||
|
||||
#, c-format
|
||||
msgid "Nick %s was truncated to %u characters."
|
||||
msgstr "Nick %s was truncated to %u characters."
|
||||
msgid "Nick %s was truncated to %zu characters."
|
||||
msgstr "Nick %s was truncated to %zu characters."
|
||||
|
||||
#, c-format
|
||||
msgid "Nick %s will expire."
|
||||
@@ -5151,8 +5062,8 @@ msgid "Nick %s is now suspended."
|
||||
msgstr "Nick %s is now suspended."
|
||||
|
||||
#, c-format
|
||||
msgid "Nick too long, max length is %u characters."
|
||||
msgstr "Nick too long, max length is %u characters."
|
||||
msgid "Nick too long, max length is %zu characters."
|
||||
msgstr "Nick too long, max length is %zu characters."
|
||||
|
||||
#, c-format
|
||||
msgid "Nickname %s has been dropped."
|
||||
@@ -5166,10 +5077,6 @@ msgstr "Nickname %s is already registered!"
|
||||
msgid "Nickname %s may not be registered."
|
||||
msgstr "Nickname %s may not be registered."
|
||||
|
||||
#, c-format
|
||||
msgid "Nickname %s registered under your user@host-mask: %s"
|
||||
msgstr "Nickname %s registered under your user@host-mask: %s"
|
||||
|
||||
#, c-format
|
||||
msgid "Nickname %s registered."
|
||||
msgstr "Nickname %s registered."
|
||||
@@ -5399,6 +5306,10 @@ msgstr "Peace option for %s is now on."
|
||||
msgid "Persistent"
|
||||
msgstr "Persistent"
|
||||
|
||||
#, c-format
|
||||
msgid "Please confirm that you want to drop %s with DROP %s %s"
|
||||
msgstr "Please confirm that you want to drop %s with DROP %s %s"
|
||||
|
||||
msgid "Please contact an Operator to get a vHost assigned to this nick."
|
||||
msgstr "Please contact an Operator to get a vHost assigned to this nick."
|
||||
|
||||
@@ -5681,7 +5592,7 @@ msgid ""
|
||||
"your nickname as a password is a much worse idea ;) and,\n"
|
||||
"in fact, %s will not allow it. Also, short\n"
|
||||
"passwords are vulnerable to trial-and-error searches, so\n"
|
||||
"you should choose a password at least 5 characters long.\n"
|
||||
"you should choose a password at least %u characters long.\n"
|
||||
"Finally, the space character cannot be used in passwords."
|
||||
msgstr ""
|
||||
"Registers your nickname in the %s database. Once\n"
|
||||
@@ -5699,7 +5610,7 @@ msgstr ""
|
||||
"your nickname as a password is a much worse idea ;) and,\n"
|
||||
"in fact, %s will not allow it. Also, short\n"
|
||||
"passwords are vulnerable to trial-and-error searches, so\n"
|
||||
"you should choose a password at least 5 characters long.\n"
|
||||
"you should choose a password at least %u characters long.\n"
|
||||
"Finally, the space character cannot be used in passwords."
|
||||
|
||||
msgid "Registration is currently disabled."
|
||||
@@ -5833,44 +5744,6 @@ msgstr "Returns the key of the given channel."
|
||||
msgid "Returns the matching accounts that used given email."
|
||||
msgstr "Returns the matching accounts that used given email."
|
||||
|
||||
msgid "Returns the owner status of the given nickname"
|
||||
msgstr "Returns the owner status of the given nickname"
|
||||
|
||||
msgid ""
|
||||
"Returns whether the user using the given nickname is\n"
|
||||
"recognized as the owner of the nickname. The response has\n"
|
||||
"this format:\n"
|
||||
" \n"
|
||||
" nickname status-code account\n"
|
||||
" \n"
|
||||
"where nickname is the nickname sent with the command,\n"
|
||||
"status-code is one of the following, and account\n"
|
||||
"is the account they are logged in as.\n"
|
||||
" \n"
|
||||
" 0 - no such user online or nickname not registered\n"
|
||||
" 1 - user not recognized as nickname's owner\n"
|
||||
" 2 - user recognized as owner via access list only\n"
|
||||
" 3 - user recognized as owner via password identification\n"
|
||||
" \n"
|
||||
"If no nickname is given, your status will be returned."
|
||||
msgstr ""
|
||||
"Returns whether the user using the given nickname is\n"
|
||||
"recognized as the owner of the nickname. The response has\n"
|
||||
"this format:\n"
|
||||
" \n"
|
||||
" nickname status-code account\n"
|
||||
" \n"
|
||||
"where nickname is the nickname sent with the command,\n"
|
||||
"status-code is one of the following, and account\n"
|
||||
"is the account they are logged in as.\n"
|
||||
" \n"
|
||||
" 0 - no such user online or nickname not registered\n"
|
||||
" 1 - user not recognized as nickname's owner\n"
|
||||
" 2 - user recognized as owner via access list only\n"
|
||||
" 3 - user recognized as owner via password identification\n"
|
||||
" \n"
|
||||
"If no nickname is given, your status will be returned."
|
||||
|
||||
msgid "Reverses kicker"
|
||||
msgstr "Reverses kicker"
|
||||
|
||||
@@ -5925,29 +5798,10 @@ msgstr "Secure ops option for %s is now off."
|
||||
msgid "Secure ops option for %s is now on."
|
||||
msgstr "Secure ops option for %s is now on."
|
||||
|
||||
#, c-format
|
||||
msgid "Secure option for %s is now off."
|
||||
msgstr "Secure option for %s is now off."
|
||||
|
||||
#, c-format
|
||||
msgid "Secure option for %s is now on."
|
||||
msgstr "Secure option for %s is now on."
|
||||
|
||||
#, c-format
|
||||
msgid "Secure option is now off for %s."
|
||||
msgstr "Secure option is now off for %s."
|
||||
|
||||
#, c-format
|
||||
msgid "Secure option is now on for %s."
|
||||
msgstr "Secure option is now on for %s."
|
||||
|
||||
#, c-format
|
||||
msgid "Secureops enforced on %s."
|
||||
msgstr "Secureops enforced on %s."
|
||||
|
||||
msgid "Security"
|
||||
msgstr "Security"
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"See %s%s HELP %s for more information\n"
|
||||
@@ -6675,10 +6529,6 @@ msgstr "Sorry, nickname grouping is temporarily disabled."
|
||||
msgid "Sorry, nickname registration is temporarily disabled."
|
||||
msgstr "Sorry, nickname registration is temporarily disabled."
|
||||
|
||||
#, c-format
|
||||
msgid "Sorry, the maximum of %d access entries has been reached."
|
||||
msgstr "Sorry, the maximum of %d access entries has been reached."
|
||||
|
||||
#, c-format
|
||||
msgid "Sorry, the maximum of %d auto join entries has been reached."
|
||||
msgstr "Sorry, the maximum of %d auto join entries has been reached."
|
||||
@@ -6968,7 +6818,7 @@ msgid ""
|
||||
" \n"
|
||||
"Sets read-only mode on or off. In read-only mode, normal\n"
|
||||
"users will not be allowed to modify any services data,\n"
|
||||
"including channel and nickname access lists, etc. IRCops\n"
|
||||
"including channel access lists, etc. Server operators\n"
|
||||
"with sufficient services privileges will be able to modify\n"
|
||||
"Services' AKILL, SQLINE, SNLINE and ignore lists, drop,\n"
|
||||
"suspend or forbid nicknames and channels, and manage news,\n"
|
||||
@@ -6983,7 +6833,7 @@ msgstr ""
|
||||
" \n"
|
||||
"Sets read-only mode on or off. In read-only mode, normal\n"
|
||||
"users will not be allowed to modify any services data,\n"
|
||||
"including channel and nickname access lists, etc. IRCops\n"
|
||||
"including channel access lists, etc. Server operators\n"
|
||||
"with sufficient services privileges will be able to modify\n"
|
||||
"Services' AKILL, SQLINE, SNLINE and ignore lists, drop,\n"
|
||||
"suspend or forbid nicknames and channels, and manage news,\n"
|
||||
@@ -7810,14 +7660,6 @@ msgstr "This command unloads the module named modname."
|
||||
msgid "This command will resend you the registration confirmation email."
|
||||
msgstr "This command will resend you the registration confirmation email."
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"This nick is owned by someone else. Please choose another.\n"
|
||||
"(If this is your nick, type %s%s IDENTIFY password.)"
|
||||
msgstr ""
|
||||
"This nick is owned by someone else. Please choose another.\n"
|
||||
"(If this is your nick, type %s%s IDENTIFY password.)"
|
||||
|
||||
#, c-format
|
||||
msgid "This nickname has been forbidden: %s"
|
||||
msgstr "This nickname has been forbidden: %s"
|
||||
@@ -7913,9 +7755,6 @@ msgstr "Turn caps lock OFF!"
|
||||
msgid "Turn chanstats statistics on or off"
|
||||
msgstr "Turn chanstats statistics on or off"
|
||||
|
||||
msgid "Turn nickname security on or off"
|
||||
msgstr "Turn nickname security on or off"
|
||||
|
||||
msgid "Turn protection on or off"
|
||||
msgstr "Turn protection on or off"
|
||||
|
||||
@@ -7947,24 +7786,6 @@ msgstr ""
|
||||
"(However, anyone who knows your nickname can still get\n"
|
||||
"information on it using the INFO command.)"
|
||||
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Turns %s's security features on or off for your\n"
|
||||
"nick. With SECURE 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"
|
||||
"KILL option."
|
||||
msgstr ""
|
||||
"Turns %s's security features on or off for your\n"
|
||||
"nick. With SECURE 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"
|
||||
"KILL option."
|
||||
|
||||
msgid "Turns chanstats channel statistics ON or OFF for this user."
|
||||
msgstr "Turns chanstats channel statistics ON or OFF for this user."
|
||||
|
||||
@@ -8129,6 +7950,14 @@ msgstr "Unknown command %s."
|
||||
msgid "Unknown command %s. \"%s%s HELP\" for help."
|
||||
msgstr "Unknown command %s. \"%s%s HELP\" for help."
|
||||
|
||||
#, c-format
|
||||
msgid "Unknown command %s. Did you mean %s?"
|
||||
msgstr "Unknown command %s. Did you mean %s?"
|
||||
|
||||
#, c-format
|
||||
msgid "Unknown command %s. Did you mean %s? \"%s%s HELP\" for help."
|
||||
msgstr "Unknown command %s. Did you mean %s? \"%s%s HELP\" for help."
|
||||
|
||||
#, c-format
|
||||
msgid "Unknown mode character %c ignored."
|
||||
msgstr "Unknown mode character %c ignored."
|
||||
@@ -8243,18 +8072,10 @@ msgstr "VHost"
|
||||
msgid "VHost for %s set to %s."
|
||||
msgstr "VHost for %s set to %s."
|
||||
|
||||
#, c-format
|
||||
msgid "VHost for %s set to %s@%s."
|
||||
msgstr "VHost for %s set to %s@%s."
|
||||
|
||||
#, c-format
|
||||
msgid "VHost for group %s set to %s."
|
||||
msgstr "VHost for group %s set to %s."
|
||||
|
||||
#, c-format
|
||||
msgid "VHost for group %s set to %s@%s."
|
||||
msgstr "VHost for group %s set to %s@%s."
|
||||
|
||||
msgid "VIEW host"
|
||||
msgstr "VIEW host"
|
||||
|
||||
@@ -8590,9 +8411,6 @@ msgstr "You may not drop other Services Operators' nicknames."
|
||||
msgid "You may not suspend other Services Operators' nicknames."
|
||||
msgstr "You may not suspend other Services Operators' nicknames."
|
||||
|
||||
msgid "You may view but not modify the access list of other Services Operators."
|
||||
msgstr "You may view but not modify the access list of other Services Operators."
|
||||
|
||||
msgid "You may view but not modify the certificate list of other Services Operators."
|
||||
msgstr "You may view but not modify the certificate list of other Services Operators."
|
||||
|
||||
@@ -8622,10 +8440,6 @@ msgstr "You must confirm your account before you may request a vhost."
|
||||
msgid "You must confirm your account before you may send a memo."
|
||||
msgstr "You must confirm your account before you may send a memo."
|
||||
|
||||
#, c-format
|
||||
msgid "You must enter the channel name twice as a confirmation that you wish to drop %s."
|
||||
msgstr "You must enter the channel name twice as a confirmation that you wish to drop %s."
|
||||
|
||||
#, c-format
|
||||
msgid "You must have been using this nick for at least %lu seconds to register."
|
||||
msgstr "You must have been using this nick for at least %lu seconds to register."
|
||||
@@ -8783,10 +8597,6 @@ msgstr "Your vHost has been requested."
|
||||
msgid "Your vhost of %s is now activated."
|
||||
msgstr "Your vhost of %s is now activated."
|
||||
|
||||
#, c-format
|
||||
msgid "Your vhost of %s@%s is now activated."
|
||||
msgstr "Your vhost of %s@%s is now activated."
|
||||
|
||||
msgid "Your vhost was removed and the normal cloaking restored."
|
||||
msgstr "Your vhost was removed and the normal cloaking restored."
|
||||
|
||||
|
||||
+19
-19
@@ -7,9 +7,9 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Anope\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-01-08 13:20+0000\n"
|
||||
"PO-Revision-Date: 2024-01-08 13:33+0000\n"
|
||||
"Last-Translator: Thomas Fargeix <t.fargeix@gmail.com>\n"
|
||||
"POT-Creation-Date: 2024-02-22 16:34+0000\n"
|
||||
"PO-Revision-Date: 2024-02-22 16:36+0000\n"
|
||||
"Last-Translator: Val Lorentz <progval+git@progval.net>\n"
|
||||
"Language-Team: French\n"
|
||||
"Language: fr_FR\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -2640,15 +2640,15 @@ msgid "Bot bans will no longer automatically expire."
|
||||
msgstr "Le bans du bot n'expireront plus automatiquement."
|
||||
|
||||
#, c-format
|
||||
msgid "Bot hosts may only be %d characters long."
|
||||
msgstr "Les hosts des bots ne doivent contenir que %d caractères."
|
||||
msgid "Bot hosts may only be %zu characters long."
|
||||
msgstr "Les hosts des bots ne doivent contenir que %zu caractères."
|
||||
|
||||
msgid "Bot hosts may only contain valid host characters."
|
||||
msgstr "Les hosts des bots ne doivent contenir que des caractères valides pour un host."
|
||||
|
||||
#, c-format
|
||||
msgid "Bot idents may only be %d characters long."
|
||||
msgstr "Les ident des bots ne doivent contenir que %d caractères."
|
||||
msgid "Bot idents may only be %zu characters long."
|
||||
msgstr "Les ident des bots ne doivent contenir que %zu caractères."
|
||||
|
||||
msgid "Bot idents may only contain valid ident characters."
|
||||
msgstr "Les ident des bots ne doivent contenir que des caractères valides pour un ident."
|
||||
@@ -2664,8 +2664,8 @@ msgid "Bot nick"
|
||||
msgstr "Pseudo du bot"
|
||||
|
||||
#, c-format
|
||||
msgid "Bot nicks may only be %d characters long."
|
||||
msgstr "Les pseudos des bots ne doivent contenir que %d caractères."
|
||||
msgid "Bot nicks may only be %zu characters long."
|
||||
msgstr "Les pseudos des bots ne doivent contenir que %zu caractères."
|
||||
|
||||
msgid "Bot nicks may only contain valid nick characters."
|
||||
msgstr "Les pseudos des bots ne peuvent contenir que des caractères valides."
|
||||
@@ -3949,12 +3949,12 @@ msgid "Error reloading configuration file: %s"
|
||||
msgstr "Erreur en rechargeant le fichier de configuration : %s"
|
||||
|
||||
#, c-format
|
||||
msgid "Error! The vHost ident is too long, please use an ident shorter than %d characters."
|
||||
msgstr "Erreur ! L'ident du vHost est trop long, merci d'utiliser un ident plus court que %d caractères."
|
||||
msgid "Error! The vHost ident is too long, please use an ident shorter than %zu characters."
|
||||
msgstr "Erreur ! L'ident du vHost est trop long, merci d'utiliser un ident plus court que %zu caractères."
|
||||
|
||||
#, c-format
|
||||
msgid "Error! The vHost is too long, please use a hostname shorter than %d characters."
|
||||
msgstr "Erreur ! Le vHost est trop long, merci d'utiliser un hostname plus court que %d caractères."
|
||||
msgid "Error! The vHost is too long, please use a hostname shorter than %zu characters."
|
||||
msgstr "Erreur ! Le vHost est trop long, merci d'utiliser un hostname plus court que %zu caractères."
|
||||
|
||||
msgid ""
|
||||
"Examples:\n"
|
||||
@@ -5140,8 +5140,8 @@ msgid "Nick %s isn't registered."
|
||||
msgstr "Le pseudo %s n'est pas enregistré."
|
||||
|
||||
#, c-format
|
||||
msgid "Nick %s was truncated to %u characters."
|
||||
msgstr "Le pseudo %s a été tronqué à %u caractères."
|
||||
msgid "Nick %s was truncated to %zu characters."
|
||||
msgstr "Le pseudo %s a été tronqué à %zu caractères."
|
||||
|
||||
#, c-format
|
||||
msgid "Nick %s will expire."
|
||||
@@ -5184,8 +5184,8 @@ msgid "Nick %s is now suspended."
|
||||
msgstr "Le pseudo %s a été suspendu."
|
||||
|
||||
#, c-format
|
||||
msgid "Nick too long, max length is %u characters."
|
||||
msgstr "Pseudo trop long, la taille maximale est de %u caractères."
|
||||
msgid "Nick too long, max length is %zu characters."
|
||||
msgstr "Pseudo trop long, la taille maximale est de %zu caractères."
|
||||
|
||||
#, c-format
|
||||
msgid "Nickname %s has been dropped."
|
||||
@@ -5714,7 +5714,7 @@ msgid ""
|
||||
"your nickname as a password is a much worse idea ;) and,\n"
|
||||
"in fact, %s will not allow it. Also, short\n"
|
||||
"passwords are vulnerable to trial-and-error searches, so\n"
|
||||
"you should choose a password at least 5 characters long.\n"
|
||||
"you should choose a password at least %u characters long.\n"
|
||||
"Finally, the space character cannot be used in passwords."
|
||||
msgstr ""
|
||||
"Enregistre votre pseudo dans la base de données de %s.\n"
|
||||
@@ -5735,7 +5735,7 @@ msgstr ""
|
||||
"ne vous laissera pas faire.. De même, les mots de passe\n"
|
||||
"courts sont vulnérables aux recherches méthodiques,\n"
|
||||
"donc vous devez choisir un mot de passe d'au moins \n"
|
||||
"5 caractères. Le caractère espace ne peut pas être \n"
|
||||
"%u caractères. Le caractère espace ne peut pas être \n"
|
||||
"utilisé dans les mots de passe."
|
||||
|
||||
msgid "Registration is currently disabled."
|
||||
|
||||
+18
-18
@@ -7,8 +7,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Anope\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-01-08 13:20+0000\n"
|
||||
"PO-Revision-Date: 2024-01-08 13:40+0000\n"
|
||||
"POT-Creation-Date: 2024-02-22 16:34+0000\n"
|
||||
"PO-Revision-Date: 2024-02-22 16:38+0000\n"
|
||||
"Last-Translator: Dragone2 <dragone2@risposteinformatiche.it>\n"
|
||||
"Language-Team: Italian\n"
|
||||
"Language: it_IT\n"
|
||||
@@ -2637,15 +2637,15 @@ msgid "Bot bans will no longer automatically expire."
|
||||
msgstr "I ban del bot non scadranno automaticamente."
|
||||
|
||||
#, c-format
|
||||
msgid "Bot hosts may only be %d characters long."
|
||||
msgstr "Gli host dei bot possono contenere solamente %d caratteri."
|
||||
msgid "Bot hosts may only be %zu characters long."
|
||||
msgstr "Gli host dei bot possono contenere solamente %zu caratteri."
|
||||
|
||||
msgid "Bot hosts may only contain valid host characters."
|
||||
msgstr "Gli host dei bot possono contenere unicamente caratteri validi."
|
||||
|
||||
#, c-format
|
||||
msgid "Bot idents may only be %d characters long."
|
||||
msgstr "Le ident dei bot possono contenere solamente %d caratteri."
|
||||
msgid "Bot idents may only be %zu characters long."
|
||||
msgstr "Le ident dei bot possono contenere solamente %zu caratteri."
|
||||
|
||||
msgid "Bot idents may only contain valid ident characters."
|
||||
msgstr "Le ident dei bot possono contenere unicamente caratteri validi."
|
||||
@@ -2661,8 +2661,8 @@ msgid "Bot nick"
|
||||
msgstr "Bot nick"
|
||||
|
||||
#, c-format
|
||||
msgid "Bot nicks may only be %d characters long."
|
||||
msgstr "I nick dei Bot possono contenere solamente %d caratteri."
|
||||
msgid "Bot nicks may only be %zu characters long."
|
||||
msgstr "I nick dei Bot possono contenere solamente %zu caratteri."
|
||||
|
||||
msgid "Bot nicks may only contain valid nick characters."
|
||||
msgstr "I nick dei bot possono contenere unicamente caratteri validi."
|
||||
@@ -3942,12 +3942,12 @@ msgid "Error reloading configuration file: %s"
|
||||
msgstr "Errore durante il ricaricamento del file di configurazione: %s"
|
||||
|
||||
#, c-format
|
||||
msgid "Error! The vHost ident is too long, please use an ident shorter than %d characters."
|
||||
msgstr "Errore! L'ident del vHost è troppo lunga, usa una ident più corta di %d caratteri."
|
||||
msgid "Error! The vHost ident is too long, please use an ident shorter than %zu characters."
|
||||
msgstr "Errore! L'ident del vHost è troppo lunga, usa una ident più corta di %zu caratteri."
|
||||
|
||||
#, c-format
|
||||
msgid "Error! The vHost is too long, please use a hostname shorter than %d characters."
|
||||
msgstr "Errore! Il vHost è troppo lungo, usa un hostname più corto di %d caratteri."
|
||||
msgid "Error! The vHost is too long, please use a hostname shorter than %zu characters."
|
||||
msgstr "Errore! Il vHost è troppo lungo, usa un hostname più corto di %zu caratteri."
|
||||
|
||||
msgid ""
|
||||
"Examples:\n"
|
||||
@@ -5143,8 +5143,8 @@ msgid "Nick %s isn't registered."
|
||||
msgstr "Il nick %s non è registrato."
|
||||
|
||||
#, c-format
|
||||
msgid "Nick %s was truncated to %u characters."
|
||||
msgstr "Il nick %s è stato troncato a %u caratteri."
|
||||
msgid "Nick %s was truncated to %zu characters."
|
||||
msgstr "Il nick %s è stato troncato a %zu caratteri."
|
||||
|
||||
#, c-format
|
||||
msgid "Nick %s will expire."
|
||||
@@ -5187,8 +5187,8 @@ msgid "Nick %s is now suspended."
|
||||
msgstr "Il nick %s è ora sospeso."
|
||||
|
||||
#, c-format
|
||||
msgid "Nick too long, max length is %u characters."
|
||||
msgstr "Nick troppo lungo, lunghezza massima consentita %u caratteri."
|
||||
msgid "Nick too long, max length is %zu characters."
|
||||
msgstr "Nick troppo lungo, lunghezza massima consentita %zu caratteri."
|
||||
|
||||
#, c-format
|
||||
msgid "Nickname %s has been dropped."
|
||||
@@ -5716,7 +5716,7 @@ msgid ""
|
||||
"your nickname as a password is a much worse idea ;) and,\n"
|
||||
"in fact, %s will not allow it. Also, short\n"
|
||||
"passwords are vulnerable to trial-and-error searches, so\n"
|
||||
"you should choose a password at least 5 characters long.\n"
|
||||
"you should choose a password at least %u characters long.\n"
|
||||
"Finally, the space character cannot be used in passwords."
|
||||
msgstr ""
|
||||
"Registra il tuo nick nel database di %s. Quando il\n"
|
||||
@@ -5737,7 +5737,7 @@ msgstr ""
|
||||
"anche peggiore, infatti %s non ti permetterà di farlo.\n"
|
||||
"Inoltre, le password brevi sono facili da indovinare con\n"
|
||||
"meno tentativi, pertanto è necessario scegliere una password \n"
|
||||
"di almeno 5 caratteri. Infine, gli spazi non possono essere \n"
|
||||
"di almeno %u caratteri. Infine, gli spazi non possono essere \n"
|
||||
"usati all'interno di una password."
|
||||
|
||||
msgid "Registration is currently disabled."
|
||||
|
||||
+19
-18
@@ -7,8 +7,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Anope\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-01-30 04:54+0100\n"
|
||||
"PO-Revision-Date: 2024-01-31 05:55+0100\n"
|
||||
"POT-Creation-Date: 2024-02-22 16:34+0000\n"
|
||||
"PO-Revision-Date: 2024-02-22 16:39+0000\n"
|
||||
"Last-Translator: Robby <robby@chatbelgie.be>\n"
|
||||
"Language-Team: Dutch\n"
|
||||
"Language: nl_NL\n"
|
||||
@@ -16,6 +16,7 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Poedit 3.4\n"
|
||||
|
||||
#, c-format
|
||||
msgid "%d channel(s) cleared, and %d channel(s) dropped."
|
||||
@@ -2643,15 +2644,15 @@ msgid "Bot bans will no longer automatically expire."
|
||||
msgstr "Bot bans zullen niet langer automatisch verlopen."
|
||||
|
||||
#, c-format
|
||||
msgid "Bot hosts may only be %d characters long."
|
||||
msgstr "Bot hosts mogen maximaal %d karakters bevatten."
|
||||
msgid "Bot hosts may only be %zu characters long."
|
||||
msgstr "Bot hosts mogen maximaal %zu karakters bevatten."
|
||||
|
||||
msgid "Bot hosts may only contain valid host characters."
|
||||
msgstr "Bot hosts mogen alleen geldige host-karakters bevatten."
|
||||
|
||||
#, c-format
|
||||
msgid "Bot idents may only be %d characters long."
|
||||
msgstr "Bot idents mogen maximaal %d karakters bevatten."
|
||||
msgid "Bot idents may only be %zu characters long."
|
||||
msgstr "Bot idents mogen maximaal %zu karakters bevatten."
|
||||
|
||||
msgid "Bot idents may only contain valid ident characters."
|
||||
msgstr "Bot idents mogen alleen geldige ident-karakters bevatten."
|
||||
@@ -2667,8 +2668,8 @@ msgid "Bot nick"
|
||||
msgstr "Bot nick"
|
||||
|
||||
#, c-format
|
||||
msgid "Bot nicks may only be %d characters long."
|
||||
msgstr "Bot nicks mogen maximaal %d karakters bevatten."
|
||||
msgid "Bot nicks may only be %zu characters long."
|
||||
msgstr "Bot nicks mogen maximaal %zu karakters bevatten."
|
||||
|
||||
msgid "Bot nicks may only contain valid nick characters."
|
||||
msgstr "Bot nicks mogen alleen geldige nick-karakters bevatten."
|
||||
@@ -3953,12 +3954,12 @@ msgid "Error reloading configuration file: %s"
|
||||
msgstr "Fout bij laden configuratiebestand: %s"
|
||||
|
||||
#, c-format
|
||||
msgid "Error! The vHost ident is too long, please use an ident shorter than %d characters."
|
||||
msgstr "Fout! De vHost ident is te lang, gelieve een ident korter dan %d karakters op te geven."
|
||||
msgid "Error! The vHost ident is too long, please use an ident shorter than %zu characters."
|
||||
msgstr "Fout! De vHost ident is te lang, gelieve een ident korter dan %zu karakters op te geven."
|
||||
|
||||
#, c-format
|
||||
msgid "Error! The vHost is too long, please use a hostname shorter than %d characters."
|
||||
msgstr "Fout! De vHost is te lang, gelieve een host korter dan %d karakters op te geven."
|
||||
msgid "Error! The vHost is too long, please use a hostname shorter than %zu characters."
|
||||
msgstr "Fout! De vHost is te lang, gelieve een host korter dan %zu karakters op te geven."
|
||||
|
||||
msgid ""
|
||||
"Examples:\n"
|
||||
@@ -5156,8 +5157,8 @@ msgid "Nick %s isn't registered."
|
||||
msgstr "Nick %s is niet geregistreerd."
|
||||
|
||||
#, c-format
|
||||
msgid "Nick %s was truncated to %u characters."
|
||||
msgstr "Nick %s werd verkort naar %u karakters."
|
||||
msgid "Nick %s was truncated to %zu characters."
|
||||
msgstr "Nick %s werd verkort naar %zu karakters."
|
||||
|
||||
#, c-format
|
||||
msgid "Nick %s will expire."
|
||||
@@ -5200,8 +5201,8 @@ msgid "Nick %s is now suspended."
|
||||
msgstr "Nick %s is nu geschorst."
|
||||
|
||||
#, c-format
|
||||
msgid "Nick too long, max length is %u characters."
|
||||
msgstr "Nick te lang, maximum lengte is %u karakters."
|
||||
msgid "Nick too long, max length is %zu characters."
|
||||
msgstr "Nick te lang, maximum lengte is %zu karakters."
|
||||
|
||||
#, c-format
|
||||
msgid "Nickname %s has been dropped."
|
||||
@@ -5730,7 +5731,7 @@ msgid ""
|
||||
"your nickname as a password is a much worse idea ;) and,\n"
|
||||
"in fact, %s will not allow it. Also, short\n"
|
||||
"passwords are vulnerable to trial-and-error searches, so\n"
|
||||
"you should choose a password at least 5 characters long.\n"
|
||||
"you should choose a password at least %u characters long.\n"
|
||||
"Finally, the space character cannot be used in passwords."
|
||||
msgstr ""
|
||||
"Registreert je nick in de %s database. Wanneer je nick\n"
|
||||
@@ -5749,7 +5750,7 @@ msgstr ""
|
||||
"nick als een wachtwoord gebruiken is een veel slechter idee ;)\n"
|
||||
"en in feite, %s staat het niet toe. Bovendien zijn korte wachtwoorden\n"
|
||||
"kwetsbaar voor zoekacties, dus kies je best een wachtwoord\n"
|
||||
"dat minstens 5 karakters lang is. Als laatste, de spatie kan niet\n"
|
||||
"dat minstens %u karakters lang is. Als laatste, de spatie kan niet\n"
|
||||
"gebruikt worden in wachtwoorden."
|
||||
|
||||
msgid "Registration is currently disabled."
|
||||
|
||||
+19
-19
@@ -7,9 +7,9 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Anope\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-01-08 13:20+0000\n"
|
||||
"PO-Revision-Date: 2024-01-08 13:46+0000\n"
|
||||
"Last-Translator: Adam <adam@anope.org>\n"
|
||||
"POT-Creation-Date: 2024-02-22 16:34+0000\n"
|
||||
"PO-Revision-Date: 2024-02-22 16:42+0000\n"
|
||||
"Last-Translator: k4be <k4be@pirc.pl>\n"
|
||||
"Language-Team: Polish\n"
|
||||
"Language: pl_PL\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -2632,15 +2632,15 @@ msgid "Bot bans will no longer automatically expire."
|
||||
msgstr "Bany zakładane przez bota nie będą już się przedawniały."
|
||||
|
||||
#, c-format
|
||||
msgid "Bot hosts may only be %d characters long."
|
||||
msgstr "Host bota może się składać maksymalnie z %d znaków."
|
||||
msgid "Bot hosts may only be %zu characters long."
|
||||
msgstr "Host bota może się składać maksymalnie z %zu znaków."
|
||||
|
||||
msgid "Bot hosts may only contain valid host characters."
|
||||
msgstr "Host bota może zawierać tylko prawidłowe znaki."
|
||||
|
||||
#, c-format
|
||||
msgid "Bot idents may only be %d characters long."
|
||||
msgstr "Ident bota może się składać maksymalnie z %d znaków."
|
||||
msgid "Bot idents may only be %zu characters long."
|
||||
msgstr "Ident bota może się składać maksymalnie z %zu znaków."
|
||||
|
||||
msgid "Bot idents may only contain valid ident characters."
|
||||
msgstr "Ident bota może zawierać tylko prawidłowe znaki."
|
||||
@@ -2656,8 +2656,8 @@ msgid "Bot nick"
|
||||
msgstr "Nick bota"
|
||||
|
||||
#, c-format
|
||||
msgid "Bot nicks may only be %d characters long."
|
||||
msgstr "Nick bota może się składać maksymalnie z %d znaków."
|
||||
msgid "Bot nicks may only be %zu characters long."
|
||||
msgstr "Nick bota może się składać maksymalnie z %zu znaków."
|
||||
|
||||
msgid "Bot nicks may only contain valid nick characters."
|
||||
msgstr "Nick bota może zawierać tylko prawidłowe znaki."
|
||||
@@ -3926,12 +3926,12 @@ msgid "Error reloading configuration file: %s"
|
||||
msgstr "Błąd przeładowywania pliku konfiguracyjnego: %s"
|
||||
|
||||
#, c-format
|
||||
msgid "Error! The vHost ident is too long, please use an ident shorter than %d characters."
|
||||
msgstr "Błąd: podany wirtualny ident jest zbyt długi. Proszę użyć nazwy krótszej niż %d znaków."
|
||||
msgid "Error! The vHost ident is too long, please use an ident shorter than %zu characters."
|
||||
msgstr "Błąd: podany wirtualny ident jest zbyt długi. Proszę użyć nazwy krótszej niż %zu znaków."
|
||||
|
||||
#, c-format
|
||||
msgid "Error! The vHost is too long, please use a hostname shorter than %d characters."
|
||||
msgstr "Błąd: podany vHost jest zbyt długi. Proszę użyć nazwy krótszej niż %d znaków."
|
||||
msgid "Error! The vHost is too long, please use a hostname shorter than %zu characters."
|
||||
msgstr "Błąd: podany vHost jest zbyt długi. Proszę użyć nazwy krótszej niż %zu znaków."
|
||||
|
||||
msgid ""
|
||||
"Examples:\n"
|
||||
@@ -5126,8 +5126,8 @@ msgid "Nick %s isn't registered."
|
||||
msgstr "Nick %s nie jest zarejestrowany."
|
||||
|
||||
#, c-format
|
||||
msgid "Nick %s was truncated to %u characters."
|
||||
msgstr "Nick %s został skrócony do %u znaków."
|
||||
msgid "Nick %s was truncated to %zu characters."
|
||||
msgstr "Nick %s został skrócony do %zu znaków."
|
||||
|
||||
#, c-format
|
||||
msgid "Nick %s will expire."
|
||||
@@ -5170,8 +5170,8 @@ msgid "Nick %s is now suspended."
|
||||
msgstr "Nick %s został zawieszony."
|
||||
|
||||
#, c-format
|
||||
msgid "Nick too long, max length is %u characters."
|
||||
msgstr "Zbyt długi nick. Maksymalna długość to %u znaków."
|
||||
msgid "Nick too long, max length is %zu characters."
|
||||
msgstr "Zbyt długi nick. Maksymalna długość to %zu znaków."
|
||||
|
||||
#, c-format
|
||||
msgid "Nickname %s has been dropped."
|
||||
@@ -5697,7 +5697,7 @@ msgid ""
|
||||
"your nickname as a password is a much worse idea ;) and,\n"
|
||||
"in fact, %s will not allow it. Also, short\n"
|
||||
"passwords are vulnerable to trial-and-error searches, so\n"
|
||||
"you should choose a password at least 5 characters long.\n"
|
||||
"you should choose a password at least %u characters long.\n"
|
||||
"Finally, the space character cannot be used in passwords."
|
||||
msgstr ""
|
||||
"Rejestruje aktualnie używany nick w bazie %s.\n"
|
||||
@@ -5714,7 +5714,7 @@ msgstr ""
|
||||
"jako haseł jest niewskazane. Nie wolno użyć hasła takiego\n"
|
||||
"samego, jak nick (a %s na to nie pozwoli). Bardzo krótkie\n"
|
||||
"hasło może zostać odgadnięte metodą prób i błędów.\n"
|
||||
"Twoje hasło musi mieć długość co najmniej 5 znaków.\n"
|
||||
"Twoje hasło musi mieć długość co najmniej %u znaków.\n"
|
||||
"Znak spacji nie może być użyty w haśle."
|
||||
|
||||
msgid "Registration is currently disabled."
|
||||
|
||||
+19
-19
@@ -7,8 +7,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Anope\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-01-22 19:47+0000\n"
|
||||
"PO-Revision-Date: 2024-01-22 22:41+0300\n"
|
||||
"POT-Creation-Date: 2024-02-22 16:34+0000\n"
|
||||
"PO-Revision-Date: 2024-02-22 16:43+0000\n"
|
||||
"Last-Translator: CaPaCuL <capacul@gmail.com>\n"
|
||||
"Language-Team: Turkish\n"
|
||||
"Language: tr_TR\n"
|
||||
@@ -16,7 +16,7 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Poedit 3.4.2\n"
|
||||
"X-Generator: Poedit 3.4\n"
|
||||
|
||||
#, c-format
|
||||
msgid "%d channel(s) cleared, and %d channel(s) dropped."
|
||||
@@ -2626,15 +2626,15 @@ msgid "Bot bans will no longer automatically expire."
|
||||
msgstr "Bot banları artık otomatik olarak sona ermeyecek."
|
||||
|
||||
#, c-format
|
||||
msgid "Bot hosts may only be %d characters long."
|
||||
msgstr "Bot hostları yalnızca %d karakter uzunluğunda olabilir."
|
||||
msgid "Bot hosts may only be %zu characters long."
|
||||
msgstr "Bot hostları yalnızca %zu karakter uzunluğunda olabilir."
|
||||
|
||||
msgid "Bot hosts may only contain valid host characters."
|
||||
msgstr "Bot hostları yalnızca geçerli host karakterlerini içerebilir."
|
||||
|
||||
#, c-format
|
||||
msgid "Bot idents may only be %d characters long."
|
||||
msgstr "Bot identleri yalnızca %d karakter uzunluğunda olabilir."
|
||||
msgid "Bot idents may only be %zu characters long."
|
||||
msgstr "Bot identleri yalnızca %zu karakter uzunluğunda olabilir."
|
||||
|
||||
msgid "Bot idents may only contain valid ident characters."
|
||||
msgstr "Bot identleri yalnızca geçerli ident karakterlerini içerebilir."
|
||||
@@ -2650,8 +2650,8 @@ msgid "Bot nick"
|
||||
msgstr "Bot rumuzu"
|
||||
|
||||
#, c-format
|
||||
msgid "Bot nicks may only be %d characters long."
|
||||
msgstr "Bot rumuzları yalnızca %d karakter uzunluğunda olabilir."
|
||||
msgid "Bot nicks may only be %zu characters long."
|
||||
msgstr "Bot rumuzları yalnızca %zu karakter uzunluğunda olabilir."
|
||||
|
||||
msgid "Bot nicks may only contain valid nick characters."
|
||||
msgstr "Bot rumuzları yalnızca geçerli rumuz karakterlerini içerebilir."
|
||||
@@ -3917,12 +3917,12 @@ msgid "Error reloading configuration file: %s"
|
||||
msgstr "Yapılandırma dosyası yeniden yüklenirken hata oluştu: %s"
|
||||
|
||||
#, c-format
|
||||
msgid "Error! The vHost ident is too long, please use an ident shorter than %d characters."
|
||||
msgstr "Hata! vHost kimliği çok uzun, lütfen %d karakterden daha kısa bir ident kullanın."
|
||||
msgid "Error! The vHost ident is too long, please use an ident shorter than %zu characters."
|
||||
msgstr "Hata! vHost kimliği çok uzun, lütfen %zu karakterden daha kısa bir ident kullanın."
|
||||
|
||||
#, c-format
|
||||
msgid "Error! The vHost is too long, please use a hostname shorter than %d characters."
|
||||
msgstr "Hata! vHost çok uzun, lütfen %d karakterden kısa bir host adı kullanın."
|
||||
msgid "Error! The vHost is too long, please use a hostname shorter than %zu characters."
|
||||
msgstr "Hata! vHost çok uzun, lütfen %zu karakterden kısa bir host adı kullanın."
|
||||
|
||||
msgid ""
|
||||
"Examples:\n"
|
||||
@@ -5106,8 +5106,8 @@ msgid "Nick %s isn't registered."
|
||||
msgstr "%s rumuzu kayıtlı değil."
|
||||
|
||||
#, c-format
|
||||
msgid "Nick %s was truncated to %u characters."
|
||||
msgstr "%s rumuzu, %u karaktere kısaltıldı."
|
||||
msgid "Nick %s was truncated to %zu characters."
|
||||
msgstr "%s rumuzu, %zu karaktere kısaltıldı."
|
||||
|
||||
#, c-format
|
||||
msgid "Nick %s will expire."
|
||||
@@ -5150,8 +5150,8 @@ msgid "Nick %s is now suspended."
|
||||
msgstr "%s rumuzu askıya alınmış."
|
||||
|
||||
#, c-format
|
||||
msgid "Nick too long, max length is %u characters."
|
||||
msgstr "Rumuz çok uzun, maks uzunluk %u karakterdir."
|
||||
msgid "Nick too long, max length is %zu characters."
|
||||
msgstr "Rumuz çok uzun, maks uzunluk %zu karakterdir."
|
||||
|
||||
#, c-format
|
||||
msgid "Nickname %s has been dropped."
|
||||
@@ -5680,7 +5680,7 @@ msgid ""
|
||||
"your nickname as a password is a much worse idea ;) and,\n"
|
||||
"in fact, %s will not allow it. Also, short\n"
|
||||
"passwords are vulnerable to trial-and-error searches, so\n"
|
||||
"you should choose a password at least 5 characters long.\n"
|
||||
"you should choose a password at least %u characters long.\n"
|
||||
"Finally, the space character cannot be used in passwords."
|
||||
msgstr ""
|
||||
"Rumuzunuzu %s veritabanına kaydedin. Rumuzunuz kaydedildikten\n"
|
||||
@@ -5697,7 +5697,7 @@ msgstr ""
|
||||
"gerçek adınızı şifre olarak kullanmak kötü bir fikirdir.\n"
|
||||
"Rumuzunuzu şifre olarak kullanmak çok daha kötü bir fikir ;)\n"
|
||||
"ve aslında %s buna izin vermeyecektir. Ayrıca kısa şifreler\n"
|
||||
"deneme yanılma yoluyla aranmaya açık olduğundan en az 5\n"
|
||||
"deneme yanılma yoluyla aranmaya açık olduğundan en az %u\n"
|
||||
"karakter uzunluğunda bir şifre seçmelisiniz. Son\n"
|
||||
"olarak boşluk karakteri şifrelerde kullanılamaz."
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ struct BadWordImpl final
|
||||
data.SetType("type", Serialize::Data::DT_INT); data["type"] << this->type;
|
||||
}
|
||||
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
|
||||
};
|
||||
|
||||
struct BadWordsImpl final
|
||||
@@ -40,7 +40,7 @@ struct BadWordsImpl final
|
||||
|
||||
~BadWordsImpl() override;
|
||||
|
||||
BadWord* AddBadWord(const Anope::string &word, BadWordType type) override
|
||||
BadWord *AddBadWord(const Anope::string &word, BadWordType type) override
|
||||
{
|
||||
auto *bw = new BadWordImpl();
|
||||
bw->chan = ci->name;
|
||||
@@ -54,7 +54,7 @@ struct BadWordsImpl final
|
||||
return bw;
|
||||
}
|
||||
|
||||
BadWord* GetBadWord(unsigned index) const override
|
||||
BadWord *GetBadWord(unsigned index) const override
|
||||
{
|
||||
if (this->badwords->empty() || index >= this->badwords->size())
|
||||
return NULL;
|
||||
@@ -117,7 +117,7 @@ BadWordImpl::~BadWordImpl()
|
||||
}
|
||||
}
|
||||
|
||||
Serializable* BadWordImpl::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
Serializable *BadWordImpl::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
{
|
||||
Anope::string sci, sword;
|
||||
|
||||
|
||||
+13
-16
@@ -28,23 +28,21 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
Configuration::Block *networkinfo = Config->GetBlock("networkinfo");
|
||||
|
||||
if (nick.length() > networkinfo->Get<unsigned>("nicklen"))
|
||||
if (nick.length() > IRCD->GetMaxNick())
|
||||
{
|
||||
source.Reply(_("Bot nicks may only be %d characters long."), networkinfo->Get<unsigned>("nicklen"));
|
||||
source.Reply(_("Bot nicks may only be %zu characters long."), IRCD->GetMaxNick());
|
||||
return;
|
||||
}
|
||||
|
||||
if (user.length() > networkinfo->Get<unsigned>("userlen"))
|
||||
if (user.length() > IRCD->GetMaxUser())
|
||||
{
|
||||
source.Reply(_("Bot idents may only be %d characters long."), networkinfo->Get<unsigned>("userlen"));
|
||||
source.Reply(_("Bot idents may only be %zu characters long."), IRCD->GetMaxUser());
|
||||
return;
|
||||
}
|
||||
|
||||
if (host.length() > networkinfo->Get<unsigned>("hostlen"))
|
||||
if (host.length() > IRCD->GetMaxHost())
|
||||
{
|
||||
source.Reply(_("Bot hosts may only be %d characters long."), networkinfo->Get<unsigned>("hostlen"));
|
||||
source.Reply(_("Bot hosts may only be %zu characters long."), IRCD->GetMaxHost());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -120,23 +118,22 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
Configuration::Block *networkinfo = Config->GetBlock("networkinfo");
|
||||
|
||||
if (nick.length() > networkinfo->Get<unsigned>("nicklen"))
|
||||
if (nick.length() > IRCD->GetMaxNick())
|
||||
{
|
||||
source.Reply(_("Bot nicks may only be %d characters long."), networkinfo->Get<unsigned>("nicklen"));
|
||||
source.Reply(_("Bot nicks may only be %zu characters long."), IRCD->GetMaxNick());
|
||||
return;
|
||||
}
|
||||
|
||||
if (user.length() > networkinfo->Get<unsigned>("userlen"))
|
||||
if (user.length() > IRCD->GetMaxUser())
|
||||
{
|
||||
source.Reply(_("Bot idents may only be %d characters long."), networkinfo->Get<unsigned>("userlen"));
|
||||
source.Reply(_("Bot idents may only be %zu characters long."), IRCD->GetMaxUser());
|
||||
return;
|
||||
}
|
||||
|
||||
if (host.length() > networkinfo->Get<unsigned>("hostlen"))
|
||||
if (host.length() > IRCD->GetMaxHost())
|
||||
{
|
||||
source.Reply(_("Bot hosts may only be %d characters long."), networkinfo->Get<unsigned>("hostlen"));
|
||||
source.Reply(_("Bot hosts may only be %zu characters long."), IRCD->GetMaxHost()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class CommandBSInfo final
|
||||
: public Command
|
||||
{
|
||||
private:
|
||||
void send_bot_channels(std::vector<Anope::string> &buffers, const BotInfo *bi)
|
||||
static void send_bot_channels(std::vector<Anope::string> &buffers, const BotInfo *bi)
|
||||
{
|
||||
Anope::string buf;
|
||||
for (const auto &[_, ci] : *RegisteredChannelList)
|
||||
|
||||
@@ -175,7 +175,7 @@ public:
|
||||
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override = 0;
|
||||
|
||||
protected:
|
||||
bool CheckArguments(CommandSource &source, const std::vector<Anope::string> ¶ms, ChannelInfo* &ci)
|
||||
bool CheckArguments(CommandSource &source, const std::vector<Anope::string> ¶ms, ChannelInfo *&ci)
|
||||
{
|
||||
const Anope::string &chan = params[0];
|
||||
const Anope::string &option = params[1];
|
||||
@@ -1091,7 +1091,7 @@ class BSKick final
|
||||
}
|
||||
}
|
||||
|
||||
void bot_kick(ChannelInfo *ci, User *u, const char *message, ...) ATTR_FORMAT(4, 5)
|
||||
static void bot_kick(ChannelInfo *ci, User *u, const char *message, ...) ATTR_FORMAT(3, 4)
|
||||
{
|
||||
va_list args;
|
||||
char buf[1024];
|
||||
@@ -1104,7 +1104,7 @@ class BSKick final
|
||||
vsnprintf(buf, sizeof(buf), fmt.c_str(), args);
|
||||
va_end(args);
|
||||
|
||||
ci->c->Kick(ci->bi, u, "%s", buf);
|
||||
ci->c->Kick(ci->bi, u, Anope::string(buf));
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -1241,7 +1241,7 @@ public:
|
||||
info.AddOption(_("Voices protection"));
|
||||
}
|
||||
|
||||
void OnPrivmsg(User *u, Channel *c, Anope::string &msg) override
|
||||
void OnPrivmsg(User *u, Channel *c, Anope::string &msg, const Anope::map<Anope::string> &tags) override
|
||||
{
|
||||
/* Now we can make kicker stuff. We try to order the checks
|
||||
* from the fastest one to the slowest one, since there's
|
||||
|
||||
@@ -116,12 +116,11 @@ public:
|
||||
|
||||
ChanServ = bi;
|
||||
|
||||
spacesepstream(conf->GetModule(this)->Get<const Anope::string>("defaults", "keeptopic peace cs_secure securefounder signkick")).GetTokens(defaults);
|
||||
spacesepstream(conf->GetModule(this)->Get<const Anope::string>("defaults", "keeptopic peace securefounder signkick")).GetTokens(defaults);
|
||||
if (defaults.empty())
|
||||
{
|
||||
defaults.emplace_back("KEEPTOPIC");
|
||||
defaults.emplace_back("PEACE");
|
||||
defaults.emplace_back("CS_SECURE");
|
||||
defaults.emplace_back("SECUREFOUNDER");
|
||||
defaults.emplace_back("SIGNKICK");
|
||||
}
|
||||
@@ -137,7 +136,7 @@ public:
|
||||
ChanServ = NULL;
|
||||
}
|
||||
|
||||
EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message) override
|
||||
EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message, const Anope::map<Anope::string> &tags) override
|
||||
{
|
||||
if (bi == ChanServ && Config->GetModule(this)->Get<bool>("opersonly") && !u->HasMode("OPER"))
|
||||
{
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
return new AccessChanAccess(this);
|
||||
}
|
||||
};
|
||||
AccessAccessProvider* AccessAccessProvider::me;
|
||||
AccessAccessProvider *AccessAccessProvider::me;
|
||||
|
||||
class CommandCSAccess final
|
||||
: public Command
|
||||
@@ -713,7 +713,7 @@ class CommandCSLevels final
|
||||
source.Reply(_("Setting \002%s\002 not known. Type \002%s%s HELP LEVELS\002 for a list of valid settings."), what.c_str(), Config->StrictPrivmsg.c_str(), source.service->nick.c_str());
|
||||
}
|
||||
|
||||
void DoList(CommandSource &source, ChannelInfo *ci)
|
||||
static void DoList(CommandSource &source, ChannelInfo *ci)
|
||||
{
|
||||
source.Reply(_("Access level settings for channel %s:"), ci->name.c_str());
|
||||
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
class CommandCSClone final
|
||||
: public Command
|
||||
{
|
||||
void CopySetting(ChannelInfo *ci, ChannelInfo *target_ci, const Anope::string &setting)
|
||||
static void CopySetting(ChannelInfo *ci, ChannelInfo *target_ci, const Anope::string &setting)
|
||||
{
|
||||
if (ci->HasExt(setting))
|
||||
target_ci->Extend<bool>(setting);
|
||||
}
|
||||
|
||||
void CopyAccess(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
|
||||
static void CopyAccess(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
|
||||
{
|
||||
std::set<Anope::string> masks;
|
||||
unsigned access_max = Config->GetModule("chanserv")->Get<unsigned>("accessmax", "1024");
|
||||
@@ -58,7 +58,7 @@ class CommandCSClone final
|
||||
source.Reply(_("%d access entries from \002%s\002 have been cloned to \002%s\002."), count, ci->name.c_str(), target_ci->name.c_str());
|
||||
}
|
||||
|
||||
void CopyAkick(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
|
||||
static void CopyAkick(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
|
||||
{
|
||||
target_ci->ClearAkick();
|
||||
for (unsigned i = 0; i < ci->GetAkickCount(); ++i)
|
||||
@@ -73,7 +73,7 @@ class CommandCSClone final
|
||||
source.Reply(_("All akick entries from \002%s\002 have been cloned to \002%s\002."), ci->name.c_str(), target_ci->name.c_str());
|
||||
}
|
||||
|
||||
void CopyBadwords(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
|
||||
static void CopyBadwords(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
|
||||
{
|
||||
BadWords *target_badwords = target_ci->Require<BadWords>("badwords"),
|
||||
*badwords = ci->Require<BadWords>("badwords");
|
||||
@@ -98,7 +98,7 @@ class CommandCSClone final
|
||||
source.Reply(_("All badword entries from \002%s\002 have been cloned to \002%s\002."), ci->name.c_str(), target_ci->name.c_str());
|
||||
}
|
||||
|
||||
void CopyLevels(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
|
||||
static void CopyLevels(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
|
||||
{
|
||||
for (const auto &[priv, level] : ci->GetLevelEntries())
|
||||
{
|
||||
@@ -196,7 +196,7 @@ public:
|
||||
target_ci->last_topic_setter = source.service->nick;
|
||||
|
||||
const Anope::string settings[] = { "NOAUTOOP", "CS_KEEP_MODES", "PEACE", "PERSIST", "RESTRICTED",
|
||||
"CS_SECURE", "SECUREFOUNDER", "SECUREOPS", "SIGNKICK", "SIGNKICK_LEVEL", "CS_NO_EXPIRE" };
|
||||
"SECUREFOUNDER", "SECUREOPS", "SIGNKICK", "SIGNKICK_LEVEL", "CS_NO_EXPIRE" };
|
||||
|
||||
for (const auto &setting : settings)
|
||||
CopySetting(ci, target_ci, setting);
|
||||
|
||||
@@ -14,11 +14,16 @@
|
||||
class CommandCSDrop final
|
||||
: public Command
|
||||
{
|
||||
private:
|
||||
PrimitiveExtensibleItem<Anope::string> dropcode;
|
||||
|
||||
public:
|
||||
CommandCSDrop(Module *creator) : Command(creator, "chanserv/drop", 1, 2)
|
||||
CommandCSDrop(Module *creator)
|
||||
: Command(creator, "chanserv/drop", 1, 2)
|
||||
, dropcode(creator, "dropcode")
|
||||
{
|
||||
this->SetDesc(_("Cancel the registration of a channel"));
|
||||
this->SetSyntax(_("\037channel\037 \037channel\037"));
|
||||
this->SetSyntax(_("\037channel\037 [\037code\037]"));
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override
|
||||
@@ -38,22 +43,33 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
if (params.size() < 2 || !chan.equals_ci(params[1]))
|
||||
{
|
||||
source.Reply(_("You must enter the channel name twice as a confirmation that you wish to drop \002%s\002."), chan.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if ((ci->HasExt("SECUREFOUNDER") ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER")) && !source.HasCommand("chanserv/drop"))
|
||||
{
|
||||
source.Reply(ACCESS_DENIED);
|
||||
return;
|
||||
}
|
||||
|
||||
auto *code = dropcode.Get(ci);
|
||||
if (params.size() < 2 || !code || !code->equals_ci(params[1]))
|
||||
{
|
||||
if (!code)
|
||||
{
|
||||
code = ci->Extend<Anope::string>("dropcode");
|
||||
*code = Anope::Random(15);
|
||||
}
|
||||
|
||||
source.Reply(_("Please confirm that you want to drop \002%s\002 with \002DROP %s %s\002"),
|
||||
chan.c_str(), chan.c_str(), code->c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
EventReturn MOD_RESULT;
|
||||
FOREACH_RESULT(OnChanDrop, MOD_RESULT, (source, ci));
|
||||
if (MOD_RESULT == EVENT_STOP)
|
||||
{
|
||||
dropcode.Unset(ci);
|
||||
return;
|
||||
}
|
||||
|
||||
bool override = (ci->HasExt("SECUREFOUNDER") ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER"));
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "(founder was: " << (ci->GetFounder() ? ci->GetFounder()->display : "none") << ")";
|
||||
|
||||
@@ -38,7 +38,7 @@ struct EntryMsgImpl final
|
||||
data.SetType("when", Serialize::Data::DT_INT); data["when"] << this->when;
|
||||
}
|
||||
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data);
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data);
|
||||
};
|
||||
|
||||
struct EntryMessageListImpl final
|
||||
@@ -46,7 +46,7 @@ struct EntryMessageListImpl final
|
||||
{
|
||||
EntryMessageListImpl(Extensible *) { }
|
||||
|
||||
EntryMsg* Create() override
|
||||
EntryMsg *Create() override
|
||||
{
|
||||
return new EntryMsgImpl();
|
||||
}
|
||||
@@ -68,7 +68,7 @@ EntryMsgImpl::~EntryMsgImpl()
|
||||
}
|
||||
|
||||
|
||||
Serializable* EntryMsgImpl::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
Serializable *EntryMsgImpl::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
{
|
||||
Anope::string sci, screator, smessage;
|
||||
time_t swhen;
|
||||
@@ -104,7 +104,7 @@ class CommandEntryMessage final
|
||||
: public Command
|
||||
{
|
||||
private:
|
||||
void DoList(CommandSource &source, ChannelInfo *ci)
|
||||
static void DoList(CommandSource &source, ChannelInfo *ci)
|
||||
{
|
||||
EntryMessageList *messages = ci->Require<EntryMessageList>("entrymsg");
|
||||
|
||||
@@ -283,10 +283,16 @@ public:
|
||||
if (u && c && c->ci && u->server->IsSynced())
|
||||
{
|
||||
EntryMessageList *messages = c->ci->GetExt<EntryMessageList>("entrymsg");
|
||||
if (!messages)
|
||||
return;
|
||||
|
||||
if (messages != NULL)
|
||||
for (const auto &message : *(*messages))
|
||||
u->SendMessage(c->ci->WhoSends(), "[%s] %s", c->ci->name.c_str(), message->message.c_str());
|
||||
for (const auto &message : *(*messages))
|
||||
{
|
||||
if (u->ShouldPrivmsg())
|
||||
IRCD->SendContextPrivmsg(c->ci->WhoSends(), u, c, message->message);
|
||||
else
|
||||
IRCD->SendContextNotice(c->ci->WhoSends(), u, c, message->message);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -26,9 +26,7 @@ public:
|
||||
bool HasPriv(const Anope::string &priv) const override
|
||||
{
|
||||
std::map<Anope::string, char>::iterator it = defaultFlags.find(priv);
|
||||
if (it != defaultFlags.end() && this->flags.count(it->second) > 0)
|
||||
return true;
|
||||
return false;
|
||||
return it != defaultFlags.end() && this->flags.count(it->second) > 0;
|
||||
}
|
||||
|
||||
Anope::string AccessSerialize() const override
|
||||
@@ -76,7 +74,7 @@ public:
|
||||
return new FlagsChanAccess(this);
|
||||
}
|
||||
};
|
||||
FlagsAccessProvider* FlagsAccessProvider::ap;
|
||||
FlagsAccessProvider *FlagsAccessProvider::ap;
|
||||
|
||||
class CommandCSFlags final
|
||||
: public Command
|
||||
@@ -296,7 +294,7 @@ class CommandCSFlags final
|
||||
source.Reply(_("Flags for \002%s\002 on %s set to +\002%s\002"), access->Mask().c_str(), ci->name.c_str(), access->AccessSerialize().c_str());
|
||||
}
|
||||
|
||||
void DoList(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> ¶ms)
|
||||
static void DoList(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> ¶ms)
|
||||
{
|
||||
const Anope::string &arg = params.size() > 2 ? params[2] : "";
|
||||
|
||||
@@ -324,7 +322,7 @@ class CommandCSFlags final
|
||||
for (size_t j = 1; j < arg.length(); ++j)
|
||||
if (flags.find(arg[j]) == Anope::string::npos)
|
||||
pass = false;
|
||||
if (pass == false)
|
||||
if (!pass)
|
||||
continue;
|
||||
}
|
||||
else if (!Anope::Match(access->Mask(), arg))
|
||||
|
||||
@@ -47,7 +47,7 @@ struct LogSettingImpl final
|
||||
data.SetType("created", Serialize::Data::DT_INT); data["created"] << created;
|
||||
}
|
||||
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
{
|
||||
Anope::string sci;
|
||||
data["ci"] >> sci;
|
||||
|
||||
@@ -32,7 +32,7 @@ struct ModeLockImpl final
|
||||
}
|
||||
|
||||
void Serialize(Serialize::Data &data) const override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data);
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data);
|
||||
};
|
||||
|
||||
struct ModeLocksImpl final
|
||||
@@ -213,7 +213,7 @@ void ModeLockImpl::Serialize(Serialize::Data &data) const
|
||||
data.SetType("created", Serialize::Data::DT_INT); data["created"] << this->created;
|
||||
}
|
||||
|
||||
Serializable* ModeLockImpl::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
Serializable *ModeLockImpl::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
{
|
||||
Anope::string sci;
|
||||
|
||||
@@ -247,7 +247,7 @@ Serializable* ModeLockImpl::Unserialize(Serializable *obj, Serialize::Data &data
|
||||
class CommandCSMode final
|
||||
: public Command
|
||||
{
|
||||
bool CanSet(CommandSource &source, ChannelInfo *ci, ChannelMode *cm, bool self)
|
||||
static bool CanSet(CommandSource &source, ChannelInfo *ci, ChannelMode *cm, bool self)
|
||||
{
|
||||
if (!ci || !cm || cm->type != MODE_STATUS)
|
||||
return false;
|
||||
|
||||
@@ -55,7 +55,7 @@ struct SeenInfo final
|
||||
data.SetType("last", Serialize::Data::DT_INT); data["last"] << last;
|
||||
}
|
||||
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
{
|
||||
Anope::string snick;
|
||||
|
||||
@@ -66,7 +66,7 @@ struct SeenInfo final
|
||||
s = anope_dynamic_static_cast<SeenInfo *>(obj);
|
||||
else
|
||||
{
|
||||
SeenInfo* &info = database[snick];
|
||||
SeenInfo *&info = database[snick];
|
||||
if (!info)
|
||||
info = new SeenInfo();
|
||||
s = info;
|
||||
@@ -185,7 +185,7 @@ public:
|
||||
class CommandSeen final
|
||||
: public Command
|
||||
{
|
||||
void SimpleSeen(CommandSource &source, const std::vector<Anope::string> ¶ms)
|
||||
static void SimpleSeen(CommandSource &source, const std::vector<Anope::string> ¶ms)
|
||||
{
|
||||
if (!source.c || !source.c->ci)
|
||||
{
|
||||
@@ -270,9 +270,9 @@ public:
|
||||
if (simple)
|
||||
return this->SimpleSeen(source, params);
|
||||
|
||||
if (target.length() > Config->GetBlock("networkinfo")->Get<unsigned>("nicklen"))
|
||||
if (target.length() > IRCD->GetMaxNick())
|
||||
{
|
||||
source.Reply(_("Nick too long, max length is %u characters."), Config->GetBlock("networkinfo")->Get<unsigned>("nicklen"));
|
||||
source.Reply(_("Nick too long, max length is %zu characters."), IRCD->GetMaxNick());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -440,12 +440,12 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void UpdateUser(const User *u, const TypeInfo Type, const Anope::string &nick, const Anope::string &nick2, const Anope::string &channel, const Anope::string &message)
|
||||
static void UpdateUser(const User *u, const TypeInfo Type, const Anope::string &nick, const Anope::string &nick2, const Anope::string &channel, const Anope::string &message)
|
||||
{
|
||||
if (simple || !u->server->IsSynced())
|
||||
return;
|
||||
|
||||
SeenInfo* &info = database[nick];
|
||||
SeenInfo *&info = database[nick];
|
||||
if (!info)
|
||||
info = new SeenInfo();
|
||||
info->nick = nick;
|
||||
|
||||
@@ -682,70 +682,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class CommandCSSetSecure final
|
||||
: 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> ¶ms) override
|
||||
{
|
||||
if (Anope::ReadOnly)
|
||||
{
|
||||
source.Reply(READ_ONLY_MODE);
|
||||
return;
|
||||
}
|
||||
|
||||
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(OnSetChannelOption, MOD_RESULT, (source, this, ci, params[1]));
|
||||
if (MOD_RESULT == EVENT_STOP)
|
||||
return;
|
||||
|
||||
if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.permission.empty() && !source.HasPriv("chanserv/administration"))
|
||||
{
|
||||
source.Reply(ACCESS_DENIED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (params[1].equals_ci("ON"))
|
||||
{
|
||||
Log(source.AccessFor(ci).HasPriv("SET") ? LOG_COMMAND : LOG_OVERRIDE, source, this, ci) << "to enable secure";
|
||||
ci->Extend<bool>("CS_SECURE");
|
||||
source.Reply(_("Secure option for %s is now \002on\002."), ci->name.c_str());
|
||||
}
|
||||
else if (params[1].equals_ci("OFF"))
|
||||
{
|
||||
Log(source.AccessFor(ci).HasPriv("SET") ? LOG_COMMAND : LOG_OVERRIDE, source, this, ci) << "to disable secure";
|
||||
ci->Shrink<bool>("CS_SECURE");
|
||||
source.Reply(_("Secure option for %s is now \002off\002."), ci->name.c_str());
|
||||
}
|
||||
else
|
||||
this->OnSyntaxError(source, "SECURE");
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &) override
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(" ");
|
||||
source.Reply(_("Enables or disables security features for a\n"
|
||||
"channel. When \002SECURE\002 is set, only users who have\n"
|
||||
"identified to services, and are not only recognized, will be\n"
|
||||
"given access to channels from account-based access entries."));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class CommandCSSetSecureFounder final
|
||||
: public Command
|
||||
{
|
||||
@@ -1110,7 +1046,7 @@ class CSSet final
|
||||
: public Module
|
||||
{
|
||||
SerializableExtensibleItem<bool> noautoop, peace, securefounder,
|
||||
restricted, secure, secureops, signkick, signkick_level, noexpire,
|
||||
restricted, secureops, signkick, signkick_level, noexpire,
|
||||
persist;
|
||||
|
||||
struct KeepModes final
|
||||
@@ -1169,7 +1105,6 @@ class CSSet final
|
||||
CommandCSSetPeace commandcssetpeace;
|
||||
CommandCSSetPersist commandcssetpersist;
|
||||
CommandCSSetRestricted commandcssetrestricted;
|
||||
CommandCSSetSecure commandcssetsecure;
|
||||
CommandCSSetSecureFounder commandcssetsecurefounder;
|
||||
CommandCSSetSecureOps commandcssetsecureops;
|
||||
CommandCSSetSignKick commandcssetsignkick;
|
||||
@@ -1184,7 +1119,7 @@ public:
|
||||
CSSet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
|
||||
noautoop(this, "NOAUTOOP"), peace(this, "PEACE"),
|
||||
securefounder(this, "SECUREFOUNDER"), restricted(this, "RESTRICTED"),
|
||||
secure(this, "CS_SECURE"), secureops(this, "SECUREOPS"), signkick(this, "SIGNKICK"),
|
||||
secureops(this, "SECUREOPS"), signkick(this, "SIGNKICK"),
|
||||
signkick_level(this, "SIGNKICK_LEVEL"), noexpire(this, "CS_NO_EXPIRE"),
|
||||
persist(this, "PERSIST"),
|
||||
keep_modes(this, "CS_KEEP_MODES"),
|
||||
@@ -1192,7 +1127,7 @@ public:
|
||||
commandcsset(this), commandcssetautoop(this), commandcssetbantype(this),
|
||||
commandcssetdescription(this), commandcssetfounder(this), commandcssetkeepmodes(this),
|
||||
commandcssetpeace(this), commandcssetpersist(this), commandcssetrestricted(this),
|
||||
commandcssetsecure(this), commandcssetsecurefounder(this), commandcssetsecureops(this), commandcssetsignkick(this),
|
||||
commandcssetsecurefounder(this), commandcssetsecureops(this), commandcssetsignkick(this),
|
||||
commandcssetsuccessor(this), commandcssetnoexpire(this),
|
||||
|
||||
inhabit("inhabit")
|
||||
@@ -1304,8 +1239,6 @@ public:
|
||||
info.AddOption(_("Peace"));
|
||||
if (restricted.HasExt(ci))
|
||||
info.AddOption(_("Restricted access"));
|
||||
if (secure.HasExt(ci))
|
||||
info.AddOption(_("Security"));
|
||||
if (securefounder.HasExt(ci))
|
||||
info.AddOption(_("Secure founder"));
|
||||
if (secureops.HasExt(ci))
|
||||
|
||||
@@ -21,7 +21,7 @@ static Anope::map<ExtensibleItem<CSMiscData> *> items;
|
||||
|
||||
static ExtensibleItem<CSMiscData> *GetItem(const Anope::string &name)
|
||||
{
|
||||
ExtensibleItem<CSMiscData>* &it = items[name];
|
||||
ExtensibleItem<CSMiscData> *&it = items[name];
|
||||
if (!it)
|
||||
try
|
||||
{
|
||||
@@ -51,7 +51,7 @@ struct CSMiscData final
|
||||
sdata["data"] << this->data;
|
||||
}
|
||||
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
{
|
||||
Anope::string sci, sname, sdata;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ struct CSSuspendInfo final
|
||||
data["expires"] << expires;
|
||||
}
|
||||
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
{
|
||||
Anope::string schan;
|
||||
data["chan"] >> schan;
|
||||
|
||||
@@ -262,7 +262,7 @@ public:
|
||||
|
||||
ModeLocks *ml = ci->GetExt<ModeLocks>("modelocks");
|
||||
const ModeLock *secret = ml ? ml->GetMLock("SECRET") : NULL;
|
||||
if (!ci->last_topic.empty() && (show_all || ((!secret || secret->set == false) && (!ci->c || !ci->c->HasMode("SECRET")))))
|
||||
if (!ci->last_topic.empty() && (show_all || ((!secret || !secret->set) && (!ci->c || !ci->c->HasMode("SECRET")))))
|
||||
{
|
||||
info[_("Last topic")] = ci->last_topic;
|
||||
info[_("Topic set by")] = ci->last_topic_setter;
|
||||
|
||||
@@ -44,7 +44,12 @@ public:
|
||||
if (!ci->c || !(source.AccessFor(ci).HasPriv("UNBAN") || source.AccessFor(ci).HasPriv("UNBANME")))
|
||||
continue;
|
||||
|
||||
FOREACH_MOD(OnChannelUnban, (source.GetUser(), ci));
|
||||
if (IRCD->CanClearBans)
|
||||
{
|
||||
IRCD->SendClearBans(ci->WhoSends(), ci->c, source.GetUser());
|
||||
count++;
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const auto *mode : modes)
|
||||
if (ci->c->Unban(source.GetUser(), mode->name, true))
|
||||
@@ -81,7 +86,7 @@ public:
|
||||
}
|
||||
|
||||
if (!source.AccessFor(ci).HasPriv("UNBAN") &&
|
||||
!(u2 == source.GetUser() && source.AccessFor(ci).HasPriv("UNBANME")) &&
|
||||
(u2 != source.GetUser() || !source.AccessFor(ci).HasPriv("UNBANME")) &&
|
||||
!source.HasPriv("chanserv/kick"))
|
||||
{
|
||||
source.Reply(ACCESS_DENIED);
|
||||
@@ -91,10 +96,15 @@ public:
|
||||
bool override = !source.AccessFor(ci).HasPriv("UNBAN") && source.HasPriv("chanserv/kick");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to unban " << u2->nick;
|
||||
|
||||
FOREACH_MOD(OnChannelUnban, (u2, ci));
|
||||
|
||||
for (const auto *mode : modes)
|
||||
ci->c->Unban(u2, mode->name, source.GetUser() == u2);
|
||||
if (IRCD->CanClearBans)
|
||||
IRCD->SendClearBans(ci->WhoSends(), ci->c, source.GetUser());
|
||||
else
|
||||
{
|
||||
for (const auto *mode : modes)
|
||||
ci->c->Unban(u2, mode->name, source.GetUser() == u2);
|
||||
}
|
||||
|
||||
if (u2 == source.GetUser())
|
||||
source.Reply(_("You have been unbanned from \002%s\002."), ci->c->name.c_str());
|
||||
else
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
class CommandCSUp final
|
||||
: public Command
|
||||
{
|
||||
void SetModes(User *u, Channel *c)
|
||||
static void SetModes(User *u, Channel *c)
|
||||
{
|
||||
if (!c->ci)
|
||||
return;
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
class CommandCSDown final
|
||||
: public Command
|
||||
{
|
||||
void RemoveAll(User *u, Channel *c)
|
||||
static void RemoveAll(User *u, Channel *c)
|
||||
{
|
||||
ChanUserContainer *cu = c->FindUser(u);
|
||||
if (cu != NULL)
|
||||
|
||||
@@ -189,14 +189,14 @@ class MChanstats final
|
||||
sql->Run(&sqlinterface, q);
|
||||
}
|
||||
|
||||
size_t CountWords(const Anope::string &msg)
|
||||
static size_t CountWords(const Anope::string &msg)
|
||||
{
|
||||
size_t words = 0;
|
||||
for (size_t pos = 0; pos != Anope::string::npos; pos = msg.find(" ", pos+1))
|
||||
words++;
|
||||
return words;
|
||||
}
|
||||
size_t CountSmileys(const Anope::string &msg, const Anope::string &smileylist)
|
||||
static size_t CountSmileys(const Anope::string &msg, const Anope::string &smileylist)
|
||||
{
|
||||
size_t smileys = 0;
|
||||
spacesepstream sep(smileylist);
|
||||
@@ -210,7 +210,7 @@ class MChanstats final
|
||||
return smileys;
|
||||
}
|
||||
|
||||
const Anope::string GetDisplay(User *u)
|
||||
Anope::string GetDisplay(User *u)
|
||||
{
|
||||
if (u && u->Account() && ns_stats.HasExt(u->Account()))
|
||||
return u->Account()->display;
|
||||
@@ -581,7 +581,7 @@ public:
|
||||
this->RunQuery(query);
|
||||
}
|
||||
|
||||
void OnPrivmsg(User *u, Channel *c, Anope::string &msg) override
|
||||
void OnPrivmsg(User *u, Channel *c, Anope::string &msg, const Anope::map<Anope::string> &tags) override
|
||||
{
|
||||
if (!c->ci || !cs_stats.HasExt(c->ci))
|
||||
return;
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
Anope::string last;
|
||||
std::fstream *fs = nullptr;
|
||||
|
||||
std::iostream& operator[](const Anope::string &key) override
|
||||
std::iostream &operator[](const Anope::string &key) override
|
||||
{
|
||||
if (key != last)
|
||||
{
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
std::stringstream ss;
|
||||
bool read = false;
|
||||
|
||||
std::iostream& operator[](const Anope::string &key) override
|
||||
std::iostream &operator[](const Anope::string &key) override
|
||||
{
|
||||
if (!read)
|
||||
{
|
||||
|
||||
@@ -35,7 +35,6 @@ else \
|
||||
#define OLD_BI_PRIVATE 0x0001
|
||||
|
||||
#define OLD_NI_KILLPROTECT 0x00000001 /* Kill others who take this nick */
|
||||
#define OLD_NI_SECURE 0x00000002 /* Don't recognize unless IDENTIFY'd */
|
||||
#define OLD_NI_MSG 0x00000004 /* Use PRIVMSGs instead of NOTICEs */
|
||||
#define OLD_NI_MEMO_HARDMAX 0x00000008 /* Don't allow user to change memo limit */
|
||||
#define OLD_NI_MEMO_SIGNON 0x00000010 /* Notify of memos at signon and un-away */
|
||||
@@ -60,7 +59,6 @@ else \
|
||||
#define OLD_CI_TOPICLOCK 0x00000008
|
||||
#define OLD_CI_RESTRICTED 0x00000010
|
||||
#define OLD_CI_PEACE 0x00000020
|
||||
#define OLD_CI_SECURE 0x00000040
|
||||
#define OLD_CI_VERBOTEN 0x00000080
|
||||
#define OLD_CI_ENCRYPTEDPW 0x00000100
|
||||
#define OLD_CI_NO_EXPIRE 0x00000200
|
||||
@@ -449,7 +447,7 @@ static void LoadNicks()
|
||||
READ(read_string(buffer, f));
|
||||
auto *nc = new NickCore(buffer);
|
||||
|
||||
const Anope::string settings[] = { "killprotect", "kill_quick", "ns_secure", "ns_private", "hide_email",
|
||||
const Anope::string settings[] = { "killprotect", "kill_quick", "ns_private", "hide_email",
|
||||
"hide_mask", "hide_quit", "memo_signon", "memo_receive", "autoop", "msg", "ns_keepmodes" };
|
||||
for (const auto &setting : settings)
|
||||
nc->Shrink<bool>(setting.upper());
|
||||
@@ -483,8 +481,6 @@ static void LoadNicks()
|
||||
READ(read_uint32(&u32, f));
|
||||
if (u32 & OLD_NI_KILLPROTECT)
|
||||
nc->Extend<bool>("KILLPROTECT");
|
||||
if (u32 & OLD_NI_SECURE)
|
||||
nc->Extend<bool>("NS_SECURE");
|
||||
if (u32 & OLD_NI_MSG)
|
||||
nc->Extend<bool>("MSG");
|
||||
if (u32 & OLD_NI_MEMO_HARDMAX)
|
||||
@@ -571,7 +567,6 @@ static void LoadNicks()
|
||||
for (uint16_t j = 0; j < u16; ++j)
|
||||
{
|
||||
READ(read_string(buffer, f));
|
||||
nc->access.push_back(buffer);
|
||||
}
|
||||
|
||||
int16_t i16;
|
||||
@@ -752,7 +747,7 @@ static void LoadChannels()
|
||||
READ(read_buffer(namebuf, f));
|
||||
auto *ci = new ChannelInfo(namebuf);
|
||||
|
||||
const Anope::string settings[] = { "keeptopic", "peace", "cs_private", "restricted", "cs_secure", "secureops", "securefounder",
|
||||
const Anope::string settings[] = { "keeptopic", "peace", "cs_private", "restricted", "secureops", "securefounder",
|
||||
"signkick", "signkick_level", "topiclock", "persist", "noautoop", "cs_keepmodes" };
|
||||
for (const auto &setting : settings)
|
||||
ci->Shrink<bool>(setting.upper());
|
||||
@@ -801,8 +796,6 @@ static void LoadChannels()
|
||||
ci->Extend<bool>("RESTRICTED");
|
||||
if (tmpu32 & OLD_CI_PEACE)
|
||||
ci->Extend<bool>("PEACE");
|
||||
if (tmpu32 & OLD_CI_SECURE)
|
||||
ci->Extend<bool>("CS_SECURE");
|
||||
if (tmpu32 & OLD_CI_NO_EXPIRE)
|
||||
ci->Extend<bool>("CS_NO_EXPIRE");
|
||||
if (tmpu32 & OLD_CI_MEMO_HARDMAX)
|
||||
|
||||
@@ -26,9 +26,9 @@ public:
|
||||
delete stream;
|
||||
}
|
||||
|
||||
std::iostream& operator[](const Anope::string &key) override
|
||||
std::iostream &operator[](const Anope::string &key) override
|
||||
{
|
||||
std::stringstream* &stream = data[key];
|
||||
std::stringstream *&stream = data[key];
|
||||
if (!stream)
|
||||
stream = new std::stringstream();
|
||||
return *stream;
|
||||
@@ -318,7 +318,7 @@ void ObjectLoader::OnResult(const Reply &r)
|
||||
data[key->bulk] << value->bulk;
|
||||
}
|
||||
|
||||
Serializable* &obj = st->objects[this->id];
|
||||
Serializable *&obj = st->objects[this->id];
|
||||
obj = st->Unserialize(obj, data);
|
||||
if (obj)
|
||||
{
|
||||
@@ -337,7 +337,7 @@ void IDInterface::OnResult(const Reply &r)
|
||||
return;
|
||||
}
|
||||
|
||||
Serializable* &obj = o->GetSerializableType()->objects[r.i];
|
||||
Serializable *&obj = o->GetSerializableType()->objects[r.i];
|
||||
if (obj)
|
||||
/* This shouldn't be possible */
|
||||
obj->id = 0;
|
||||
@@ -537,7 +537,7 @@ void SubscriptionListener::OnResult(const Reply &r)
|
||||
}
|
||||
else if (op == "del")
|
||||
{
|
||||
Serializable* &s = s_type->objects[obj_id];
|
||||
Serializable *&s = s_type->objects[obj_id];
|
||||
if (s == NULL)
|
||||
return;
|
||||
|
||||
@@ -587,7 +587,7 @@ void ModifiedObject::OnResult(const Reply &r)
|
||||
return;
|
||||
}
|
||||
|
||||
Serializable* &obj = st->objects[this->id];
|
||||
Serializable *&obj = st->objects[this->id];
|
||||
|
||||
/* Transaction start */
|
||||
me->redis->StartTransaction();
|
||||
|
||||
+4
-4
@@ -31,7 +31,7 @@ class Packet final
|
||||
return name.find_first_not_of("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-") == Anope::string::npos;
|
||||
}
|
||||
|
||||
void PackName(unsigned char *output, unsigned short output_size, unsigned short &pos, const Anope::string &name)
|
||||
static void PackName(unsigned char *output, unsigned short output_size, unsigned short &pos, const Anope::string &name)
|
||||
{
|
||||
if (pos + name.length() + 2 > output_size)
|
||||
throw SocketException("Unable to pack name");
|
||||
@@ -51,7 +51,7 @@ class Packet final
|
||||
output[pos++] = 0;
|
||||
}
|
||||
|
||||
Anope::string UnpackName(const unsigned char *input, unsigned short input_size, unsigned short &pos)
|
||||
static Anope::string UnpackName(const unsigned char *input, unsigned short input_size, unsigned short &pos)
|
||||
{
|
||||
Anope::string name;
|
||||
unsigned short pos_ptr = pos, lowest_ptr = input_size;
|
||||
@@ -72,7 +72,7 @@ class Packet final
|
||||
throw SocketException("Unable to unpack name - bogus compression header");
|
||||
|
||||
/* Place pos at the second byte of the first (farthest) compression pointer */
|
||||
if (compressed == false)
|
||||
if (!compressed)
|
||||
{
|
||||
++pos;
|
||||
compressed = true;
|
||||
@@ -95,7 +95,7 @@ class Packet final
|
||||
name += input[pos_ptr + i];
|
||||
|
||||
pos_ptr += offset + 1;
|
||||
if (compressed == false)
|
||||
if (!compressed)
|
||||
/* Move up pos */
|
||||
pos = pos_ptr;
|
||||
}
|
||||
|
||||
@@ -30,14 +30,14 @@ class EBCRYPT final
|
||||
return salt;
|
||||
}
|
||||
|
||||
Anope::string Generate(const Anope::string& data, const Anope::string& salt)
|
||||
static Anope::string Generate(const Anope::string &data, const Anope::string &salt)
|
||||
{
|
||||
char hash[64];
|
||||
_crypt_blowfish_rn(data.c_str(), salt.c_str(), hash, sizeof(hash));
|
||||
return hash;
|
||||
}
|
||||
|
||||
bool Compare(const Anope::string& string, const Anope::string& hash)
|
||||
bool Compare(const Anope::string &string, const Anope::string &hash)
|
||||
{
|
||||
Anope::string ret = Generate(string, hash);
|
||||
if (ret.empty())
|
||||
|
||||
@@ -208,7 +208,7 @@ class MD5Context final
|
||||
/* Encodes input (unsigned) into output (unsigned char). Assumes len is
|
||||
* a multiple of 4.
|
||||
*/
|
||||
void Encode(unsigned char *output, unsigned *input, unsigned len)
|
||||
static void Encode(unsigned char *output, unsigned *input, unsigned len)
|
||||
{
|
||||
for (unsigned i = 0, j = 0; j < len; ++i, j += 4)
|
||||
{
|
||||
@@ -222,7 +222,7 @@ class MD5Context final
|
||||
/* Decodes input (unsigned char) into output (unsigned). Assumes len is
|
||||
* a multiple of 4.
|
||||
*/
|
||||
void Decode(unsigned *output, const unsigned char *input, unsigned len)
|
||||
static void Decode(unsigned *output, const unsigned char *input, unsigned len)
|
||||
{
|
||||
for (unsigned i = 0, j = 0; j < len; ++i, j += 4)
|
||||
output[i] = static_cast<unsigned>(input[j]) | (static_cast<unsigned>(input[j + 1]) << 8) | (static_cast<unsigned>(input[j + 2]) << 16) | (static_cast<unsigned>(input[j + 3]) << 24);
|
||||
|
||||
@@ -220,7 +220,7 @@ public:
|
||||
private:
|
||||
#ifdef _WIN32
|
||||
// Windows LDAP does not implement this so we need to do it.
|
||||
int ldap_initialize(LDAP** ldap, const char* url)
|
||||
int ldap_initialize(LDAP **ldap, const char *url)
|
||||
{
|
||||
URL_COMPONENTS urlComponents;
|
||||
memset(&urlComponents, 0, sizeof(urlComponents));
|
||||
@@ -508,7 +508,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
LDAP* GetConnection()
|
||||
LDAP *GetConnection()
|
||||
{
|
||||
return con;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class SSLSocketIO final
|
||||
{
|
||||
public:
|
||||
gnutls_session_t sess = nullptr;
|
||||
GnuTLS::X509CertCredentials* mycreds;
|
||||
GnuTLS::X509CertCredentials *mycreds;
|
||||
|
||||
/** Constructor
|
||||
*/
|
||||
@@ -181,7 +181,7 @@ namespace GnuTLS
|
||||
throw ConfigException("Error loading private key: " + Anope::string(gnutls_strerror(ret)));
|
||||
}
|
||||
|
||||
gnutls_x509_privkey_t& get() { return key.key; }
|
||||
gnutls_x509_privkey_t &get() { return key.key; }
|
||||
};
|
||||
|
||||
class X509CertList final
|
||||
@@ -219,7 +219,7 @@ namespace GnuTLS
|
||||
gnutls_x509_crt_deinit(*i);
|
||||
}
|
||||
|
||||
gnutls_x509_crt_t* raw() { return &certs[0]; }
|
||||
gnutls_x509_crt_t *raw() { return &certs[0]; }
|
||||
unsigned int size() const { return certs.size(); }
|
||||
};
|
||||
|
||||
@@ -236,7 +236,7 @@ namespace GnuTLS
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int cert_callback(gnutls_session_t sess, const gnutls_datum_t* req_ca_rdn, int nreqs, const gnutls_pk_algorithm_t* sign_algos, int sign_algos_length, gnutls_retr2_st* st);
|
||||
static int cert_callback(gnutls_session_t sess, const gnutls_datum_t *req_ca_rdn, int nreqs, const gnutls_pk_algorithm_t *sign_algos, int sign_algos_length, gnutls_retr2_st *st);
|
||||
|
||||
public:
|
||||
X509CertList certs;
|
||||
@@ -628,7 +628,7 @@ SSLSocketIO::SSLSocketIO() : mycreds(me->cred)
|
||||
mycreds->incrref();
|
||||
}
|
||||
|
||||
int GnuTLS::X509CertCredentials::cert_callback(gnutls_session_t sess, const gnutls_datum_t* req_ca_rdn, int nreqs, const gnutls_pk_algorithm_t* sign_algos, int sign_algos_length, gnutls_retr2_st* st)
|
||||
int GnuTLS::X509CertCredentials::cert_callback(gnutls_session_t sess, const gnutls_datum_t *req_ca_rdn, int nreqs, const gnutls_pk_algorithm_t *sign_algos, int sign_algos_length, gnutls_retr2_st *st)
|
||||
{
|
||||
st->cert_type = GNUTLS_CRT_X509;
|
||||
st->key_type = GNUTLS_PRIVKEY_X509;
|
||||
|
||||
+7
-2
@@ -94,7 +94,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void OnPrivmsg(User *u, Channel *c, Anope::string &msg) override
|
||||
void OnPrivmsg(User *u, Channel *c, Anope::string &msg, const Anope::map<Anope::string> &tags) override
|
||||
{
|
||||
if (!u || !c || !c->ci || !c->ci->bi || msg.empty() || msg[0] == '\1')
|
||||
return;
|
||||
@@ -175,7 +175,12 @@ public:
|
||||
if (params.size() < cmd->min_params)
|
||||
return;
|
||||
|
||||
CommandSource source(u->nick, u, u->Account(), u, c->ci->bi);
|
||||
Anope::string msgid;
|
||||
auto iter = tags.find("msgid");
|
||||
if (iter != tags.end())
|
||||
msgid = iter->second;
|
||||
|
||||
CommandSource source(u->nick, u, u->Account(), u, c->ci->bi, msgid);
|
||||
source.c = c;
|
||||
source.command = it->first;
|
||||
source.permission = info.permission;
|
||||
|
||||
+1
-1
@@ -173,7 +173,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
if (helped == false)
|
||||
if (!helped)
|
||||
source.Reply(_("No help available for \002%s\002."), params[0].c_str());
|
||||
}
|
||||
|
||||
|
||||
@@ -59,10 +59,8 @@ public:
|
||||
|
||||
if (HostServ)
|
||||
{
|
||||
if (!na->GetVhostIdent().empty())
|
||||
u->SendMessage(HostServ, _("Your vhost of \002%s\002@\002%s\002 is now activated."), na->GetVhostIdent().c_str(), na->GetVhostHost().c_str());
|
||||
else
|
||||
u->SendMessage(HostServ, _("Your vhost of \002%s\002 is now activated."), na->GetVhostHost().c_str());
|
||||
u->SendMessage(HostServ, _("Your vhost of \002%s\002 is now activated."),
|
||||
na->GetVhostMask().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -107,10 +105,8 @@ public:
|
||||
|
||||
if (HostServ)
|
||||
{
|
||||
if (!na->GetVhostIdent().empty())
|
||||
u->SendMessage(HostServ, _("Your vhost of \002%s\002@\002%s\002 is now activated."), na->GetVhostIdent().c_str(), na->GetVhostHost().c_str());
|
||||
else
|
||||
u->SendMessage(HostServ, _("Your vhost of \002%s\002 is now activated."), na->GetVhostHost().c_str());
|
||||
u->SendMessage(HostServ, _("Your vhost of \002%s\002 is now activated."),
|
||||
na->GetVhostMask().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,10 +54,8 @@ public:
|
||||
if (na && source.GetAccount() == na->nc && na->HasVhost())
|
||||
{
|
||||
this->Sync(na);
|
||||
if (!na->GetVhostIdent().empty())
|
||||
source.Reply(_("All vhosts in the group \002%s\002 have been set to \002%s\002@\002%s\002."), source.nc->display.c_str(), na->GetVhostIdent().c_str(), na->GetVhostHost().c_str());
|
||||
else
|
||||
source.Reply(_("All vhosts in the group \002%s\002 have been set to \002%s\002."), source.nc->display.c_str(), na->GetVhostHost().c_str());
|
||||
source.Reply(_("All vhosts in the group \002%s\002 have been set to \002%s\002."),
|
||||
source.nc->display.c_str(), na->GetVhostMask().c_str());
|
||||
}
|
||||
else
|
||||
source.Reply(HOST_NOT_ASSIGNED);
|
||||
|
||||
@@ -72,10 +72,7 @@ public:
|
||||
ListFormatter::ListEntry entry;
|
||||
entry["Number"] = stringify(display_counter);
|
||||
entry["Nick"] = na->nick;
|
||||
if (!na->GetVhostIdent().empty())
|
||||
entry["Vhost"] = na->GetVhostIdent() + "@" + na->GetVhostHost();
|
||||
else
|
||||
entry["Vhost"] = na->GetVhostHost();
|
||||
entry["Vhost"] = na->GetVhostMask();
|
||||
entry["Creator"] = na->GetVhostCreator();
|
||||
entry["Created"] = Anope::strftime(na->GetVhostCreated(), NULL, true);
|
||||
list.AddEntry(entry);
|
||||
@@ -93,10 +90,7 @@ public:
|
||||
ListFormatter::ListEntry entry;
|
||||
entry["Number"] = stringify(display_counter);
|
||||
entry["Nick"] = na->nick;
|
||||
if (!na->GetVhostIdent().empty())
|
||||
entry["Vhost"] = na->GetVhostIdent() + "@" + na->GetVhostHost();
|
||||
else
|
||||
entry["Vhost"] = na->GetVhostHost();
|
||||
entry["Vhost"] = na->GetVhostMask();
|
||||
entry["Creator"] = na->GetVhostCreator();
|
||||
entry["Created"] = Anope::strftime(na->GetVhostCreated(), NULL, true);
|
||||
list.AddEntry(entry);
|
||||
|
||||
@@ -32,11 +32,8 @@ public:
|
||||
na = NickAlias::Find(u->Account()->display);
|
||||
if (na && u->Account() == na->nc && na->HasVhost())
|
||||
{
|
||||
if (!na->GetVhostIdent().empty())
|
||||
source.Reply(_("Your vhost of \002%s\002@\002%s\002 is now activated."), na->GetVhostIdent().c_str(), na->GetVhostHost().c_str());
|
||||
else
|
||||
source.Reply(_("Your vhost of \002%s\002 is now activated."), na->GetVhostHost().c_str());
|
||||
Log(LOG_COMMAND, source, this) << "to enable their vhost of " << (!na->GetVhostIdent().empty() ? na->GetVhostIdent() + "@" : "") << na->GetVhostHost();
|
||||
source.Reply(_("Your vhost of \002%s\002 is now activated."), na->GetVhostMask().c_str());
|
||||
Log(LOG_COMMAND, source, this) << "to enable their vhost of " << na->GetVhostMask();
|
||||
IRCD->SendVhost(u, na->GetVhostIdent(), na->GetVhostHost());
|
||||
u->vhost = na->GetVhostHost();
|
||||
if (IRCD->CanSetVIdent && !na->GetVhostIdent().empty())
|
||||
|
||||
@@ -38,7 +38,7 @@ struct HostRequest final
|
||||
data.SetType("time", Serialize::Data::DT_INT); data["time"] << this->time;
|
||||
}
|
||||
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||
{
|
||||
Anope::string snick;
|
||||
data["nick"] >> snick;
|
||||
@@ -67,11 +67,9 @@ struct HostRequest final
|
||||
class CommandHSRequest final
|
||||
: public Command
|
||||
{
|
||||
bool isvalidchar(char c)
|
||||
static bool isvalidchar(char c)
|
||||
{
|
||||
if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '.' || c == '-')
|
||||
return true;
|
||||
return false;
|
||||
return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '.' || c == '-';
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -124,9 +122,9 @@ public:
|
||||
|
||||
if (!user.empty())
|
||||
{
|
||||
if (user.length() > Config->GetBlock("networkinfo")->Get<unsigned>("userlen"))
|
||||
if (user.length() > IRCD->GetMaxUser())
|
||||
{
|
||||
source.Reply(HOST_SET_IDENTTOOLONG, Config->GetBlock("networkinfo")->Get<unsigned>("userlen"));
|
||||
source.Reply(HOST_SET_IDENTTOOLONG, IRCD->GetMaxUser());
|
||||
return;
|
||||
}
|
||||
else if (!IRCD->CanSetVIdent)
|
||||
@@ -144,9 +142,9 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (host.length() > Config->GetBlock("networkinfo")->Get<unsigned>("hostlen"))
|
||||
if (host.length() > IRCD->GetMaxHost())
|
||||
{
|
||||
source.Reply(HOST_SET_TOOLONG, Config->GetBlock("networkinfo")->Get<unsigned>("hostlen"));
|
||||
source.Reply(HOST_SET_TOOLONG, IRCD->GetMaxHost());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,9 +71,9 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (host.length() > Config->GetBlock("networkinfo")->Get<unsigned>("hostlen"))
|
||||
if (host.length() > IRCD->GetMaxHost())
|
||||
{
|
||||
source.Reply(HOST_SET_TOOLONG, Config->GetBlock("networkinfo")->Get<unsigned>("hostlen"));
|
||||
source.Reply(HOST_SET_TOOLONG, IRCD->GetMaxHost());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -87,10 +87,7 @@ public:
|
||||
|
||||
na->SetVhost(user, host, source.GetNick());
|
||||
FOREACH_MOD(OnSetVhost, (na));
|
||||
if (!user.empty())
|
||||
source.Reply(_("VHost for \002%s\002 set to \002%s\002@\002%s\002."), nick.c_str(), user.c_str(), host.c_str());
|
||||
else
|
||||
source.Reply(_("VHost for \002%s\002 set to \002%s\002."), nick.c_str(), host.c_str());
|
||||
source.Reply(_("VHost for \002%s\002 set to \002%s\002."), nick.c_str(), na->GetVhostMask().c_str());
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
|
||||
@@ -108,7 +105,7 @@ public:
|
||||
class CommandHSSetAll final
|
||||
: public Command
|
||||
{
|
||||
void Sync(const NickAlias *na)
|
||||
static void Sync(const NickAlias *na)
|
||||
{
|
||||
if (!na || !na->HasVhost())
|
||||
return;
|
||||
@@ -177,9 +174,9 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (host.length() > Config->GetBlock("networkinfo")->Get<unsigned>("hostlen"))
|
||||
if (host.length() > IRCD->GetMaxHost())
|
||||
{
|
||||
source.Reply(HOST_SET_TOOLONG, Config->GetBlock("networkinfo")->Get<unsigned>("hostlen"));
|
||||
source.Reply(HOST_SET_TOOLONG, IRCD->GetMaxHost());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -194,10 +191,7 @@ public:
|
||||
na->SetVhost(user, host, source.GetNick());
|
||||
this->Sync(na);
|
||||
FOREACH_MOD(OnSetVhost, (na));
|
||||
if (!user.empty())
|
||||
source.Reply(_("VHost for group \002%s\002 set to \002%s\002@\002%s\002."), nick.c_str(), user.c_str(), host.c_str());
|
||||
else
|
||||
source.Reply(_("VHost for group \002%s\002 set to \002%s\002."), nick.c_str(), host.c_str());
|
||||
source.Reply(_("VHost for group \002%s\002 set to \002%s\002."), nick.c_str(), na->GetVhostMask().c_str());
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
|
||||
|
||||
+3
-3
@@ -106,7 +106,7 @@ public:
|
||||
/* Close connection once all data is written */
|
||||
bool ProcessWrite() override
|
||||
{
|
||||
return !BinarySocket::ProcessWrite() || this->write_buffer.empty() ? false : true;
|
||||
return !(!BinarySocket::ProcessWrite() || this->write_buffer.empty());
|
||||
}
|
||||
|
||||
const Anope::string GetIP() override
|
||||
@@ -313,7 +313,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
ClientSocket* OnAccept(int fd, const sockaddrs &addr) override
|
||||
ClientSocket *OnAccept(int fd, const sockaddrs &addr) override
|
||||
{
|
||||
auto *c = new MyHTTPClient(this, fd, addr);
|
||||
this->clients.emplace_back(c);
|
||||
@@ -330,7 +330,7 @@ public:
|
||||
this->pages.erase(page->GetURL());
|
||||
}
|
||||
|
||||
HTTPPage* FindPage(const Anope::string &pname) override
|
||||
HTTPPage *FindPage(const Anope::string &pname) override
|
||||
{
|
||||
if (this->pages.count(pname) == 0)
|
||||
return NULL;
|
||||
|
||||
@@ -297,7 +297,7 @@ void IRC2SQL::OnTopicUpdated(User *source, Channel *c, const Anope::string &user
|
||||
this->RunQuery(query);
|
||||
}
|
||||
|
||||
void IRC2SQL::OnBotNotice(User *u, BotInfo *bi, Anope::string &message)
|
||||
void IRC2SQL::OnBotNotice(User *u, BotInfo *bi, Anope::string &message, const Anope::map<Anope::string> &tags)
|
||||
{
|
||||
Anope::string versionstr;
|
||||
if (bi != StatServ)
|
||||
|
||||
@@ -84,5 +84,5 @@ public:
|
||||
|
||||
void OnTopicUpdated(User *source, Channel *c, const Anope::string &user, const Anope::string &topic) override;
|
||||
|
||||
void OnBotNotice(User *u, BotInfo *bi, Anope::string &message) override;
|
||||
void OnBotNotice(User *u, BotInfo *bi, Anope::string &message, const Anope::map<Anope::string> &tags) override;
|
||||
};
|
||||
|
||||
@@ -17,7 +17,7 @@ class MemoServCore final
|
||||
{
|
||||
Reference<BotInfo> MemoServ;
|
||||
|
||||
bool SendMemoMail(NickCore *nc, MemoInfo *mi, Memo *m)
|
||||
static bool SendMemoMail(NickCore *nc, MemoInfo *mi, Memo *m)
|
||||
{
|
||||
Anope::string subject = Language::Translate(nc, Config->GetBlock("mail")->Get<const Anope::string>("memo_subject").c_str()),
|
||||
message = Language::Translate(Config->GetBlock("mail")->Get<const Anope::string>("memo_message").c_str());
|
||||
|
||||
@@ -190,27 +190,14 @@ public:
|
||||
else if (MOD_RESULT == EVENT_ALLOW)
|
||||
return;
|
||||
|
||||
if (!na->nc->HasExt("NS_SECURE") && u->IsRecognized())
|
||||
{
|
||||
na->last_seen = Anope::CurTime;
|
||||
na->last_usermask = u->GetIdent() + "@" + u->GetDisplayedHost();
|
||||
na->last_realname = u->realname;
|
||||
return;
|
||||
}
|
||||
|
||||
if (Config->GetModule("nickserv")->Get<bool>("nonicknameownership"))
|
||||
return;
|
||||
|
||||
bool on_access = u->IsRecognized(false);
|
||||
|
||||
if (on_access || !na->nc->HasExt("KILL_IMMED"))
|
||||
if (!na->nc->HasExt("KILL_IMMED"))
|
||||
{
|
||||
if (na->nc->HasExt("NS_SECURE"))
|
||||
u->SendMessage(NickServ, NICK_IS_SECURE, Config->StrictPrivmsg.c_str(), NickServ->nick.c_str());
|
||||
else
|
||||
u->SendMessage(NickServ, NICK_IS_REGISTERED, Config->StrictPrivmsg.c_str(), NickServ->nick.c_str());
|
||||
u->SendMessage(NickServ, NICK_IS_SECURE, Config->StrictPrivmsg.c_str(), NickServ->nick.c_str());
|
||||
}
|
||||
if (na->nc->HasExt("KILLPROTECT") && !on_access)
|
||||
if (na->nc->HasExt("KILLPROTECT"))
|
||||
{
|
||||
if (na->nc->HasExt("KILL_IMMED"))
|
||||
{
|
||||
@@ -251,7 +238,7 @@ public:
|
||||
|
||||
if (IRCD->CanSVSNick)
|
||||
{
|
||||
unsigned nicklen = Config->GetBlock("networkinfo")->Get<unsigned>("nicklen");
|
||||
unsigned nicklen = IRCD->GetMaxNick();
|
||||
const Anope::string &guestprefix = Config->GetModule("nickserv")->Get<const Anope::string>("guestnickprefix", "Guest");
|
||||
|
||||
Anope::string guestnick;
|
||||
@@ -310,10 +297,9 @@ public:
|
||||
|
||||
NickServ = bi;
|
||||
|
||||
spacesepstream(conf->GetModule(this)->Get<const Anope::string>("defaults", "ns_secure memo_signon memo_receive")).GetTokens(defaults);
|
||||
spacesepstream(conf->GetModule(this)->Get<const Anope::string>("defaults", "memo_signon memo_receive")).GetTokens(defaults);
|
||||
if (defaults.empty())
|
||||
{
|
||||
defaults.emplace_back("NS_SECURE");
|
||||
defaults.emplace_back("MEMO_SIGNON");
|
||||
defaults.emplace_back("MEMO_RECEIVE");
|
||||
}
|
||||
@@ -523,7 +509,7 @@ public:
|
||||
|
||||
/* Update last quit and last seen for the user */
|
||||
NickAlias *na = NickAlias::Find(u->nick);
|
||||
if (na && !na->nc->HasExt("NS_SUSPENDED") && (u->IsRecognized() || u->IsIdentified(true)))
|
||||
if (na && !na->nc->HasExt("NS_SUSPENDED") && u->IsIdentified(true))
|
||||
{
|
||||
na->last_seen = Anope::CurTime;
|
||||
na->last_quit = msg;
|
||||
@@ -543,7 +529,7 @@ public:
|
||||
++it;
|
||||
|
||||
User *u = User::Find(na->nick, true);
|
||||
if (u && (u->IsIdentified(true) || u->IsRecognized()))
|
||||
if (u && u->IsIdentified(true))
|
||||
na->last_seen = Anope::CurTime;
|
||||
|
||||
bool expire = false;
|
||||
|
||||
@@ -1,208 +0,0 @@
|
||||
/* NickServ core functions
|
||||
*
|
||||
* (C) 2003-2024 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#include "module.h"
|
||||
|
||||
class CommandNSAccess final
|
||||
: public Command
|
||||
{
|
||||
private:
|
||||
void DoAdd(CommandSource &source, NickCore *nc, const Anope::string &mask)
|
||||
{
|
||||
if (mask.empty())
|
||||
{
|
||||
this->OnSyntaxError(source, "ADD");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Anope::ReadOnly)
|
||||
{
|
||||
source.Reply(READ_ONLY_MODE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (nc->access.size() >= Config->GetModule(this->owner)->Get<unsigned>("accessmax", "32"))
|
||||
{
|
||||
source.Reply(_("Sorry, the maximum of %d access entries has been reached."), Config->GetModule(this->owner)->Get<unsigned>("accessmax"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (nc->FindAccess(mask))
|
||||
{
|
||||
source.Reply(_("Mask \002%s\002 already present on %s's access list."), mask.c_str(), nc->display.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
nc->AddAccess(mask);
|
||||
Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to ADD mask " << mask << " to " << nc->display;
|
||||
source.Reply(_("\002%s\002 added to %s's access list."), mask.c_str(), nc->display.c_str());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void DoDel(CommandSource &source, NickCore *nc, const Anope::string &mask)
|
||||
{
|
||||
if (mask.empty())
|
||||
{
|
||||
this->OnSyntaxError(source, "DEL");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Anope::ReadOnly)
|
||||
{
|
||||
source.Reply(READ_ONLY_MODE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!nc->FindAccess(mask))
|
||||
{
|
||||
source.Reply(_("\002%s\002 not found on %s's access list."), mask.c_str(), nc->display.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
nc->EraseAccess(mask);
|
||||
Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to DELETE mask " << mask << " from " << nc->display;
|
||||
source.Reply(_("\002%s\002 deleted from %s's access list."), mask.c_str(), nc->display.c_str());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void DoList(CommandSource &source, NickCore *nc, const Anope::string &mask)
|
||||
{
|
||||
unsigned i, end;
|
||||
|
||||
if (nc->access.empty())
|
||||
{
|
||||
source.Reply(_("%s's access list is empty."), nc->display.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
source.Reply(_("Access list for %s:"), nc->display.c_str());
|
||||
for (i = 0, end = nc->access.size(); i < end; ++i)
|
||||
{
|
||||
Anope::string access = nc->GetAccess(i);
|
||||
if (!mask.empty() && !Anope::Match(access, mask))
|
||||
continue;
|
||||
source.Reply(" %s", access.c_str());
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
public:
|
||||
CommandNSAccess(Module *creator) : Command(creator, "nickserv/access", 1, 3)
|
||||
{
|
||||
this->SetDesc(_("Modify the list of authorized addresses"));
|
||||
this->SetSyntax(_("ADD [\037nickname\037] \037mask\037"));
|
||||
this->SetSyntax(_("DEL [\037nickname\037] \037mask\037"));
|
||||
this->SetSyntax(_("LIST [\037nickname\037]"));
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override
|
||||
{
|
||||
const Anope::string &cmd = params[0];
|
||||
Anope::string nick, mask;
|
||||
|
||||
if (cmd.equals_ci("LIST"))
|
||||
nick = params.size() > 1 ? params[1] : "";
|
||||
else
|
||||
{
|
||||
nick = params.size() == 3 ? params[1] : "";
|
||||
mask = params.size() > 1 ? params[params.size() - 1] : "";
|
||||
}
|
||||
|
||||
NickCore *nc;
|
||||
if (!nick.empty())
|
||||
{
|
||||
const NickAlias *na = NickAlias::Find(nick);
|
||||
if (na == NULL)
|
||||
{
|
||||
source.Reply(NICK_X_NOT_REGISTERED, nick.c_str());
|
||||
return;
|
||||
}
|
||||
else if (na->nc != source.GetAccount() && !source.HasPriv("nickserv/access"))
|
||||
{
|
||||
source.Reply(ACCESS_DENIED);
|
||||
return;
|
||||
}
|
||||
else if (Config->GetModule("nickserv")->Get<bool>("secureadmins", "yes") && source.GetAccount() != na->nc && na->nc->IsServicesOper() && !cmd.equals_ci("LIST"))
|
||||
{
|
||||
source.Reply(_("You may view but not modify the access list of other Services Operators."));
|
||||
return;
|
||||
}
|
||||
|
||||
nc = na->nc;
|
||||
}
|
||||
else
|
||||
nc = source.nc;
|
||||
|
||||
if (!mask.empty() && (mask.find('@') == Anope::string::npos || mask.find('!') != Anope::string::npos))
|
||||
{
|
||||
source.Reply(BAD_USERHOST_MASK);
|
||||
source.Reply(MORE_INFO, Config->StrictPrivmsg.c_str(), source.service->nick.c_str(), source.command.c_str());
|
||||
}
|
||||
else if (cmd.equals_ci("LIST"))
|
||||
return this->DoList(source, nc, mask);
|
||||
else if (nc->HasExt("NS_SUSPENDED"))
|
||||
source.Reply(NICK_X_SUSPENDED, nc->display.c_str());
|
||||
else if (cmd.equals_ci("ADD"))
|
||||
return this->DoAdd(source, nc, mask);
|
||||
else if (cmd.equals_ci("DEL"))
|
||||
return this->DoDel(source, nc, mask);
|
||||
else
|
||||
this->OnSyntaxError(source, "");
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(" ");
|
||||
source.Reply(_("Modifies or displays the access list for your nick. This\n"
|
||||
"is the list of addresses which will be automatically\n"
|
||||
"recognized by %s as allowed to use the nick. If\n"
|
||||
"you want to use the nick from a different address, you\n"
|
||||
"need to send an \002IDENTIFY\002 command to make %s\n"
|
||||
"recognize you. Services Operators may provide a nick\n"
|
||||
"to modify other users' access lists.\n"
|
||||
" \n"
|
||||
"Examples:\n"
|
||||
" \n"
|
||||
" \002ACCESS ADD anyone@*.bepeg.com\002\n"
|
||||
" Allows access to user \002anyone\002 from any machine in\n"
|
||||
" the \002bepeg.com\002 domain.\n"
|
||||
" \n"
|
||||
" \002ACCESS DEL anyone@*.bepeg.com\002\n"
|
||||
" Reverses the previous command.\n"
|
||||
" \n"
|
||||
" \002ACCESS LIST\002\n"
|
||||
" Displays the current access list."), source.service->nick.c_str(), source.service->nick.c_str());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class NSAccess final
|
||||
: public Module
|
||||
{
|
||||
CommandNSAccess commandnsaccess;
|
||||
|
||||
public:
|
||||
NSAccess(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
|
||||
commandnsaccess(this)
|
||||
{
|
||||
}
|
||||
|
||||
void OnNickRegister(User *u, NickAlias *na, const Anope::string &) override
|
||||
{
|
||||
if (u && Config->GetModule(this)->Get<bool>("addaccessonreg"))
|
||||
na->nc->AddAccess(u->Mask());
|
||||
}
|
||||
};
|
||||
|
||||
MODULE_INIT(NSAccess)
|
||||
@@ -50,7 +50,7 @@ struct AJoinEntry final
|
||||
sd["key"] << this->key;
|
||||
}
|
||||
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &sd)
|
||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &sd)
|
||||
{
|
||||
Anope::string sowner;
|
||||
|
||||
@@ -91,7 +91,7 @@ AJoinList::~AJoinList()
|
||||
class CommandNSAJoin final
|
||||
: public Command
|
||||
{
|
||||
void DoList(CommandSource &source, NickCore *nc)
|
||||
static void DoList(CommandSource &source, NickCore *nc)
|
||||
{
|
||||
AJoinList *channels = nc->Require<AJoinList>("ajoinlist");
|
||||
|
||||
@@ -146,7 +146,7 @@ class CommandNSAJoin final
|
||||
}
|
||||
else if (i != (*channels)->size())
|
||||
alreadyadded += chan + ", ";
|
||||
else if (IRCD->IsChannelValid(chan) == false)
|
||||
else if (!IRCD->IsChannelValid(chan))
|
||||
source.Reply(CHAN_X_INVALID, chan.c_str());
|
||||
else
|
||||
{
|
||||
@@ -361,9 +361,9 @@ public:
|
||||
continue;
|
||||
else if (c->HasMode("SSL") && !u->IsSecurelyConnected())
|
||||
continue;
|
||||
else if (c->MatchesList(u, "BAN") == true && c->MatchesList(u, "EXCEPT") == false)
|
||||
else if (c->MatchesList(u, "BAN") && !c->MatchesList(u, "EXCEPT"))
|
||||
need_invite = true;
|
||||
else if (c->HasMode("INVITE") && c->MatchesList(u, "INVITEOVERRIDE") == false)
|
||||
else if (c->HasMode("INVITE") && !c->MatchesList(u, "INVITEOVERRIDE"))
|
||||
need_invite = true;
|
||||
|
||||
if (c->HasMode("KEY"))
|
||||
|
||||
@@ -19,7 +19,7 @@ struct CertServiceImpl final
|
||||
{
|
||||
CertServiceImpl(Module *o) : CertService(o) { }
|
||||
|
||||
NickCore* FindAccountFromCert(const Anope::string &cert) override
|
||||
NickCore *FindAccountFromCert(const Anope::string &cert) override
|
||||
{
|
||||
Anope::hash_map<NickCore *>::iterator it = certmap.find(cert);
|
||||
if (it != certmap.end())
|
||||
@@ -103,6 +103,19 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void ReplaceCert(const Anope::string &oldentry, const Anope::string &newentry) override
|
||||
{
|
||||
auto it = std::find(this->certs.begin(), this->certs.end(), oldentry);
|
||||
if (it == this->certs.end())
|
||||
return; // We can't replace a non-existent cert.
|
||||
|
||||
FOREACH_MOD(OnNickEraseCert, (this->nc, oldentry));
|
||||
certmap.erase(oldentry);
|
||||
*it = newentry;
|
||||
certmap[newentry] = nc;
|
||||
FOREACH_MOD(OnNickAddCert, (this->nc, newentry));
|
||||
}
|
||||
|
||||
/** Clears the entire nick's cert list
|
||||
*
|
||||
* Deletes all the memory allocated in the certificate list vector and then clears the vector.
|
||||
@@ -237,7 +250,7 @@ private:
|
||||
source.Reply(_("\002%s\002 deleted from %s's certificate list."), certfp.c_str(), nc->display.c_str());
|
||||
}
|
||||
|
||||
void DoList(CommandSource &source, const NickCore *nc)
|
||||
static void DoList(CommandSource &source, const NickCore *nc)
|
||||
{
|
||||
NSCertList *cl = nc->GetExt<NSCertList>("certificates");
|
||||
|
||||
@@ -286,7 +299,7 @@ public:
|
||||
source.Reply(NICK_X_NOT_REGISTERED, nick.c_str());
|
||||
return;
|
||||
}
|
||||
else if (na->nc != source.GetAccount() && !source.HasPriv("nickserv/access"))
|
||||
else if (na->nc != source.GetAccount() && !source.HasPriv("nickserv/cert"))
|
||||
{
|
||||
source.Reply(ACCESS_DENIED);
|
||||
return;
|
||||
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
Anope::string nick;
|
||||
if (params.empty())
|
||||
{
|
||||
NickCore* core = source.GetAccount();
|
||||
NickCore *core = source.GetAccount();
|
||||
if (core)
|
||||
nick = core->display;
|
||||
}
|
||||
@@ -178,7 +178,7 @@ public:
|
||||
if (user != NULL && !user->fingerprint.empty() && cl && cl->FindCert(user->fingerprint))
|
||||
ok = true;
|
||||
|
||||
if (ok == false && !pass.empty())
|
||||
if (!ok && !pass.empty())
|
||||
{
|
||||
auto *req = new NSGroupRequest(owner, source, this, source.GetNick(), target, pass);
|
||||
FOREACH_MOD(OnCheckAuthentication, (source.GetUser(), req));
|
||||
|
||||
@@ -102,12 +102,7 @@ public:
|
||||
if (show_hidden)
|
||||
{
|
||||
if (na->HasVhost())
|
||||
{
|
||||
if (IRCD->CanSetVIdent && !na->GetVhostIdent().empty())
|
||||
info[_("VHost")] = na->GetVhostIdent() + "@" + na->GetVhostHost();
|
||||
else
|
||||
info[_("VHost")] = na->GetVhostHost();
|
||||
}
|
||||
info[_("VHost")] = na->GetVhostMask();
|
||||
}
|
||||
|
||||
FOREACH_MOD(OnNickInfo, (source, na, info, show_hidden));
|
||||
|
||||
@@ -18,7 +18,7 @@ class NSMaxEmail final
|
||||
bool clean = false;
|
||||
|
||||
/* strip dots from username, and remove anything after the first + */
|
||||
Anope::string CleanMail(const Anope::string &email)
|
||||
static Anope::string CleanMail(const Anope::string &email)
|
||||
{
|
||||
size_t host = email.find('@');
|
||||
if (host == Anope::string::npos)
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
// same person that is executing the command, so kill them off (old GHOST command).
|
||||
else if (u->Account() == na->nc)
|
||||
{
|
||||
if (!source.GetAccount() && na->nc->HasExt("NS_SECURE"))
|
||||
if (!source.GetAccount())
|
||||
{
|
||||
source.GetUser()->Login(u->Account());
|
||||
Log(LOG_COMMAND, source, cmd) << "and was automatically identified to " << u->Account()->display;
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
/* User is not identified or not identified to the same account as the person using this command */
|
||||
else
|
||||
{
|
||||
if (!source.GetAccount() && na->nc->HasExt("NS_SECURE"))
|
||||
if (!source.GetAccount())
|
||||
{
|
||||
source.GetUser()->Login(na->nc); // Identify the user using the command if they arent identified
|
||||
Log(LOG_COMMAND, source, cmd) << "and was automatically identified to " << na->nick << " (" << na->nc->display << ")";
|
||||
@@ -182,8 +182,6 @@ public:
|
||||
bool ok = false;
|
||||
if (source.GetAccount() == na->nc)
|
||||
ok = true;
|
||||
else if (!na->nc->HasExt("NS_SECURE") && source.GetUser() && na->nc->IsOnAccess(source.GetUser()))
|
||||
ok = true;
|
||||
|
||||
NSCertList *cl = na->nc->GetExt<NSCertList>("certificates");
|
||||
if (source.GetUser() && !source.GetUser()->fingerprint.empty() && cl && cl->FindCert(source.GetUser()->fingerprint))
|
||||
@@ -192,7 +190,7 @@ public:
|
||||
if (source.HasPriv("nickserv/recover"))
|
||||
ok = true;
|
||||
|
||||
if (ok == false && !pass.empty())
|
||||
if (!ok && !pass.empty())
|
||||
{
|
||||
auto *req = new NSRecoverRequest(owner, source, this, na->nick, pass);
|
||||
FOREACH_MOD(OnCheckAuthentication, (source.GetUser(), req));
|
||||
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
NickAlias *na = NickAlias::Find(nick);
|
||||
if (na == NULL)
|
||||
source.Reply(NICK_X_NOT_REGISTERED, nick.c_str());
|
||||
else if (na->nc->HasExt("UNCONFIRMED") == false)
|
||||
else if (!na->nc->HasExt("UNCONFIRMED"))
|
||||
source.Reply(_("Nick \002%s\002 is already confirmed."), na->nick.c_str());
|
||||
else
|
||||
{
|
||||
@@ -195,8 +195,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int minpasslen = Config->GetModule("nickserv")->Get<unsigned>("minpasslen", "8");
|
||||
unsigned int maxpasslen = Config->GetModule("nickserv")->Get<unsigned>("maxpasslen", "32");
|
||||
unsigned int minpasslen = Config->GetModule("nickserv")->Get<unsigned>("minpasslen", "10");
|
||||
unsigned int maxpasslen = Config->GetModule("nickserv")->Get<unsigned>("maxpasslen", "50");
|
||||
|
||||
if (Config->GetModule("nickserv")->Get<bool>("forceemail", "yes") && email.empty())
|
||||
this->OnSyntaxError(source, "");
|
||||
@@ -233,11 +233,7 @@ public:
|
||||
|
||||
Log(LOG_COMMAND, source, this) << "to register " << na->nick << " (email: " << (!na->nc->email.empty() ? na->nc->email : "none") << ")";
|
||||
|
||||
if (na->nc->GetAccessCount())
|
||||
source.Reply(_("Nickname \002%s\002 registered under your user@host-mask: %s"), u_nick.c_str(), na->nc->GetAccess(0).c_str());
|
||||
else
|
||||
source.Reply(_("Nickname \002%s\002 registered."), u_nick.c_str());
|
||||
|
||||
source.Reply(_("Nickname \002%s\002 registered."), u_nick.c_str());
|
||||
if (nsregister.equals_ci("admin"))
|
||||
{
|
||||
nc->Extend<bool>("UNCONFIRMED");
|
||||
@@ -271,6 +267,7 @@ public:
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
|
||||
{
|
||||
unsigned int minpasslen = Config->GetModule("nickserv")->Get<unsigned>("minpasslen", "10");
|
||||
this->SendSyntax(source);
|
||||
source.Reply(" ");
|
||||
source.Reply(_("Registers your nickname in the %s database. Once\n"
|
||||
@@ -288,9 +285,10 @@ public:
|
||||
"your nickname as a password is a much worse idea ;) and,\n"
|
||||
"in fact, %s will not allow it. Also, short\n"
|
||||
"passwords are vulnerable to trial-and-error searches, so\n"
|
||||
"you should choose a password at least 5 characters long.\n"
|
||||
"you should choose a password at least %u characters long.\n"
|
||||
"Finally, the space character cannot be used in passwords."),
|
||||
source.service->nick.c_str(), source.service->nick.c_str());
|
||||
source.service->nick.c_str(), source.service->nick.c_str(),
|
||||
minpasslen);
|
||||
|
||||
if (!Config->GetModule("nickserv")->Get<bool>("forceemail", "yes"))
|
||||
{
|
||||
@@ -425,7 +423,7 @@ static bool SendRegmail(User *u, const NickAlias *na, BotInfo *bi)
|
||||
if (code == NULL)
|
||||
{
|
||||
code = na->nc->Extend<Anope::string>("passcode");
|
||||
*code = Anope::Random(9);
|
||||
*code = Anope::Random(15);
|
||||
}
|
||||
|
||||
Anope::string subject = Language::Translate(na->nc, Config->GetBlock("mail")->Get<const Anope::string>("registration_subject").c_str()),
|
||||
|
||||
@@ -30,6 +30,8 @@ public:
|
||||
|
||||
if (!(na = NickAlias::Find(params[0])))
|
||||
source.Reply(NICK_X_NOT_REGISTERED, params[0].c_str());
|
||||
else if (na->nc->HasExt("NS_SUSPENDED"))
|
||||
source.Reply(NICK_X_SUSPENDED, na->nc->display.c_str());
|
||||
else if (!na->nc->email.equals_ci(params[1]))
|
||||
source.Reply(_("Incorrect email address."));
|
||||
else
|
||||
@@ -91,6 +93,12 @@ public:
|
||||
if (na && ri)
|
||||
{
|
||||
NickCore *nc = na->nc;
|
||||
if (nc->HasExt("NS_SUSPENDED"))
|
||||
{
|
||||
source.Reply(NICK_X_SUSPENDED, nc->display.c_str());
|
||||
return EVENT_STOP;
|
||||
}
|
||||
|
||||
const Anope::string &passcode = params[1];
|
||||
if (ri->time < Anope::CurTime - 3600)
|
||||
{
|
||||
|
||||
+7
-110
@@ -134,14 +134,14 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int minpasslen = Config->GetModule("nickserv")->Get<unsigned>("minpasslen", "8");
|
||||
unsigned int minpasslen = Config->GetModule("nickserv")->Get<unsigned>("minpasslen", "10");
|
||||
if (len < minpasslen)
|
||||
{
|
||||
source.Reply(PASSWORD_TOO_SHORT, minpasslen);
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int maxpasslen = Config->GetModule("nickserv")->Get<unsigned>("maxpasslen", "32");
|
||||
unsigned int maxpasslen = Config->GetModule("nickserv")->Get<unsigned>("maxpasslen", "50");
|
||||
if (len > maxpasslen)
|
||||
{
|
||||
source.Reply(PASSWORD_TOO_LONG, maxpasslen);
|
||||
@@ -204,14 +204,14 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int minpasslen = Config->GetModule("nickserv")->Get<unsigned>("minpasslen", "8");
|
||||
unsigned int minpasslen = Config->GetModule("nickserv")->Get<unsigned>("minpasslen", "10");
|
||||
if (len < minpasslen)
|
||||
{
|
||||
source.Reply(PASSWORD_TOO_SHORT, minpasslen);
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int maxpasslen = Config->GetModule("nickserv")->Get<unsigned>("maxpasslen", "32");
|
||||
unsigned int maxpasslen = Config->GetModule("nickserv")->Get<unsigned>("maxpasslen", "50");
|
||||
if (len > maxpasslen)
|
||||
{
|
||||
source.Reply(PASSWORD_TOO_LONG, maxpasslen);
|
||||
@@ -513,7 +513,7 @@ class CommandNSSetEmail
|
||||
{
|
||||
static bool SendConfirmMail(User *u, NickCore *nc, BotInfo *bi, const Anope::string &new_email)
|
||||
{
|
||||
Anope::string code = Anope::Random(9);
|
||||
Anope::string code = Anope::Random(15);
|
||||
|
||||
std::pair<Anope::string, Anope::string> *n = nc->Extend<std::pair<Anope::string, Anope::string> >("ns_set_email");
|
||||
n->first = new_email;
|
||||
@@ -1105,103 +1105,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
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 ¶m)
|
||||
{
|
||||
if (Anope::ReadOnly)
|
||||
{
|
||||
source.Reply(READ_ONLY_MODE);
|
||||
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(OnSetNickOption, MOD_RESULT, (source, this, nc, param));
|
||||
if (MOD_RESULT == EVENT_STOP)
|
||||
return;
|
||||
|
||||
if (param.equals_ci("ON"))
|
||||
{
|
||||
Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to enable secure for " << nc->display;
|
||||
nc->Extend<bool>("NS_SECURE");
|
||||
source.Reply(_("Secure option is now \002on\002 for \002%s\002."), nc->display.c_str());
|
||||
}
|
||||
else if (param.equals_ci("OFF"))
|
||||
{
|
||||
Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to disable secure for " << nc->display;
|
||||
nc->Shrink<bool>("NS_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> ¶ms) override
|
||||
{
|
||||
this->Run(source, source.nc->display, params[0]);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &) 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."), source.service->nick.c_str(), source.service->nick.c_str());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class CommandNSSASetSecure final
|
||||
: 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> ¶ms) override
|
||||
{
|
||||
this->Run(source, params[0], params[1]);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &) 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."), source.service->nick.c_str(), source.service->nick.c_str());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class CommandNSSASetNoexpire final
|
||||
: public Command
|
||||
{
|
||||
@@ -1288,13 +1191,10 @@ class NSSet final
|
||||
CommandNSSetPassword commandnssetpassword;
|
||||
CommandNSSASetPassword commandnssasetpassword;
|
||||
|
||||
CommandNSSetSecure commandnssetsecure;
|
||||
CommandNSSASetSecure commandnssasetsecure;
|
||||
|
||||
CommandNSSASetNoexpire commandnssasetnoexpire;
|
||||
|
||||
SerializableExtensibleItem<bool> autoop, neverop, killprotect, kill_quick, kill_immed,
|
||||
message, secure, noexpire;
|
||||
message, noexpire;
|
||||
|
||||
struct KeepModes final
|
||||
: SerializableExtensibleItem<bool>
|
||||
@@ -1358,13 +1258,12 @@ public:
|
||||
commandnssetlanguage(this), commandnssasetlanguage(this),
|
||||
commandnssetmessage(this), commandnssasetmessage(this),
|
||||
commandnssetpassword(this), commandnssasetpassword(this),
|
||||
commandnssetsecure(this), commandnssasetsecure(this),
|
||||
commandnssasetnoexpire(this),
|
||||
|
||||
autoop(this, "AUTOOP"), neverop(this, "NEVEROP"),
|
||||
killprotect(this, "KILLPROTECT"), kill_quick(this, "KILL_QUICK"),
|
||||
kill_immed(this, "KILL_IMMED"), message(this, "MSG"),
|
||||
secure(this, "NS_SECURE"), noexpire(this, "NS_NO_EXPIRE"),
|
||||
noexpire(this, "NS_NO_EXPIRE"),
|
||||
|
||||
keep_modes(this, "NS_KEEP_MODES"), ns_set_email(this, "ns_set_email")
|
||||
{
|
||||
@@ -1420,8 +1319,6 @@ public:
|
||||
info.AddOption(_("Quick protection"));
|
||||
else if (killprotect.HasExt(na->nc))
|
||||
info.AddOption(_("Protection"));
|
||||
if (secure.HasExt(na->nc))
|
||||
info.AddOption(_("Security"));
|
||||
if (message.HasExt(na->nc))
|
||||
info.AddOption(_("Message mode"));
|
||||
if (autoop.HasExt(na->nc))
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user