mirror of
https://github.com/anope/anope.git
synced 2026-07-06 00:53:14 +02:00
Compare commits
184 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 507eefc820 | |||
| 72af764861 | |||
| 1b631e96bd | |||
| 3b4a4da52d | |||
| 2e59aac025 | |||
| 3de6da80c6 | |||
| 2829c83118 | |||
| f58012ea0e | |||
| f8605ec188 | |||
| 5a12beff15 | |||
| 6b1f8de885 | |||
| 33be5de66e | |||
| 4399eeaa58 | |||
| 38cfb0603a | |||
| 1a3844e74e | |||
| bfed2e1bf5 | |||
| e488f294a1 | |||
| fde3438ef2 | |||
| 1575dea5b9 | |||
| a1972ba9b6 | |||
| 5a72d8783e | |||
| e6770bc2fd | |||
| 413fed474e | |||
| 60083834f8 | |||
| 9ac4da0489 | |||
| cb3848b7db | |||
| 753119c4a1 | |||
| d996c3aa8f | |||
| ac6e8c617d | |||
| 3b09f4aa54 | |||
| 10f4724b6b | |||
| ad86535024 | |||
| 628f4d2a7e | |||
| 8d5be77c93 | |||
| 13a556df89 | |||
| 4e9d183523 | |||
| 074dfb63a7 | |||
| beaf09de7b | |||
| c8d8978cd0 | |||
| 11edba04fe | |||
| 22ba54b00d | |||
| 6fd7ca39e2 | |||
| b8cd00b412 | |||
| f4bd43e898 | |||
| 7d7664444a | |||
| 1a8bbd6004 | |||
| e725c880a9 | |||
| f5abcd1c4c | |||
| 1986aa6581 | |||
| b52e1b2b02 | |||
| 54719fbfc6 | |||
| 06add0e5fc | |||
| 63d682314b | |||
| 1a6060ac5b | |||
| a302f8f1be | |||
| 04e1a4f5c8 | |||
| 1538909ac0 | |||
| a15f165a1d | |||
| 77435dd0d9 | |||
| 6f57907416 | |||
| 7c1cfd2849 | |||
| 259b10b83a | |||
| 02355546ff | |||
| 6ad3430ac4 | |||
| 29e7674e56 | |||
| b09632d1c3 | |||
| e2df7d4d01 | |||
| 9a984a8148 | |||
| fb9c8950ed | |||
| a849a81ac3 | |||
| f919bb0748 | |||
| 3b85a8071f | |||
| 9a8cac060d | |||
| 0353338436 | |||
| defb8348a7 | |||
| 1b86665d81 | |||
| 2f52fa723c | |||
| 6e0f0b8896 | |||
| 2c5b2c649e | |||
| a6bc4cab9d | |||
| ef37daf44a | |||
| 39d288f99f | |||
| 9ead3f15c3 | |||
| 272104af95 | |||
| 51e95d72e3 | |||
| 12486f6cee | |||
| 891375baca | |||
| 41a295202e | |||
| 722c5b7d61 | |||
| 52216b56a1 | |||
| cd614831de | |||
| 1d0a836a2e | |||
| 46b7064834 | |||
| bb8df01e25 | |||
| 16700b0e30 | |||
| 4e04a11995 | |||
| 76e5480be9 | |||
| 464e6b8010 | |||
| 3272c1bbc6 | |||
| 307ffea951 | |||
| bb94f286f5 | |||
| 86e3556438 | |||
| 12214bee72 | |||
| 08a35231ef | |||
| 9649dc78a1 | |||
| 9970b4e37b | |||
| a5a615d5c7 | |||
| ce97fdd1c6 | |||
| 1a8ae513b4 | |||
| 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 |
@@ -4,3 +4,4 @@ updates:
|
|||||||
directory: /
|
directory: /
|
||||||
schedule:
|
schedule:
|
||||||
interval: monthly
|
interval: monthly
|
||||||
|
target-branch: "2.1"
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ jobs:
|
|||||||
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
|
echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
|
||||||
apk update
|
apk update
|
||||||
apk add \
|
apk add \
|
||||||
|
argon2-dev \
|
||||||
clang \
|
clang \
|
||||||
cmake \
|
cmake \
|
||||||
g++ \
|
g++ \
|
||||||
@@ -36,7 +37,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Enable extras
|
- name: Enable extras
|
||||||
run: |
|
run: |
|
||||||
for MODULE in ldap ldap_authentication ldap_oper mysql regex_pcre2 regex_posix regex_tre sql_authentication sql_log sql_oper sqlite ssl_gnutls ssl_openssl
|
for MODULE in enc_argon2 enc_posix ldap mysql regex_pcre2 regex_posix regex_tre sqlite ssl_gnutls ssl_openssl
|
||||||
do
|
do
|
||||||
ln -s $PWD/modules/extra/$MODULE.cpp $PWD/modules
|
ln -s $PWD/modules/extra/$MODULE.cpp $PWD/modules
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ jobs:
|
|||||||
g++ \
|
g++ \
|
||||||
gettext \
|
gettext \
|
||||||
git \
|
git \
|
||||||
|
libargon2-dev \
|
||||||
libgnutls28-dev \
|
libgnutls28-dev \
|
||||||
libldap2-dev \
|
libldap2-dev \
|
||||||
libmysqlclient-dev \
|
libmysqlclient-dev \
|
||||||
@@ -31,7 +32,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Enable extras
|
- name: Enable extras
|
||||||
run: |
|
run: |
|
||||||
for MODULE in ldap ldap_authentication ldap_oper mysql regex_pcre2 regex_posix regex_tre sql_authentication sql_log sql_oper sqlite ssl_gnutls ssl_openssl
|
for MODULE in enc_argon2 enc_posix ldap mysql regex_pcre2 regex_posix regex_tre sqlite ssl_gnutls ssl_openssl
|
||||||
do
|
do
|
||||||
ln -s ${{ github.workspace }}/modules/extra/$MODULE.cpp ${{ github.workspace }}/modules
|
ln -s ${{ github.workspace }}/modules/extra/$MODULE.cpp ${{ github.workspace }}/modules
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ jobs:
|
|||||||
if: "!contains(github.event.head_commit.message, '[skip windows ci]')"
|
if: "!contains(github.event.head_commit.message, '[skip windows ci]')"
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup MSBuild
|
- name: Setup MSBuild
|
||||||
uses: microsoft/setup-msbuild@v1.3
|
uses: microsoft/setup-msbuild@v1.3
|
||||||
|
|||||||
+2
-5
@@ -1,16 +1,13 @@
|
|||||||
build/
|
build/
|
||||||
config.cache
|
config.cache
|
||||||
include/sysconf.h
|
include/sysconf.h
|
||||||
|
modules/enc_argon2.cpp
|
||||||
|
modules/enc_posix.cpp
|
||||||
modules/ldap.cpp
|
modules/ldap.cpp
|
||||||
modules/ldap_authentication.cpp
|
|
||||||
modules/ldap_oper.cpp
|
|
||||||
modules/mysql.cpp
|
modules/mysql.cpp
|
||||||
modules/regex_pcre2.cpp
|
modules/regex_pcre2.cpp
|
||||||
modules/regex_posix.cpp
|
modules/regex_posix.cpp
|
||||||
modules/regex_tre.cpp
|
modules/regex_tre.cpp
|
||||||
modules/sql_authentication.cpp
|
|
||||||
modules/sql_log.cpp
|
|
||||||
modules/sql_oper.cpp
|
|
||||||
modules/sqlite.cpp
|
modules/sqlite.cpp
|
||||||
modules/ssl_gnutls.cpp
|
modules/ssl_gnutls.cpp
|
||||||
modules/ssl_openssl.cpp
|
modules/ssl_openssl.cpp
|
||||||
|
|||||||
+8
-24
@@ -170,7 +170,7 @@ if(MSVC)
|
|||||||
string(REPLACE "/GX " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
string(REPLACE "/GX " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||||
string(REPLACE "/W3 " "" 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 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)
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||||
# Otherwise, we're not using Visual Studio
|
# Otherwise, we're not using Visual Studio
|
||||||
else()
|
else()
|
||||||
@@ -183,6 +183,12 @@ if(CMAKE_DL_LIBS)
|
|||||||
list(APPEND LINK_LIBS ${CMAKE_DL_LIBS})
|
list(APPEND LINK_LIBS ${CMAKE_DL_LIBS})
|
||||||
endif()
|
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
|
# 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)
|
if(MINGW)
|
||||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
|
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)
|
if(HAVE_PIPE_FLAG)
|
||||||
set(CXXFLAGS "${CXXFLAGS} -pipe")
|
set(CXXFLAGS "${CXXFLAGS} -pipe")
|
||||||
endif()
|
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()
|
endif()
|
||||||
|
|
||||||
# If DEFUMASK wasn't passed to CMake, set a default depending on if RUNGROUP was passed in or not
|
# If DEFUMASK wasn't passed to CMake, set a default depending on if RUNGROUP was passed in or not
|
||||||
@@ -241,6 +224,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINF
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Check for the existence of the following functions
|
# Check for the existence of the following functions
|
||||||
|
check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
|
||||||
check_function_exists(umask HAVE_UMASK)
|
check_function_exists(umask HAVE_UMASK)
|
||||||
check_function_exists(epoll_wait HAVE_EPOLL)
|
check_function_exists(epoll_wait HAVE_EPOLL)
|
||||||
check_function_exists(poll HAVE_POLL)
|
check_function_exists(poll HAVE_POLL)
|
||||||
|
|||||||
+159
-78
@@ -238,15 +238,15 @@ serverinfo
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* The filename containing the Anope process ID. The path is relative to the
|
* The filename containing the Anope process ID. The path is relative to the
|
||||||
* services root directory.
|
* data directory.
|
||||||
*/
|
*/
|
||||||
pid = "data/anope.pid"
|
pid = "anope.pid"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The filename containing the Message of the Day. The path is relative to the
|
* The filename containing the Message of the Day. The path is relative to the
|
||||||
* services root directory.
|
* config directory.
|
||||||
*/
|
*/
|
||||||
motd = "conf/motd.txt"
|
motd = "motd.txt"
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -302,30 +302,31 @@ networkinfo
|
|||||||
/*
|
/*
|
||||||
* Set this to the maximum allowed nick length on your network.
|
* Set this to the maximum allowed nick length on your network.
|
||||||
* Be sure to set this correctly, as setting this wrong can result in
|
* 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.
|
/* Set this to the maximum allowed ident length on your network.
|
||||||
* Be sure to set this correctly, as setting this wrong can result in
|
* 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.
|
/* Set this to the maximum allowed hostname length on your network.
|
||||||
* Be sure to set this correctly, as setting this wrong can result in
|
* 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.
|
/* 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).
|
/* 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
|
* Characters allowed in nicknames. This always includes the characters described
|
||||||
@@ -394,19 +395,6 @@ options
|
|||||||
*/
|
*/
|
||||||
casemap = "ascii"
|
casemap = "ascii"
|
||||||
|
|
||||||
/*
|
|
||||||
* This key is used to initiate the random number generator. This number
|
|
||||||
* MUST be random as you want your passcodes to be random. Don't give this
|
|
||||||
* key to anyone! Keep it private!
|
|
||||||
*
|
|
||||||
* NOTE: If you don't uncomment this or keep the default values, any talented
|
|
||||||
* programmer would be able to easily "guess" random strings used to mask
|
|
||||||
* information. Be safe, and come up with a 7-digit number.
|
|
||||||
*
|
|
||||||
* This directive is optional, but highly recommended.
|
|
||||||
*/
|
|
||||||
#seed = 9866235
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sets the number of invalid password tries before services removes a user
|
* Sets the number of invalid password tries before services removes a user
|
||||||
* from the network. If a user enters a number of invalid passwords equal to
|
* from the network. If a user enters a number of invalid passwords equal to
|
||||||
@@ -522,6 +510,12 @@ options
|
|||||||
*/
|
*/
|
||||||
hideregisteredcommands = yes
|
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.
|
/* The regex engine to use, as provided by the regex modules.
|
||||||
* Leave commented to disable regex matching.
|
* Leave commented to disable regex matching.
|
||||||
*
|
*
|
||||||
@@ -748,7 +742,6 @@ log
|
|||||||
* You may define groups of commands and privileges, as well as who may use them.
|
* 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.
|
* 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
|
* 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
|
* additional commands with permissions, such as commands from third party modules, the permissions
|
||||||
@@ -766,9 +759,9 @@ log
|
|||||||
* memoserv/info - Can see any information with /MEMOSERV INFO
|
* 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/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
|
* 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/alist - Can see the channel access list of other users
|
||||||
* nickserv/auspex - Can see any information with /NICKSERV INFO
|
* 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/confirm - Can confirm other users nicknames
|
||||||
* nickserv/drop - Can drop other users nicks
|
* nickserv/drop - Can drop other users nicks
|
||||||
* nickserv/recover - Can recover other users nicks
|
* nickserv/recover - Can recover other users nicks
|
||||||
@@ -789,14 +782,14 @@ log
|
|||||||
*
|
*
|
||||||
* nickserv/getemail nickserv/suspend nickserv/ajoin nickserv/list
|
* nickserv/getemail nickserv/suspend nickserv/ajoin nickserv/list
|
||||||
*
|
*
|
||||||
* nickserv/saset/autoop nickserv/saset/email nickserv/saset/greet nickserv/saset/password
|
* nickserv/saset/autoop nickserv/saset/display nickserv/saset/email nickserv/saset/greet
|
||||||
* nickserv/saset/display nickserv/saset/kill nickserv/saset/language nickserv/saset/message
|
* nickserv/saset/kill nickserv/saset/keepmodes nickserv/saset/language nickserv/saset/message
|
||||||
* nickserv/saset/private nickserv/saset/secure nickserv/saset/url nickserv/saset/noexpire
|
* nickserv/saset/neverop nickserv/saset/noexpire nickserv/saset/password nickserv/saset/private
|
||||||
* nickserv/saset/keepmodes nickserv/saset/neverop
|
* nickserv/saset/url
|
||||||
*
|
*
|
||||||
* hostserv/set hostserv/del hostserv/list
|
* hostserv/set hostserv/del hostserv/list
|
||||||
*
|
*
|
||||||
* global/global
|
* global/global global/queue global/server
|
||||||
*
|
*
|
||||||
* operserv/news operserv/stats operserv/kick operserv/exception operserv/seen
|
* operserv/news operserv/stats operserv/kick operserv/exception operserv/seen
|
||||||
* operserv/mode operserv/session operserv/modinfo operserv/ignore operserv/chanlist
|
* operserv/mode operserv/session operserv/modinfo operserv/ignore operserv/chanlist
|
||||||
@@ -925,7 +918,7 @@ opertype
|
|||||||
/*
|
/*
|
||||||
* [OPTIONAL] Mail Config
|
* [OPTIONAL] Mail Config
|
||||||
*
|
*
|
||||||
* This section contains settings related to the use of e-mail from services.
|
* This section contains settings related to the use of email from services.
|
||||||
* If the usemail directive is set to yes, unless specified otherwise, all other
|
* If the usemail directive is set to yes, unless specified otherwise, all other
|
||||||
* directives are required.
|
* directives are required.
|
||||||
*
|
*
|
||||||
@@ -945,7 +938,7 @@ mail
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* This is the command-line that will be used to call the mailer to send an
|
* This is the command-line that will be used to call the mailer to send an
|
||||||
* e-mail. It must be called with all the parameters needed to make it
|
* email. It must be called with all the parameters needed to make it
|
||||||
* scan the mail input to find the mail recipient; consult your mailer
|
* scan the mail input to find the mail recipient; consult your mailer
|
||||||
* documentation.
|
* documentation.
|
||||||
*
|
*
|
||||||
@@ -957,18 +950,18 @@ mail
|
|||||||
* If you are running on Windows you should use a Windows sendmail port
|
* If you are running on Windows you should use a Windows sendmail port
|
||||||
* like https://www.glob.com.au/sendmail/ for sending emails.
|
* like https://www.glob.com.au/sendmail/ for sending emails.
|
||||||
*/
|
*/
|
||||||
sendmailpath = "/usr/sbin/sendmail -t"
|
#sendmailpath = "/usr/sbin/sendmail -it"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is the e-mail address from which all the e-mails are to be sent from.
|
* This is the email address from which all the emails are to be sent from.
|
||||||
* It should really exist.
|
* It should really exist.
|
||||||
*/
|
*/
|
||||||
sendfrom = "services@example.com"
|
sendfrom = "services@example.com"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This controls the minimum amount of time a user must wait before sending
|
* This controls the minimum amount of time a user must wait before sending
|
||||||
* another e-mail after they have sent one. It also controls the minimum time
|
* another email after they have sent one. It also controls the minimum time
|
||||||
* a user must wait before they can receive another e-mail.
|
* a user must wait before they can receive another email.
|
||||||
*
|
*
|
||||||
* This feature prevents users from being mail bombed using services and
|
* This feature prevents users from being mail bombed using services and
|
||||||
* it is highly recommended that it be used.
|
* it is highly recommended that it be used.
|
||||||
@@ -979,10 +972,10 @@ mail
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* If set, Anope will not put quotes around the TO: fields
|
* If set, Anope will not put quotes around the TO: fields
|
||||||
* in e-mails.
|
* in emails.
|
||||||
*
|
*
|
||||||
* This directive is optional, and as far as we know, it's only needed
|
* This directive is optional, and as far as we know, it's only needed
|
||||||
* if you are using ESMTP or QMail to send out e-mails.
|
* if you are using ESMTP or QMail to send out emails.
|
||||||
*/
|
*/
|
||||||
#dontquoteaddresses = yes
|
#dontquoteaddresses = yes
|
||||||
|
|
||||||
@@ -1099,6 +1092,22 @@ mail
|
|||||||
#hash = "md5"
|
#hash = "md5"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* db_atheme
|
||||||
|
*
|
||||||
|
* This allows importing databases from Atheme. You should load another database module as
|
||||||
|
* well as this as it can only read Atheme databases not write them.
|
||||||
|
*/
|
||||||
|
#module
|
||||||
|
{
|
||||||
|
name = "db_atheme"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The database name db_atheme should use.
|
||||||
|
*/
|
||||||
|
database = "atheme.db"
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* [RECOMMENDED] db_flatfile
|
* [RECOMMENDED] db_flatfile
|
||||||
*
|
*
|
||||||
@@ -1219,49 +1228,121 @@ module
|
|||||||
/*
|
/*
|
||||||
* [RECOMMENDED] Encryption modules.
|
* [RECOMMENDED] Encryption modules.
|
||||||
*
|
*
|
||||||
* The encryption modules are used when dealing with passwords. This determines how
|
* The encryption modules are used when dealing with passwords. This determines
|
||||||
* the passwords are stored in the databases, and does not add any security as
|
* how the passwords are stored in the databases.
|
||||||
* far as transmitting passwords over the network goes.
|
|
||||||
*
|
|
||||||
* Without any encryption modules loaded users will not be able to authenticate unless
|
|
||||||
* there is another module loaded that provides authentication checking, such as
|
|
||||||
* ldap_authentication or sql_authentication.
|
|
||||||
*
|
|
||||||
* With enc_none, passwords will be stored in plain text, allowing for passwords
|
|
||||||
* to be recovered later but it isn't secure and therefore is not recommended.
|
|
||||||
*
|
|
||||||
* The other encryption modules use one-way encryption, so the passwords can not
|
|
||||||
* be recovered later if those are used.
|
|
||||||
*
|
|
||||||
* The first encryption module loaded is the primary encryption module. All new passwords are
|
|
||||||
* encrypted by this module. Old passwords stored in another encryption method are
|
|
||||||
* automatically re-encrypted by the primary encryption module on next identify.
|
|
||||||
*
|
|
||||||
* enc_md5, enc_sha1, and enc_old are deprecated, and are provided for users
|
|
||||||
* to upgrade to a newer encryption module. Do not use them as the primary
|
|
||||||
* encryption module. They will be removed in a future release.
|
|
||||||
*
|
*
|
||||||
|
* The first encryption module loaded is the primary encryption module. All new
|
||||||
|
* passwords are encrypted by this module. Old passwords encrypted with another
|
||||||
|
* encryption method are automatically re-encrypted with the primary encryption
|
||||||
|
* module the next time the user identifies.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#module { name = "enc_bcrypt" }
|
|
||||||
module { name = "enc_sha256" }
|
|
||||||
|
|
||||||
/*
|
|
||||||
* [DEPRECATED] Deprecated encryption modules. You can only use these for compatibility with
|
|
||||||
* old databases and will need to load one of the above modules as your primary encryption
|
|
||||||
* module.
|
|
||||||
*/
|
|
||||||
#module { name = "enc_md5" }
|
|
||||||
#module { name = "enc_none" }
|
|
||||||
#module { name = "enc_sha1" }
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* enc_old is Anope's previous (broken) MD5 implementation used from 1.4.x to 1.7.16.
|
* enc_sha2
|
||||||
* If your databases were made using that module, load it here to allow conversion to the primary
|
*
|
||||||
* encryption method.
|
* Provides support for encrypting passwords using the HMAC-SHA-2 algorithm. See
|
||||||
|
* https://en.wikipedia.org/wiki/SHA-2 and https://en.wikipedia.org/wiki/HMAC
|
||||||
|
* for more information.
|
||||||
*/
|
*/
|
||||||
#module { name = "enc_old" }
|
module
|
||||||
|
{
|
||||||
|
name = "enc_sha2"
|
||||||
|
|
||||||
|
/** The sub-algorithm to use. Can be set to sha224 for SHA-224, sha256 for
|
||||||
|
* SHA-256, sha284 for SHA-384 or sha512 to SHA-512. Defaults to sha256.
|
||||||
|
*/
|
||||||
|
#algorithm = "sha256"
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* [EXTRA] enc_argon2
|
||||||
|
*
|
||||||
|
* Provides support for encrypting passwords using the Argon2 algorithm. See
|
||||||
|
* https://en.wikipedia.org/wiki/Argon2 for more information.
|
||||||
|
*/
|
||||||
|
#module
|
||||||
|
{
|
||||||
|
name = "enc_argon2"
|
||||||
|
|
||||||
|
/** The sub-algorithm to use. Can be set to argon2d for Argon2d, argon2i for
|
||||||
|
* Argon2i, or argon2id for Argon2id. Defaults to argon2id.
|
||||||
|
*/
|
||||||
|
#algorithm = "argon2id"
|
||||||
|
|
||||||
|
/** The memory hardness in kibibytes of the Argon2 algorithm. Defaults to
|
||||||
|
* 128 mebibytes.
|
||||||
|
*/
|
||||||
|
#memory_cost = 121072
|
||||||
|
|
||||||
|
/** The time hardness (iterations) of the Argon2 algorithm. Defaults to 3.
|
||||||
|
*/
|
||||||
|
#time_cost = 3
|
||||||
|
|
||||||
|
/** The amount of parallel threads to use when encrypting passwords.
|
||||||
|
* Defaults to 1.
|
||||||
|
*/
|
||||||
|
#parallelism = 1
|
||||||
|
|
||||||
|
/** The length in bytes of an Argon2 hash. Defaults to 32. */
|
||||||
|
#hash_length = 32
|
||||||
|
|
||||||
|
/** The length in bytes of an Argon2 salt. Defaults to 32. */
|
||||||
|
#salt_length = 32
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* enc_bcrypt
|
||||||
|
*
|
||||||
|
* Provides support for encrypting passwords using the Bcrypt algorithm. See
|
||||||
|
* https://en.wikipedia.org/wiki/Bcrypt for more information.
|
||||||
|
*/
|
||||||
|
#module
|
||||||
|
{
|
||||||
|
name = "enc_bcrypt"
|
||||||
|
|
||||||
|
/** The number of Bcrypt rounds to perform on passwords. Can be set to any
|
||||||
|
* number between 10 and 32 but higher numbers are more CPU intensive and
|
||||||
|
* may impact performance.
|
||||||
|
*/
|
||||||
|
#rounds = 10
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* [EXTRA] enc_posix
|
||||||
|
*
|
||||||
|
* Provides verify-only support for passwords encrypted using the POSIX crypt()
|
||||||
|
* function. Load this if you are migratign from another services packages such
|
||||||
|
* as Atheme. See https://en.wikipedia.org/wiki/Crypt_(C) for more information.
|
||||||
|
*
|
||||||
|
* You must load another encryption method before this to re-encrypt passwords
|
||||||
|
* with when a user logs in.
|
||||||
|
*/
|
||||||
|
#module { name = "enc_posix" }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* [DEPRECATED] enc_md5, enc_none, enc_old, enc_sha1, enc_sha256
|
||||||
|
*
|
||||||
|
* Provides verify-only support for passwords encrypted using encryption methods
|
||||||
|
* from older versions of Anope. These methods are no longer considered secure
|
||||||
|
* and will be removed in a future version of Anope. Only load them if you are
|
||||||
|
* upgrading from a previous version of Anope that used them.
|
||||||
|
*
|
||||||
|
* enc_md5: Verifies passwords encrypted with the MD5 algorithm
|
||||||
|
* enc_none: Verifies passwords that are not encrypted
|
||||||
|
* enc_sha1: Verifies passwords encrypted with the SHA1 algorithm
|
||||||
|
* enc_old: Verifies passwords encrypted with the broken MD5 algorithm used
|
||||||
|
* before 1.7.17.
|
||||||
|
* enc_sha256: Verifies passwords encrypted with the SHA256 algorithm using a
|
||||||
|
* custom initialisation vector as a salt.
|
||||||
|
*
|
||||||
|
* You must load another encryption method before this to re-encrypt passwords
|
||||||
|
* with when a user logs in.
|
||||||
|
*/
|
||||||
|
#module { name = "enc_md5" }
|
||||||
|
#module { name = "enc_none" }
|
||||||
|
#module { name = "enc_old" }
|
||||||
|
#module { name = "enc_sha1" }
|
||||||
|
#module { name = "enc_sha256" }
|
||||||
|
|
||||||
/* Extra (optional) modules. */
|
/* Extra (optional) modules. */
|
||||||
include
|
include
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ module
|
|||||||
/*
|
/*
|
||||||
* The maximum number of entries a single bad words list can have.
|
* The maximum number of entries a single bad words list can have.
|
||||||
*/
|
*/
|
||||||
badwordsmax = 32
|
badwordsmax = 50
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If set, BotServ will use case sensitive checking for badwords.
|
* If set, BotServ will use case sensitive checking for badwords.
|
||||||
|
|||||||
@@ -76,8 +76,6 @@ module
|
|||||||
* access level or superior
|
* access level or superior
|
||||||
* - cs_private: Hide the channel from ChanServ's LIST command
|
* - cs_private: Hide the channel from ChanServ's LIST command
|
||||||
* - restricted: Kick/ban users who are restricted from the channel
|
* - 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
|
* - 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
|
* - securefounder: Only allow the real founder of the channel to drop the channel, change its
|
||||||
* password, or change the founder or successor
|
* password, or change the founder or successor
|
||||||
@@ -93,10 +91,10 @@ module
|
|||||||
* to be a registered nick, otherwise the channel will be dropped.
|
* to be a registered nick, otherwise the channel will be dropped.
|
||||||
* - none: No defaults
|
* - 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.
|
* 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.
|
* The maximum number of channels which may be registered to a single nickname.
|
||||||
@@ -116,15 +114,15 @@ module
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* The maximum number of entries on a channel's access list.
|
* The maximum number of entries on a channel's access list.
|
||||||
* If not set, the default is 1024. This can be set to 0 for unlimited.
|
* If not set, the default is 1000. This can be set to 0 for unlimited.
|
||||||
*/
|
*/
|
||||||
accessmax = 1024
|
accessmax = 1000
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The length of time ChanServ stays in a channel after kicking a user from a channel they are not
|
* The length of time ChanServ stays in a channel after kicking a user from a channel they are not
|
||||||
* permitted to be in. This only occurs when the user is the only one in the channel.
|
* permitted to be in. This only occurs when the user is the only one in the channel.
|
||||||
*/
|
*/
|
||||||
inhabit = 15s
|
inhabit = 1m
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allow only IRC Operators to use ChanServ.
|
* Allow only IRC Operators to use ChanServ.
|
||||||
@@ -915,7 +913,7 @@ module
|
|||||||
/*
|
/*
|
||||||
* The maximum number of entries on a channel's autokick list.
|
* The maximum number of entries on a channel's autokick list.
|
||||||
*/
|
*/
|
||||||
autokickmax = 32
|
autokickmax = 50
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The default reason for an autokick if none is given.
|
* The default reason for an autokick if none is given.
|
||||||
@@ -1128,7 +1126,7 @@ module
|
|||||||
*
|
*
|
||||||
* This directive is optional.
|
* This directive is optional.
|
||||||
*/
|
*/
|
||||||
max = 32
|
max = 50
|
||||||
}
|
}
|
||||||
command { service = "ChanServ"; name = "MODE"; command = "chanserv/mode"; group = "chanserv/management"; }
|
command { service = "ChanServ"; name = "MODE"; command = "chanserv/mode"; group = "chanserv/management"; }
|
||||||
|
|
||||||
@@ -1249,7 +1247,7 @@ command { service = "ChanServ"; name = "SET NOEXPIRE"; command = "chanserv/saset
|
|||||||
*/
|
*/
|
||||||
module { name = "cs_set_misc" }
|
module { name = "cs_set_misc" }
|
||||||
command { service = "ChanServ"; name = "SET URL"; command = "chanserv/set/misc"; misc_description = _("Associate a URL with the channel"); }
|
command { service = "ChanServ"; name = "SET URL"; command = "chanserv/set/misc"; misc_description = _("Associate a URL with the channel"); }
|
||||||
command { service = "ChanServ"; name = "SET EMAIL"; command = "chanserv/set/misc"; misc_description = _("Associate an E-mail address with the channel"); }
|
command { service = "ChanServ"; name = "SET EMAIL"; command = "chanserv/set/misc"; misc_description = _("Associate an email address with the channel"); }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* cs_status
|
* cs_status
|
||||||
|
|||||||
@@ -113,3 +113,29 @@ command { service = "Global"; name = "HELP"; command = "generic/help"; }
|
|||||||
*/
|
*/
|
||||||
module { name = "gl_global" }
|
module { name = "gl_global" }
|
||||||
command { service = "Global"; name = "GLOBAL"; command = "global/global"; permission = "global/global"; }
|
command { service = "Global"; name = "GLOBAL"; command = "global/global"; permission = "global/global"; }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* gl_queue
|
||||||
|
*
|
||||||
|
* Provides the command global/queue.
|
||||||
|
*
|
||||||
|
* Used for queuing messages to send to every online user.
|
||||||
|
*/
|
||||||
|
module
|
||||||
|
{
|
||||||
|
name = "gl_queue"
|
||||||
|
|
||||||
|
/* The maximum number of messages in a message queue. Defaults to 10. */
|
||||||
|
maxqueue = 10
|
||||||
|
}
|
||||||
|
command { service = "Global"; name = "QUEUE"; command = "global/queue"; permission = "global/queue"; }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* gl_server
|
||||||
|
*
|
||||||
|
* Provides the command global/server.
|
||||||
|
*
|
||||||
|
* Used for sending a message to every online user on a server.
|
||||||
|
*/
|
||||||
|
module { name = "gl_server" }
|
||||||
|
command { service = "Global"; name = "SERVER"; command = "global/server"; permission = "global/server"; }
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ module
|
|||||||
*
|
*
|
||||||
* This directive is optional, but recommended.
|
* This directive is optional, but recommended.
|
||||||
*/
|
*/
|
||||||
senddelay = 3s
|
senddelay = 30s
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -146,7 +146,7 @@ module
|
|||||||
*
|
*
|
||||||
* This directive is optional.
|
* This directive is optional.
|
||||||
*/
|
*/
|
||||||
max = 32
|
max = 50
|
||||||
}
|
}
|
||||||
command { service = "MemoServ"; name = "IGNORE"; command = "memoserv/ignore"; }
|
command { service = "MemoServ"; name = "IGNORE"; command = "memoserv/ignore"; }
|
||||||
|
|
||||||
|
|||||||
+20
-15
@@ -59,7 +59,7 @@ module { name = "help" }
|
|||||||
* SOA record information.
|
* SOA record information.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* E-mail address of the DNS administrator. */
|
/* Email address of the DNS administrator. */
|
||||||
admin = "admin@example.com"
|
admin = "admin@example.com"
|
||||||
|
|
||||||
/* This should be the names of the public facing nameservers serving the records. */
|
/* This should be the names of the public facing nameservers serving the records. */
|
||||||
@@ -254,7 +254,7 @@ module { name = "help" }
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ldap_authentication [EXTRA]
|
* ldap_authentication
|
||||||
*
|
*
|
||||||
* This module allows many commands such as IDENTIFY, RELEASE, RECOVER, GHOST, etc. use
|
* This module allows many commands such as IDENTIFY, RELEASE, RECOVER, GHOST, etc. use
|
||||||
* LDAP to authenticate users. Requires ldap.
|
* LDAP to authenticate users. Requires ldap.
|
||||||
@@ -314,7 +314,7 @@ module { name = "help" }
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ldap_oper [EXTRA]
|
* ldap_oper
|
||||||
*
|
*
|
||||||
* This module dynamically ties users to Anope opertypes when they identify
|
* This module dynamically ties users to Anope opertypes when they identify
|
||||||
* via LDAP group membership. Requires ldap.
|
* via LDAP group membership. Requires ldap.
|
||||||
@@ -580,7 +580,8 @@ module { name = "sasl" }
|
|||||||
name = "ssl_gnutls"
|
name = "ssl_gnutls"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* An optional certificate and key for ssl_gnutls to give to the uplink.
|
* An optional certificate and key for ssl_gnutls to give to the uplink. All
|
||||||
|
* paths are relative to the config directory.
|
||||||
*
|
*
|
||||||
* You can generate your own certificate and key pair by using:
|
* You can generate your own certificate and key pair by using:
|
||||||
*
|
*
|
||||||
@@ -588,8 +589,8 @@ module { name = "sasl" }
|
|||||||
* certtool --generate-self-signed --load-privkey privkey.pem --outfile fullchain.pem
|
* certtool --generate-self-signed --load-privkey privkey.pem --outfile fullchain.pem
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
cert = "data/fullchain.pem"
|
cert = "fullchain.pem"
|
||||||
key = "data/privkey.pem"
|
key = "privkey.pem"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Diffie-Hellman parameters to use when acting as a server. This is only
|
* Diffie-Hellman parameters to use when acting as a server. This is only
|
||||||
@@ -602,7 +603,7 @@ module { name = "sasl" }
|
|||||||
* certtool --generate-dh-params --bits 2048 --outfile dhparams.pem
|
* certtool --generate-dh-params --bits 2048 --outfile dhparams.pem
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
# dhparams = "data/dhparams.pem"
|
#dhparams = "dhparams.pem"
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -620,14 +621,15 @@ module { name = "sasl" }
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* An optional certificate and key for ssl_openssl to give to the uplink.
|
* An optional certificate and key for ssl_openssl to give to the uplink.
|
||||||
|
* All paths are relative to the config directory.
|
||||||
*
|
*
|
||||||
* You can generate your own certificate and key pair by using:
|
* You can generate your own certificate and key pair by using:
|
||||||
*
|
*
|
||||||
* openssl genrsa -out privkey.pem 2048
|
* openssl genrsa -out privkey.pem 2048
|
||||||
* openssl req -new -x509 -key privkey.pem -out fullchain.pem -days 1095
|
* openssl req -new -x509 -key privkey.pem -out fullchain.pem -days 1095
|
||||||
*/
|
*/
|
||||||
cert = "data/fullchain.pem"
|
cert = "fullchain.pem"
|
||||||
key = "data/privkey.pem"
|
key = "privkey.pem"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If you wish to increase security you can disable support for older
|
* If you wish to increase security you can disable support for older
|
||||||
@@ -640,7 +642,7 @@ module { name = "sasl" }
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sql_authentication [EXTRA]
|
* sql_authentication
|
||||||
*
|
*
|
||||||
* This module allows authenticating users against an external SQL database using a custom
|
* This module allows authenticating users against an external SQL database using a custom
|
||||||
* query.
|
* query.
|
||||||
@@ -691,7 +693,7 @@ module { name = "sasl" }
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sql_log [EXTRA]
|
* sql_log
|
||||||
*
|
*
|
||||||
* This module adds an additional target option to log{} blocks
|
* This module adds an additional target option to log{} blocks
|
||||||
* that allows logging Service's logs to SQL. To log to SQL, add
|
* that allows logging Service's logs to SQL. To log to SQL, add
|
||||||
@@ -711,7 +713,7 @@ module { name = "sasl" }
|
|||||||
#module { name = "sql_log" }
|
#module { name = "sql_log" }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sql_oper [EXTRA]
|
* sql_oper
|
||||||
*
|
*
|
||||||
* This module allows granting users services operator privileges and possibly IRC Operator
|
* This module allows granting users services operator privileges and possibly IRC Operator
|
||||||
* privileges based on an external SQL database using a custom query.
|
* privileges based on an external SQL database using a custom query.
|
||||||
@@ -772,8 +774,11 @@ module { name = "sasl" }
|
|||||||
/* Web server to use. */
|
/* Web server to use. */
|
||||||
server = "httpd/main";
|
server = "httpd/main";
|
||||||
|
|
||||||
/* Template to use. */
|
/*
|
||||||
template = "default";
|
* The directory containing the webcpanel templates. This is relative to the
|
||||||
|
* data directory.
|
||||||
|
*/
|
||||||
|
template_dir = "webcpanel/templates/default";
|
||||||
|
|
||||||
/* Page title. */
|
/* Page title. */
|
||||||
title = "Anope IRC Services";
|
title = "Anope IRC Services";
|
||||||
@@ -783,7 +788,7 @@ module { name = "sasl" }
|
|||||||
* xmlrpc
|
* xmlrpc
|
||||||
*
|
*
|
||||||
* Allows remote applications (websites) to execute queries in real time to retrieve data from Anope.
|
* 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
|
#module
|
||||||
{
|
{
|
||||||
|
|||||||
+15
-58
@@ -66,9 +66,9 @@ module
|
|||||||
client = "NickServ"
|
client = "NickServ"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Force users to give an e-mail address when they register a nick.
|
* Requires users to give an email address when they register a nick.
|
||||||
*
|
*
|
||||||
* This directive defaults to "yes" and is recommended to be enabled. This is required if e-mail registration is enabled.
|
* This directive defaults to "yes" and is recommended to be enabled.
|
||||||
*/
|
*/
|
||||||
forceemail = yes
|
forceemail = yes
|
||||||
|
|
||||||
@@ -96,10 +96,8 @@ module
|
|||||||
* option and the killprotect option must be specified with this one
|
* 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
|
* - 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
|
* 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
|
* - 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_email: Hide the nick's email address from NickServ's INFO command
|
||||||
* - hide_mask: Hide the nick's last or current user@host from NickServ's INFO command
|
* - hide_mask: Hide the nick's last or current user@host from NickServ's INFO command
|
||||||
* - hide_status: Hide the nick's services operator access status from NickServ's INFO command
|
* - hide_status: Hide the nick's services operator access status from NickServ's INFO command
|
||||||
* - hide_quit: Hide the nick's last quit message from NickServ's INFO command
|
* - hide_quit: Hide the nick's last quit message from NickServ's INFO command
|
||||||
@@ -112,16 +110,16 @@ module
|
|||||||
* to be enabled as well
|
* to be enabled as well
|
||||||
* - ns_keep_modes: Enables keepmodes, which retains user modes across sessions
|
* - 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.
|
* 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
|
* The minimum length of time between consecutive uses of NickServ's REGISTER command. This
|
||||||
* directive is optional, but recommended. If not set, this restriction will be disabled.
|
* directive is optional, but recommended. If not set, this restriction will be disabled.
|
||||||
*/
|
*/
|
||||||
regdelay = 30s
|
regdelay = 5m
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The length of time before a nick's registration expires.
|
* The length of time before a nick's registration expires.
|
||||||
@@ -211,16 +209,16 @@ module
|
|||||||
/*
|
/*
|
||||||
* The minimum length of passwords
|
* 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
|
* 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. */
|
/* Give it a help command. */
|
||||||
command { service = "NickServ"; name = "HELP"; command = "generic/help"; }
|
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
|
* ns_ajoin
|
||||||
*
|
*
|
||||||
@@ -302,6 +273,7 @@ command { service = "NickServ"; name = "AJOIN"; command = "nickserv/ajoin"; }
|
|||||||
*/
|
*/
|
||||||
module { name = "ns_alist" }
|
module { name = "ns_alist" }
|
||||||
command { service = "NickServ"; name = "ALIST"; command = "nickserv/alist"; }
|
command { service = "NickServ"; name = "ALIST"; command = "nickserv/alist"; }
|
||||||
|
command { service = "NickServ"; name = "ACCESS"; command = "nickserv/alist"; hide = true; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ns_cert
|
* ns_cert
|
||||||
@@ -358,7 +330,7 @@ module
|
|||||||
*
|
*
|
||||||
* This directive is optional, but recommended. If not set or set to 0, no limits will be applied.
|
* This directive is optional, but recommended. If not set or set to 0, no limits will be applied.
|
||||||
*/
|
*/
|
||||||
maxaliases = 16
|
maxaliases = 10
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If set, the NickServ GROUP command won't allow any group changes. This is recommended to
|
* If set, the NickServ GROUP command won't allow any group changes. This is recommended to
|
||||||
@@ -496,7 +468,7 @@ module
|
|||||||
*
|
*
|
||||||
* This directive is optional.
|
* This directive is optional.
|
||||||
*/
|
*/
|
||||||
#nickregdelay = 30s
|
nickregdelay = 15s
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The length of time a user using an unconfirmed account has
|
* The length of time a user using an unconfirmed account has
|
||||||
@@ -530,10 +502,9 @@ command { service = "NickServ"; name = "RESETPASS"; command = "nickserv/resetpas
|
|||||||
* nickserv/set/kill, nickserv/saset/kill - Used for configuring nickname protection.
|
* 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/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/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/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/saset/noexpire - Used for configuring noexpire, which prevents nicks from expiring.
|
||||||
|
* nickserv/set/password, nickserv/saset/password - Used for changing a users password.
|
||||||
*/
|
*/
|
||||||
module
|
module
|
||||||
{
|
{
|
||||||
@@ -574,9 +545,6 @@ command { service = "NickServ"; name = "SASET MESSAGE"; command = "nickserv/sase
|
|||||||
command { service = "NickServ"; name = "SET PASSWORD"; command = "nickserv/set/password"; }
|
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 = "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 = "SET NEVEROP"; command = "nickserv/set/neverop"; }
|
||||||
command { service = "NickServ"; name = "SASET NEVEROP"; command = "nickserv/saset/neverop"; permission = "nickserv/saset/neverop"; }
|
command { service = "NickServ"; name = "SASET NEVEROP"; command = "nickserv/saset/neverop"; permission = "nickserv/saset/neverop"; }
|
||||||
|
|
||||||
@@ -601,17 +569,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 = "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"; }
|
#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
|
* ns_suspend
|
||||||
*
|
*
|
||||||
@@ -666,7 +623,7 @@ command { service = "NickServ"; name = "UPDATE"; command = "nickserv/update"; }
|
|||||||
name = "ns_maxemail"
|
name = "ns_maxemail"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The limit to how many registered nicks can use the same e-mail address. If set to 0 or left
|
* The limit to how many registered nicks can use the same email address. If set to 0 or left
|
||||||
* commented, there will be no limit enforced when registering new accounts or using
|
* commented, there will be no limit enforced when registering new accounts or using
|
||||||
* /msg NickServ SET EMAIL.
|
* /msg NickServ SET EMAIL.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -235,15 +235,15 @@ serverinfo
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* The filename containing the Anope process ID. The path is relative to the
|
* The filename containing the Anope process ID. The path is relative to the
|
||||||
* services root directory.
|
* data directory.
|
||||||
*/
|
*/
|
||||||
pid = "data/anope.pid"
|
pid = "anope.pid"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The filename containing the Message of the Day. The path is relative to the
|
* The filename containing the Message of the Day. The path is relative to the
|
||||||
* services root directory.
|
* config directory.
|
||||||
*/
|
*/
|
||||||
motd = "conf/motd.txt"
|
motd = "motd.txt"
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -283,25 +283,26 @@ networkinfo
|
|||||||
/*
|
/*
|
||||||
* Set this to the maximum allowed nick length on your network.
|
* Set this to the maximum allowed nick length on your network.
|
||||||
* Be sure to set this correctly, as setting this wrong can result in
|
* 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.
|
/* Set this to the maximum allowed ident length on your network.
|
||||||
* Be sure to set this correctly, as setting this wrong can result in
|
* 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.
|
/* Set this to the maximum allowed hostname length on your network.
|
||||||
* Be sure to set this correctly, as setting this wrong can result in
|
* 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.
|
/* 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).
|
/* The maximum number of list modes settable on a channel (such as b, e, I).
|
||||||
* Comment out or set to 0 to disable.
|
* Comment out or set to 0 to disable.
|
||||||
|
|||||||
+53
-1
@@ -1,7 +1,59 @@
|
|||||||
|
Anope Version 2.1.4
|
||||||
|
-------------------
|
||||||
|
Added a check for a non-deprecated encryption module on start.
|
||||||
|
Added a way for protocol modules to report an error to the uplink.
|
||||||
|
Added more account settings to the webcpanel.
|
||||||
|
Added self-test functionality for all encryption modules.
|
||||||
|
Added support for challenge authentication on InspIRCd.
|
||||||
|
Added support for importing databases from Atheme.
|
||||||
|
Added support for sending client tags on UnrealIRCd.
|
||||||
|
Added support for the InspIRCd 1206 (v4) protocol.
|
||||||
|
Added the --nopid option to disable writing a pid file.
|
||||||
|
Added the enc_argon2 module to encrypt passwords with Argon2.
|
||||||
|
Added the enc_sha2 module to encrypt passwords with HMAC-SHA-2.
|
||||||
|
Added the global/queue command for queueing multi-line messages.
|
||||||
|
Added the global/server command for sending messages to an individual server.
|
||||||
|
Added the PASSWORD category to operserv/stats to view password encryption methods.
|
||||||
|
Added the verify-only enc_posix module to validate passwords from Atheme that were encrypted with Argon2.
|
||||||
|
Changed nickserv/drop to use confirmation codes to confirm a nickname drop.
|
||||||
|
Changed various paths to be relative to the data and config directories.
|
||||||
|
Converted some IRCDProto member functions to variables.
|
||||||
|
Converted the enc_md5, enc_none, enc_old, enc_sha1, and enc_sha256 modules to be verify-only.
|
||||||
|
Deduplicated page headers and footers in the webcpanel templates.
|
||||||
|
Deprecated the enc_sha256 module.
|
||||||
|
Fixed inconsistent spelling/casing of email, vhost, and vident.
|
||||||
|
Fixed various bugs in the inspircd module.
|
||||||
|
Improved portability of email sending.
|
||||||
|
Improved protocol debug messages.
|
||||||
|
Improved the performance and reliability of internal conversion logic.
|
||||||
|
Improved the randomness of randomly generated numbers.
|
||||||
|
Refactored the enc_bcrypt module and exposed it as an encryption context.
|
||||||
|
Removed several duplicate translation strings.
|
||||||
|
Replaced the custom MD5 implementation in enc_md5 with a vendored one.
|
||||||
|
Replaced the custom SHA256 implementation in enc_sha256 with a vendored one.
|
||||||
|
The ldap_authentication, ldap_oper, sql_authentication, sql_log, and sql_oper modules are now always enabled.
|
||||||
|
|
||||||
|
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
|
Anope Version 2.1.2
|
||||||
-------------------
|
-------------------
|
||||||
Bumped the minimum OpenSSL version to 1.1.0.
|
Bumped the minimum OpenSSL version to 1.1.0.
|
||||||
Bumped the minumum GnuTLS version to 3.0.0.
|
Bumped the minimum GnuTLS version to 3.0.0.
|
||||||
Disabled SSLv3 support in the m_ssl_openssl module.
|
Disabled SSLv3 support in the m_ssl_openssl module.
|
||||||
Modernized mutex and thread code to use Modern C++.
|
Modernized mutex and thread code to use Modern C++.
|
||||||
Normalised the program exit codes.
|
Normalised the program exit codes.
|
||||||
|
|||||||
+45
-4
@@ -1,9 +1,50 @@
|
|||||||
|
Anope Version 2.1.4
|
||||||
|
-------------------
|
||||||
|
Added the db_atheme module.
|
||||||
|
Added the enc_argon2 module.
|
||||||
|
Added the enc_posix module.
|
||||||
|
Added the enc_sha2 module.
|
||||||
|
Added the gl_queue module.
|
||||||
|
Added the gl_server module.
|
||||||
|
Added the global/queue operator privilege.
|
||||||
|
Added the global/server operator privilege.
|
||||||
|
Changed serverinfo:motd to be relative to the config directory.
|
||||||
|
Changed serverinfo:pid to be relative to the data directory.
|
||||||
|
Changed the default value of mail:sendmailpath to "/usr/sbin/sendmail -it".
|
||||||
|
Changed the default value of module:accessmax for the chanserv module to 1000.
|
||||||
|
Changed the default value of module:inhabit for the chanserv module to 1 minute.
|
||||||
|
Changed the default value of module:max for the cs_mode module to 50.
|
||||||
|
Changed the default value of module:max for the ms_ignore module to 50.
|
||||||
|
Removed options:seed.
|
||||||
|
Replaced module:template for the webcpanel module with module:template_dir.
|
||||||
|
|
||||||
|
|
||||||
|
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
|
Anope Version 2.1.2
|
||||||
-------------------
|
-------------------
|
||||||
Added module:tlsv10 to m_ssl_openssl for configuring whether TLSv1.0 is usable (defaults to no).
|
Added module:tlsv10 to the ssl_openssl module 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:tlsv11 to the ssl_openssl module for configuring whether TLSv1.1 is usable (defaults to yes).
|
||||||
Added module:tlsv12 to m_ssl_openssl for configuring whether TLSv1.0 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 m_ssl_openssl.
|
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.
|
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
|
Anope Version 2.1.1
|
||||||
|
|||||||
+1
-1
@@ -33,7 +33,7 @@ Anope Multi Language Support
|
|||||||
po files (especially on Windows).
|
po files (especially on Windows).
|
||||||
|
|
||||||
If you have finished a language file translation and you want others to use it, please send it to team@anope.org
|
If you have finished a language file translation and you want others to use it, please send it to team@anope.org
|
||||||
(don't forget to mention clearly your (nick)name, your e-mail and the language name). You'll of course get full credit for it.
|
(don't forget to mention clearly your (nick)name, your email and the language name). You'll of course get full credit for it.
|
||||||
|
|
||||||
NOTE: There is no guarantee we will use your work so please do not be offended if we say no thanks.
|
NOTE: There is no guarantee we will use your work so please do not be offended if we say no thanks.
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -98,7 +98,7 @@ public:
|
|||||||
NickCore *GetAccount() const;
|
NickCore *GetAccount() const;
|
||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override;
|
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;
|
static const unsigned int MAX_DEPTH = 4;
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ public:
|
|||||||
* @param nc The account
|
* @param nc The account
|
||||||
* @param next Next channel to check if any
|
* @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.
|
/** Check if this access entry has the given privilege.
|
||||||
* @param name The privilege name
|
* @param name The privilege name
|
||||||
|
|||||||
+25
-74
@@ -17,8 +17,8 @@
|
|||||||
#include "memo.h"
|
#include "memo.h"
|
||||||
#include "base.h"
|
#include "base.h"
|
||||||
|
|
||||||
typedef Anope::hash_map<NickAlias *> nickalias_map;
|
typedef Anope::unordered_map<NickAlias *> nickalias_map;
|
||||||
typedef Anope::hash_map<NickCore *> nickcore_map;
|
typedef Anope::unordered_map<NickCore *> nickcore_map;
|
||||||
typedef std::unordered_map<uint64_t, NickCore *> nickcoreid_map;
|
typedef std::unordered_map<uint64_t, NickCore *> nickcoreid_map;
|
||||||
|
|
||||||
extern CoreExport Serialize::Checker<nickalias_map> NickAliasList;
|
extern CoreExport Serialize::Checker<nickalias_map> NickAliasList;
|
||||||
@@ -33,7 +33,7 @@ class CoreExport NickAlias final
|
|||||||
, public Extensible
|
, public Extensible
|
||||||
{
|
{
|
||||||
Anope::string vhost_ident, vhost_host, vhost_creator;
|
Anope::string vhost_ident, vhost_host, vhost_creator;
|
||||||
time_t vhost_created;
|
time_t vhost_created = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Anope::string nick;
|
Anope::string nick;
|
||||||
@@ -43,8 +43,9 @@ public:
|
|||||||
Anope::string last_usermask;
|
Anope::string last_usermask;
|
||||||
/* Last uncloaked usermask, requires nickserv/auspex to see */
|
/* Last uncloaked usermask, requires nickserv/auspex to see */
|
||||||
Anope::string last_realhost;
|
Anope::string last_realhost;
|
||||||
time_t time_registered;
|
time_t time_registered = Anope::CurTime;
|
||||||
time_t last_seen;
|
time_t last_seen = Anope::CurTime;
|
||||||
|
|
||||||
/* Account this nick is tied to. Multiple nicks can be tied to a single account. */
|
/* Account this nick is tied to. Multiple nicks can be tied to a single account. */
|
||||||
Serialize::Reference<NickCore> nc;
|
Serialize::Reference<NickCore> nc;
|
||||||
|
|
||||||
@@ -56,7 +57,7 @@ public:
|
|||||||
~NickAlias();
|
~NickAlias();
|
||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override;
|
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
|
/** Set a vhost for the user
|
||||||
* @param ident The ident
|
* @param ident The ident
|
||||||
@@ -64,36 +65,41 @@ public:
|
|||||||
* @param creator Who created the vhost
|
* @param creator Who created the vhost
|
||||||
* @param time When the vhost was created
|
* @param time When the vhost was created
|
||||||
*/
|
*/
|
||||||
void SetVhost(const Anope::string &ident, const Anope::string &host, const Anope::string &creator, time_t created = Anope::CurTime);
|
void SetVHost(const Anope::string &ident, const Anope::string &host, const Anope::string &creator, time_t created = Anope::CurTime);
|
||||||
|
|
||||||
/** Remove a users vhost
|
/** Remove a users vhost
|
||||||
**/
|
**/
|
||||||
void RemoveVhost();
|
void RemoveVHost();
|
||||||
|
|
||||||
/** Check if the user has a vhost
|
/** Check if the user has a vhost
|
||||||
* @return true or false
|
* @return true or false
|
||||||
*/
|
*/
|
||||||
bool HasVhost() const;
|
bool HasVHost() const;
|
||||||
|
|
||||||
/** Retrieve the vhost ident
|
/** Retrieve the vhost ident
|
||||||
* @return the ident
|
* @return the ident
|
||||||
*/
|
*/
|
||||||
const Anope::string &GetVhostIdent() const;
|
const Anope::string &GetVHostIdent() const;
|
||||||
|
|
||||||
/** Retrieve the vhost host
|
/** Retrieve the vhost host
|
||||||
* @return the host
|
* @return the host
|
||||||
*/
|
*/
|
||||||
const Anope::string &GetVhostHost() const;
|
const Anope::string &GetVHostHost() const;
|
||||||
|
|
||||||
|
/** Retrieve the vhost mask
|
||||||
|
* @param the mask
|
||||||
|
*/
|
||||||
|
Anope::string GetVHostMask() const;
|
||||||
|
|
||||||
/** Retrieve the vhost creator
|
/** Retrieve the vhost creator
|
||||||
* @return the creator
|
* @return the creator
|
||||||
*/
|
*/
|
||||||
const Anope::string &GetVhostCreator() const;
|
const Anope::string &GetVHostCreator() const;
|
||||||
|
|
||||||
/** Retrieve when the vhost was created
|
/** Retrieve when the vhost was created
|
||||||
* @return the time it was created
|
* @return the time it was created
|
||||||
*/
|
*/
|
||||||
time_t GetVhostCreated() const;
|
time_t GetVHostCreated() const;
|
||||||
|
|
||||||
/** Finds a registered nick
|
/** Finds a registered nick
|
||||||
* @param nick The nick to lookup
|
* @param nick The nick to lookup
|
||||||
@@ -122,9 +128,8 @@ public:
|
|||||||
Anope::string email;
|
Anope::string email;
|
||||||
/* Locale name of the language of the user. Empty means default language */
|
/* Locale name of the language of the user. Empty means default language */
|
||||||
Anope::string language;
|
Anope::string language;
|
||||||
/* Access list, contains user@host masks of users who get certain privileges based
|
/* Last time an email was sent to this user */
|
||||||
* on if NI_SECURE is set and what (if any) kill protection is enabled. */
|
time_t lastmail = 0;
|
||||||
std::vector<Anope::string> access;
|
|
||||||
MemoInfo memos;
|
MemoInfo memos;
|
||||||
std::map<Anope::string, Anope::string> last_modes;
|
std::map<Anope::string, Anope::string> last_modes;
|
||||||
|
|
||||||
@@ -134,14 +139,12 @@ public:
|
|||||||
Serialize::Checker<std::vector<NickAlias *> > aliases;
|
Serialize::Checker<std::vector<NickAlias *> > aliases;
|
||||||
|
|
||||||
/* Set if this user is a services operator. o->ot must exist. */
|
/* Set if this user is a services operator. o->ot must exist. */
|
||||||
Oper *o;
|
Oper *o = nullptr;
|
||||||
|
|
||||||
/* Unsaved data */
|
/* Unsaved data */
|
||||||
|
|
||||||
/* Number of channels registered by this account */
|
/* Number of channels registered by this account */
|
||||||
uint16_t channelcount;
|
uint16_t channelcount = 0;
|
||||||
/* Last time an email was sent to this user */
|
|
||||||
time_t lastmail;
|
|
||||||
/* Users online now logged into this account */
|
/* Users online now logged into this account */
|
||||||
std::list<User *> users;
|
std::list<User *> users;
|
||||||
|
|
||||||
@@ -153,7 +156,7 @@ public:
|
|||||||
~NickCore();
|
~NickCore();
|
||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override;
|
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
|
/** Changes the display for this account
|
||||||
* @param na The new display, must be grouped to this account.
|
* @param na The new display, must be grouped to this account.
|
||||||
@@ -165,66 +168,14 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual bool IsServicesOper() const;
|
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 */
|
/** Retrieves the account id for this user */
|
||||||
uint64_t GetId();
|
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
|
/** Finds an account
|
||||||
* @param nick The account name to find
|
* @param nick The account name to find
|
||||||
* @return The account, if it exists
|
* @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 AddChannelReference(ChannelInfo *ci);
|
||||||
void RemoveChannelReference(ChannelInfo *ci);
|
void RemoveChannelReference(ChannelInfo *ci);
|
||||||
|
|||||||
+66
-78
@@ -39,6 +39,7 @@ namespace Anope
|
|||||||
typedef std::string::reverse_iterator reverse_iterator;
|
typedef std::string::reverse_iterator reverse_iterator;
|
||||||
typedef std::string::const_reverse_iterator const_reverse_iterator;
|
typedef std::string::const_reverse_iterator const_reverse_iterator;
|
||||||
typedef std::string::size_type size_type;
|
typedef std::string::size_type size_type;
|
||||||
|
typedef std::string::value_type value_type;
|
||||||
static const size_type npos = static_cast<size_type>(-1);
|
static const size_type npos = static_cast<size_type>(-1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -140,8 +141,8 @@ namespace Anope
|
|||||||
*/
|
*/
|
||||||
inline void push_back(char c) { return this->_string.push_back(c); }
|
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 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 char *s, size_t n) { this->_string.append(s, n); return *this; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resizes the string content to n characters.
|
* Resizes the string content to n characters.
|
||||||
@@ -159,21 +160,21 @@ namespace Anope
|
|||||||
* Trim leading and trailing white spaces from the string.
|
* 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)
|
while (!this->_string.empty() && what.find(this->_string[0]) != Anope::string::npos)
|
||||||
this->_string.erase(this->_string.begin());
|
this->_string.erase(this->_string.begin());
|
||||||
return *this;
|
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)
|
while (!this->_string.empty() && what.find(this->_string[this->_string.length() - 1]) != Anope::string::npos)
|
||||||
this->_string.erase(this->_string.length() - 1);
|
this->_string.erase(this->_string.length() - 1);
|
||||||
return *this;
|
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->ltrim(what);
|
||||||
this->rtrim(what);
|
this->rtrim(what);
|
||||||
@@ -210,9 +211,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(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 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) 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 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 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.
|
* Determine if string consists of only numbers.
|
||||||
@@ -343,7 +344,7 @@ namespace Anope
|
|||||||
using multimap = std::multimap<string, T, ci::less>;
|
using multimap = std::multimap<string, T, ci::less>;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
using hash_map = std::unordered_map<string, T, hash_ci, compare>;
|
using unordered_map = std::unordered_map<string, T, hash_ci, compare>;
|
||||||
|
|
||||||
#ifndef REPRODUCIBLE_BUILD
|
#ifndef REPRODUCIBLE_BUILD
|
||||||
static const char *const compiled = __TIME__ " " __DATE__;
|
static const char *const compiled = __TIME__ " " __DATE__;
|
||||||
@@ -366,6 +367,7 @@ namespace Anope
|
|||||||
* Use this unless you need very specific time checks
|
* Use this unless you need very specific time checks
|
||||||
*/
|
*/
|
||||||
extern CoreExport time_t CurTime;
|
extern CoreExport time_t CurTime;
|
||||||
|
extern CoreExport long long CurTimeNs;
|
||||||
|
|
||||||
/** The debug level we are running at.
|
/** The debug level we are running at.
|
||||||
*/
|
*/
|
||||||
@@ -373,7 +375,7 @@ namespace Anope
|
|||||||
|
|
||||||
/** Other command line options.
|
/** Other command line options.
|
||||||
*/
|
*/
|
||||||
extern CoreExport bool ReadOnly, NoFork, NoThird, NoExpire, ProtocolDebug;
|
extern CoreExport bool ReadOnly, NoFork, NoThird, NoPID, NoExpire, ProtocolDebug;
|
||||||
|
|
||||||
/** The root of the Anope installation. Usually ~/anope
|
/** The root of the Anope installation. Usually ~/anope
|
||||||
*/
|
*/
|
||||||
@@ -469,7 +471,7 @@ namespace Anope
|
|||||||
* @param src The source string to encrypt
|
* @param src The source string to encrypt
|
||||||
* @param dest The destination where the encrypted string is placed
|
* @param dest The destination where the encrypted string is placed
|
||||||
*/
|
*/
|
||||||
extern CoreExport void Encrypt(const Anope::string &src, Anope::string &dest);
|
extern CoreExport bool Encrypt(const Anope::string &src, Anope::string &dest);
|
||||||
|
|
||||||
/** Hashes a buffer with SipHash-2-4
|
/** Hashes a buffer with SipHash-2-4
|
||||||
* @param src The start of the buffer to hash
|
* @param src The start of the buffer to hash
|
||||||
@@ -495,7 +497,7 @@ namespace Anope
|
|||||||
/** Return the last error, uses errno/GetLastError() to determine this
|
/** Return the last error, uses errno/GetLastError() to determine this
|
||||||
* @return An error message
|
* @return An error message
|
||||||
*/
|
*/
|
||||||
extern CoreExport const string LastError();
|
extern CoreExport string LastError();
|
||||||
|
|
||||||
/** Determines if a path is a file
|
/** Determines if a path is a file
|
||||||
*/
|
*/
|
||||||
@@ -534,10 +536,18 @@ namespace Anope
|
|||||||
*/
|
*/
|
||||||
extern CoreExport Anope::string NormalizeBuffer(const Anope::string &);
|
extern CoreExport Anope::string NormalizeBuffer(const Anope::string &);
|
||||||
|
|
||||||
/** Main processing routine. Parses the message and takes the appropriate action.
|
/** Parses a raw message from the uplink and calls its command handler.
|
||||||
* @param Raw message from the uplink
|
* @param message Raw message from the uplink
|
||||||
*/
|
*/
|
||||||
extern void Process(const Anope::string &);
|
extern void Process(const Anope::string &message);
|
||||||
|
|
||||||
|
/** Calls the command handler for an already parsed message.
|
||||||
|
* @param source Source of the message.
|
||||||
|
* @param command Command name.
|
||||||
|
* @param params Any extra parameters.
|
||||||
|
* @param tags IRCv3 message tags.
|
||||||
|
*/
|
||||||
|
extern CoreExport void ProcessInternal(MessageSource &src, const Anope::string &command, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> & tags);
|
||||||
|
|
||||||
/** Does a blocking dns query and returns the first IP.
|
/** Does a blocking dns query and returns the first IP.
|
||||||
* @param host host to look up
|
* @param host host to look up
|
||||||
@@ -557,6 +567,40 @@ namespace Anope
|
|||||||
* @param len The length of the string returned
|
* @param len The length of the string returned
|
||||||
*/
|
*/
|
||||||
extern CoreExport Anope::string Random(size_t len);
|
extern CoreExport Anope::string Random(size_t len);
|
||||||
|
|
||||||
|
/** Generate a random number. */
|
||||||
|
extern CoreExport int RandomNumber();
|
||||||
|
|
||||||
|
/** 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);
|
||||||
|
|
||||||
|
/** Update the current time. */
|
||||||
|
extern CoreExport void UpdateTime();
|
||||||
|
|
||||||
|
/** Expands a path fragment that is relative to the base directory.
|
||||||
|
* @param base The base directory that it is relative to.
|
||||||
|
* @param fragment The fragment to expand.
|
||||||
|
*/
|
||||||
|
extern CoreExport Anope::string Expand(const Anope::string &base, const Anope::string &fragment);
|
||||||
|
|
||||||
|
/** Expands a config path. */
|
||||||
|
inline auto ExpandConfig(const Anope::string &path) { return Expand(ConfigDir, path); }
|
||||||
|
|
||||||
|
/** Expands a data path. */
|
||||||
|
inline auto ExpandData(const Anope::string &path) { return Expand(DataDir, path); }
|
||||||
|
|
||||||
|
/** Expands a locale path. */
|
||||||
|
inline auto ExpandLocale(const Anope::string &path) { return Expand(LocaleDir, path); }
|
||||||
|
|
||||||
|
/** Expands a log path. */
|
||||||
|
inline auto ExpandLog(const Anope::string &path) { return Expand(LogDir, path); }
|
||||||
|
|
||||||
|
/** Expands a module path. */
|
||||||
|
inline auto ExpandModule(const Anope::string &path) { return Expand(ModuleDir, path); }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** sepstream allows for splitting token separated lists.
|
/** sepstream allows for splitting token separated lists.
|
||||||
@@ -584,6 +628,9 @@ public:
|
|||||||
*/
|
*/
|
||||||
sepstream(const Anope::string &source, char separator, bool allowempty = false);
|
sepstream(const Anope::string &source, char separator, bool allowempty = false);
|
||||||
|
|
||||||
|
/** Retrieves the underlying string. */
|
||||||
|
const auto &GetString() const { return tokens; }
|
||||||
|
|
||||||
/** Fetch the next token from the stream
|
/** Fetch the next token from the stream
|
||||||
* @param token The next token from the stream is placed here
|
* @param token The next token from the stream is placed here
|
||||||
* @return True if tokens still remain, false if there are none left
|
* @return True if tokens still remain, false if there are none left
|
||||||
@@ -600,7 +647,7 @@ public:
|
|||||||
/** Gets every token from this stream
|
/** Gets every token from this stream
|
||||||
* @param token Tokens are pushed back here
|
* @param token Tokens are pushed back here
|
||||||
*/
|
*/
|
||||||
template<typename T> void GetTokens(T& token)
|
template<typename T> void GetTokens(T &token)
|
||||||
{
|
{
|
||||||
token.clear();
|
token.clear();
|
||||||
Anope::string t;
|
Anope::string t;
|
||||||
@@ -623,7 +670,7 @@ public:
|
|||||||
/** Fetch the entire remaining stream, without tokenizing
|
/** Fetch the entire remaining stream, without tokenizing
|
||||||
* @return The remaining part of the stream
|
* @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
|
/** Returns true if the end of the stream has been reached
|
||||||
* @return True if the end of the stream has been reached, otherwise false
|
* @return True if the end of the stream has been reached, otherwise false
|
||||||
@@ -717,67 +764,6 @@ public:
|
|||||||
virtual ~ModuleException() noexcept = default;
|
virtual ~ModuleException() noexcept = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CoreExport ConvertException final
|
|
||||||
: public CoreException
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
ConvertException(const Anope::string &reason = "") : CoreException(reason) { }
|
|
||||||
|
|
||||||
virtual ~ConvertException() noexcept = default;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** Convert something to a string
|
|
||||||
*/
|
|
||||||
template<typename T> inline Anope::string stringify(const T &x)
|
|
||||||
{
|
|
||||||
std::ostringstream stream;
|
|
||||||
|
|
||||||
if (!(stream << x))
|
|
||||||
throw ConvertException("Stringify fail");
|
|
||||||
|
|
||||||
return stream.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T> inline void convert(const Anope::string &s, T &x, Anope::string &leftover, bool failIfLeftoverChars = true)
|
|
||||||
{
|
|
||||||
leftover.clear();
|
|
||||||
std::istringstream i(s.str());
|
|
||||||
char c;
|
|
||||||
if (!(i >> x))
|
|
||||||
throw ConvertException("Convert fail");
|
|
||||||
if (failIfLeftoverChars)
|
|
||||||
{
|
|
||||||
if (i.get(c))
|
|
||||||
throw ConvertException("Convert fail");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::string left;
|
|
||||||
getline(i, left);
|
|
||||||
leftover = left;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T> inline void convert(const Anope::string &s, T &x, bool failIfLeftoverChars = true)
|
|
||||||
{
|
|
||||||
Anope::string Unused;
|
|
||||||
convert(s, x, Unused, failIfLeftoverChars);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T> inline T convertTo(const Anope::string &s, Anope::string &leftover, bool failIfLeftoverChars = true)
|
|
||||||
{
|
|
||||||
T x;
|
|
||||||
convert(s, x, leftover, failIfLeftoverChars);
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T> inline T convertTo(const Anope::string &s, bool failIfLeftoverChars = true)
|
|
||||||
{
|
|
||||||
T x;
|
|
||||||
convert(s, x, failIfLeftoverChars);
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Casts to be used instead of dynamic_cast, this uses dynamic_cast
|
/** Casts to be used instead of dynamic_cast, this uses dynamic_cast
|
||||||
* for debug builds and static_cast on release builds
|
* for debug builds and static_cast on release builds
|
||||||
* to speed up the program because dynamic_cast relies on RTTI.
|
* to speed up the program because dynamic_cast relies on RTTI.
|
||||||
@@ -797,3 +783,5 @@ template<typename T, typename O> inline T anope_dynamic_static_cast(O ptr)
|
|||||||
return static_cast<T>(ptr);
|
return static_cast<T>(ptr);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "convert.h"
|
||||||
|
|||||||
+2
-2
@@ -103,14 +103,14 @@ public:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline T* operator->()
|
inline T *operator->()
|
||||||
{
|
{
|
||||||
if (operator bool())
|
if (operator bool())
|
||||||
return this->ref;
|
return this->ref;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline T* operator*()
|
inline T *operator*()
|
||||||
{
|
{
|
||||||
if (operator bool())
|
if (operator bool())
|
||||||
return this->ref;
|
return this->ref;
|
||||||
|
|||||||
+5
-4
@@ -56,7 +56,7 @@ public:
|
|||||||
virtual ~BotInfo();
|
virtual ~BotInfo();
|
||||||
|
|
||||||
void Serialize(Serialize::Data &data) const;
|
void Serialize(Serialize::Data &data) const;
|
||||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
|
||||||
|
|
||||||
void GenerateUID();
|
void GenerateUID();
|
||||||
|
|
||||||
@@ -108,8 +108,9 @@ public:
|
|||||||
/** Called when a user messages this bot
|
/** Called when a user messages this bot
|
||||||
* @param u The user
|
* @param u The user
|
||||||
* @param message The users' message
|
* @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
|
/** Link a command name to a command in services
|
||||||
* @param cname The command name
|
* @param cname The command name
|
||||||
@@ -117,7 +118,7 @@ public:
|
|||||||
* @param permission Permission required to execute the command, if any
|
* @param permission Permission required to execute the command, if any
|
||||||
* @return The commandinfo for the newly created command
|
* @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
|
/** Get command info for a command
|
||||||
* @param cname The command name
|
* @param cname The command name
|
||||||
@@ -130,5 +131,5 @@ public:
|
|||||||
* @param nick_only True to only look by nick, and not by UID
|
* @param nick_only True to only look by nick, and not by UID
|
||||||
* @return The bot, if it exists
|
* @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);
|
||||||
};
|
};
|
||||||
|
|||||||
+3
-3
@@ -13,7 +13,7 @@
|
|||||||
#include "modes.h"
|
#include "modes.h"
|
||||||
#include "serialize.h"
|
#include "serialize.h"
|
||||||
|
|
||||||
typedef Anope::hash_map<Channel *> channel_map;
|
typedef Anope::unordered_map<Channel *> channel_map;
|
||||||
|
|
||||||
extern CoreExport channel_map ChannelList;
|
extern CoreExport channel_map ChannelList;
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ public:
|
|||||||
* @param status The status to give the user, if any
|
* @param status The status to give the user, if any
|
||||||
* @return The UserContainer for the user
|
* @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
|
/** Remove a user internally from the channel
|
||||||
* @param u The user
|
* @param u The user
|
||||||
@@ -302,7 +302,7 @@ public:
|
|||||||
* @param name The channel to find
|
* @param name The channel to find
|
||||||
* @return The channel, if found
|
* @return The channel, if found
|
||||||
*/
|
*/
|
||||||
static Channel* Find(const Anope::string &name);
|
static Channel *Find(const Anope::string &name);
|
||||||
|
|
||||||
/** Finds or creates a channel
|
/** Finds or creates a channel
|
||||||
* @param name The channel name
|
* @param name The channel name
|
||||||
|
|||||||
+6
-3
@@ -44,6 +44,7 @@ struct CoreExport CommandReply
|
|||||||
{
|
{
|
||||||
virtual ~CommandReply() = default;
|
virtual ~CommandReply() = default;
|
||||||
virtual void SendMessage(BotInfo *source, const Anope::string &msg) = 0;
|
virtual void SendMessage(BotInfo *source, const Anope::string &msg) = 0;
|
||||||
|
virtual void SendMessage(CommandSource &source, const Anope::string &msg);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* The source for a command */
|
/* The source for a command */
|
||||||
@@ -61,15 +62,17 @@ public:
|
|||||||
/* Where the reply should go */
|
/* Where the reply should go */
|
||||||
CommandReply *reply;
|
CommandReply *reply;
|
||||||
/* Channel the command was executed on (fantasy) */
|
/* Channel the command was executed on (fantasy) */
|
||||||
Reference<Channel> c;
|
Reference<Channel> c = nullptr;
|
||||||
/* The service this command is on */
|
/* The service this command is on */
|
||||||
Reference<BotInfo> service;
|
Reference<BotInfo> service;
|
||||||
/* The actual name of the command being executed */
|
/* The actual name of the command being executed */
|
||||||
Anope::string command;
|
Anope::string command;
|
||||||
/* The permission of the command being executed */
|
/* The permission of the command being executed */
|
||||||
Anope::string permission;
|
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;
|
const Anope::string &GetNick() const;
|
||||||
User *GetUser();
|
User *GetUser();
|
||||||
@@ -179,5 +182,5 @@ public:
|
|||||||
* @param name If found, is set to the command name, eg REGISTER
|
* @param name If found, is set to the command name, eg REGISTER
|
||||||
* @return true if the given command service exists
|
* @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);
|
||||||
};
|
};
|
||||||
|
|||||||
+5
-20
@@ -15,7 +15,6 @@
|
|||||||
#include "regchannel.h"
|
#include "regchannel.h"
|
||||||
#include "users.h"
|
#include "users.h"
|
||||||
#include "opertype.h"
|
#include "opertype.h"
|
||||||
#include <stack>
|
|
||||||
|
|
||||||
namespace Configuration
|
namespace Configuration
|
||||||
{
|
{
|
||||||
@@ -42,33 +41,19 @@ namespace Configuration
|
|||||||
Block(const Anope::string &);
|
Block(const Anope::string &);
|
||||||
const Anope::string &GetName() const;
|
const Anope::string &GetName() const;
|
||||||
int CountBlock(const Anope::string &name) const;
|
int CountBlock(const Anope::string &name) const;
|
||||||
const Block* GetBlock(const Anope::string &name, int num = 0) const;
|
const Block *GetBlock(const Anope::string &name, int num = 0) const;
|
||||||
Block* GetMutableBlock(const Anope::string &name, int num = 0);
|
Block *GetMutableBlock(const Anope::string &name, int num = 0);
|
||||||
|
|
||||||
template<typename T> inline T Get(const Anope::string &tag) const
|
template<typename T> T Get(const Anope::string &tag, const Anope::string &def = "") const
|
||||||
{
|
{
|
||||||
return this->Get<T>(tag, "");
|
return Anope::TryConvert<T>(this->Get<const Anope::string>(tag, def)).value_or(T());
|
||||||
}
|
|
||||||
/* 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
|
|
||||||
{
|
|
||||||
const Anope::string &value = this->Get<const Anope::string>(tag, def);
|
|
||||||
if (!value.empty())
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return convertTo<T>(value);
|
|
||||||
}
|
|
||||||
catch (const ConvertException &) { }
|
|
||||||
return T();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Set(const Anope::string &tag, const Anope::string &value);
|
bool Set(const Anope::string &tag, const Anope::string &value);
|
||||||
const item_map &GetItems() const;
|
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 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;
|
template<> CoreExport bool Block::Get(const Anope::string &tag, const Anope::string &def) const;
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -0,0 +1,132 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* (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
|
||||||
|
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
|
namespace Anope
|
||||||
|
{
|
||||||
|
/** Attempts to convert a string to any type.
|
||||||
|
* @param in The value to convert.
|
||||||
|
* @param leftover If non-nullptr then the location to store leftover data.
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
inline std::optional<T> TryConvert(const Anope::string &in, Anope::string *leftover = nullptr)
|
||||||
|
{
|
||||||
|
std::istringstream tmp(in.str());
|
||||||
|
T out;
|
||||||
|
if (!(tmp >> out))
|
||||||
|
return std::nullopt;
|
||||||
|
|
||||||
|
if (leftover)
|
||||||
|
{
|
||||||
|
leftover->clear();
|
||||||
|
std::getline(tmp, leftover->str());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
char extra;
|
||||||
|
if (tmp >> extra)
|
||||||
|
return std::nullopt;
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Converts a string to any type.
|
||||||
|
* @param in The value to convert.
|
||||||
|
* @param def The default to use if the conversion failed.
|
||||||
|
* @param leftover If non-nullptr then the location to store leftover data.
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
inline T Convert(const Anope::string &in, T def, Anope::string *leftover = nullptr)
|
||||||
|
{
|
||||||
|
return TryConvert<T>(in, leftover).value_or(def);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Attempts to convert any type to a string.
|
||||||
|
* @param in The value to convert.
|
||||||
|
*/
|
||||||
|
template <class T>
|
||||||
|
inline std::optional<Anope::string> TryString(const T &in)
|
||||||
|
{
|
||||||
|
std::ostringstream tmp;
|
||||||
|
if (!(tmp << in))
|
||||||
|
return std::nullopt;
|
||||||
|
return tmp.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No-op function that returns the string that was passed to it.
|
||||||
|
* @param in The string to return.
|
||||||
|
*/
|
||||||
|
inline const string &ToString(const string &in)
|
||||||
|
{
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Converts a std::string to a string.
|
||||||
|
* @param in The value to convert.
|
||||||
|
*/
|
||||||
|
inline string ToString(const std::string &in)
|
||||||
|
{
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Converts a char array to a string.
|
||||||
|
* @param in The value to convert.
|
||||||
|
*/
|
||||||
|
inline string ToString(const char *in)
|
||||||
|
{
|
||||||
|
return string(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Converts a char to a string.
|
||||||
|
* @param in The value to convert.
|
||||||
|
*/
|
||||||
|
inline string ToString(char in)
|
||||||
|
{
|
||||||
|
return string(1, static_cast<string::value_type>(in));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Converts an unsigned char to a string.
|
||||||
|
* @param in The value to convert.
|
||||||
|
*/
|
||||||
|
inline string ToString(unsigned char in)
|
||||||
|
{
|
||||||
|
return string(1, static_cast<string::value_type>(in));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Converts a bool to a string.
|
||||||
|
* @param in The value to convert.
|
||||||
|
*/
|
||||||
|
inline string ToString(bool in)
|
||||||
|
{
|
||||||
|
return (in ? "1" : "0");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Converts a type that std::to_string is implemented for to a string.
|
||||||
|
* @param in The value to convert.
|
||||||
|
*/
|
||||||
|
template<typename Stringable>
|
||||||
|
inline std::enable_if_t<std::is_arithmetic_v<Stringable>, string> ToString(const Stringable &in)
|
||||||
|
{
|
||||||
|
return std::to_string(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Converts any type to a string.
|
||||||
|
* @param in The value to convert.
|
||||||
|
*/
|
||||||
|
template <class T>
|
||||||
|
inline std::enable_if_t<!std::is_arithmetic_v<T>, string> ToString(const T &in)
|
||||||
|
{
|
||||||
|
return TryString(in).value_or(Anope::string());
|
||||||
|
}
|
||||||
|
}
|
||||||
+20
-20
@@ -41,12 +41,12 @@ public:
|
|||||||
|
|
||||||
void UnsetExtensibles();
|
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;
|
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, const T &what);
|
||||||
template<typename T> T* Extend(const Anope::string &name);
|
template<typename T> T *Extend(const Anope::string &name);
|
||||||
template<typename T> T* Require(const Anope::string &name);
|
template<typename T> T *Require(const Anope::string &name);
|
||||||
template<typename T> void Shrink(const Anope::string &name);
|
template<typename T> void Shrink(const Anope::string &name);
|
||||||
|
|
||||||
static void ExtensibleSerialize(const Extensible *, const Serializable *, Serialize::Data &data);
|
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)
|
if (t)
|
||||||
*t = value;
|
*t = value;
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
T* Set(Extensible *obj)
|
T *Set(Extensible *obj)
|
||||||
{
|
{
|
||||||
T* t = Create(obj);
|
T *t = Create(obj);
|
||||||
Unset(obj);
|
Unset(obj);
|
||||||
items[obj] = t;
|
items[obj] = t;
|
||||||
obj->extension_items.insert(this);
|
obj->extension_items.insert(this);
|
||||||
@@ -102,7 +102,7 @@ public:
|
|||||||
delete value;
|
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));
|
std::map<Extensible *, void *>::const_iterator it = items.find(const_cast<Extensible *>(obj));
|
||||||
if (it != items.end())
|
if (it != items.end())
|
||||||
@@ -115,9 +115,9 @@ public:
|
|||||||
return items.find(const_cast<Extensible *>(obj)) != items.end();
|
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)
|
if (t)
|
||||||
return t;
|
return t;
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ class ExtensibleItem
|
|||||||
: public BaseExtensibleItem<T>
|
: public BaseExtensibleItem<T>
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
T* Create(Extensible *obj) override
|
T *Create(Extensible *obj) override
|
||||||
{
|
{
|
||||||
return new T(obj);
|
return new T(obj);
|
||||||
}
|
}
|
||||||
@@ -143,7 +143,7 @@ class PrimitiveExtensibleItem
|
|||||||
: public BaseExtensibleItem<T>
|
: public BaseExtensibleItem<T>
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
T* Create(Extensible *obj) override
|
T *Create(Extensible *obj) override
|
||||||
{
|
{
|
||||||
return new T();
|
return new T();
|
||||||
}
|
}
|
||||||
@@ -155,7 +155,7 @@ template<>
|
|||||||
class PrimitiveExtensibleItem<bool> : public BaseExtensibleItem<bool>
|
class PrimitiveExtensibleItem<bool> : public BaseExtensibleItem<bool>
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
bool* Create(Extensible *) override
|
bool *Create(Extensible *) override
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -172,7 +172,7 @@ public:
|
|||||||
|
|
||||||
void ExtensibleSerialize(const Extensible *e, const Serializable *s, Serialize::Data &data) const override
|
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;
|
data[this->name] << *t;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,7 +216,7 @@ struct ExtensibleRef final
|
|||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T* Extensible::GetExt(const Anope::string &name) const
|
T *Extensible::GetExt(const Anope::string &name) const
|
||||||
{
|
{
|
||||||
ExtensibleRef<T> ref(name);
|
ExtensibleRef<T> ref(name);
|
||||||
if (ref)
|
if (ref)
|
||||||
@@ -227,16 +227,16 @@ T* Extensible::GetExt(const Anope::string &name) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
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)
|
if (t)
|
||||||
*t = what;
|
*t = what;
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T* Extensible::Extend(const Anope::string &name)
|
T *Extensible::Extend(const Anope::string &name)
|
||||||
{
|
{
|
||||||
ExtensibleRef<T> ref(name);
|
ExtensibleRef<T> ref(name);
|
||||||
if (ref)
|
if (ref)
|
||||||
@@ -247,7 +247,7 @@ T* Extensible::Extend(const Anope::string &name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T* Extensible::Require(const Anope::string &name)
|
T *Extensible::Require(const Anope::string &name)
|
||||||
{
|
{
|
||||||
if (HasExt(name))
|
if (HasExt(name))
|
||||||
return GetExt<T>(name);
|
return GetExt<T>(name);
|
||||||
|
|||||||
+11
-12
@@ -65,11 +65,13 @@ namespace Language
|
|||||||
} // namespace Language
|
} // namespace Language
|
||||||
|
|
||||||
/* Commonly used language strings */
|
/* Commonly used language strings */
|
||||||
|
#define CONFIRM_DROP _("Please confirm that you want to drop \002%s\002 with \002%s%s DROP %s %s\002")
|
||||||
|
#define SERVICE_UNAVAILABLE _("Sorry, %s is temporarily unavailable.")
|
||||||
#define MORE_INFO _("\002%s%s HELP %s\002 for more information.")
|
#define MORE_INFO _("\002%s%s HELP %s\002 for more information.")
|
||||||
#define BAD_USERHOST_MASK _("Mask must be in the form \037user\037@\037host\037.")
|
#define BAD_USERHOST_MASK _("Mask must be in the form \037user\037@\037host\037.")
|
||||||
#define BAD_EXPIRY_TIME _("Invalid expiry time.")
|
#define BAD_EXPIRY_TIME _("Invalid expiry time.")
|
||||||
#define USERHOST_MASK_TOO_WIDE _("%s coverage is too wide; Please use a more specific mask.")
|
#define USERHOST_MASK_TOO_WIDE _("%s coverage is too wide; Please use a more specific mask.")
|
||||||
#define READ_ONLY_MODE _("Services are in read-only mode!")
|
#define READ_ONLY_MODE _("Services are temporarily in read-only mode.")
|
||||||
#define PASSWORD_INCORRECT _("Password incorrect.")
|
#define PASSWORD_INCORRECT _("Password incorrect.")
|
||||||
#define ACCESS_DENIED _("Access denied.")
|
#define ACCESS_DENIED _("Access denied.")
|
||||||
#define MORE_OBSCURE_PASSWORD _("Please try again with a more obscure password. Passwords should not be\n" \
|
#define MORE_OBSCURE_PASSWORD _("Please try again with a more obscure password. Passwords should not be\n" \
|
||||||
@@ -86,12 +88,10 @@ namespace Language
|
|||||||
#define CHAN_X_NOT_REGISTERED _("Channel \002%s\002 isn't registered.")
|
#define CHAN_X_NOT_REGISTERED _("Channel \002%s\002 isn't registered.")
|
||||||
#define CHAN_X_NOT_IN_USE _("Channel \002%s\002 doesn't exist.")
|
#define CHAN_X_NOT_IN_USE _("Channel \002%s\002 doesn't exist.")
|
||||||
#define NICK_IDENTIFY_REQUIRED _("You must be logged into an account to use that command.")
|
#define NICK_IDENTIFY_REQUIRED _("You must be logged into an account to use that command.")
|
||||||
#define MAIL_X_INVALID _("\002%s\002 is not a valid e-mail address.")
|
#define MAIL_X_INVALID _("\002%s\002 is not a valid email address.")
|
||||||
#define UNKNOWN _("<unknown>")
|
#define UNKNOWN _("<unknown>")
|
||||||
#define NO_EXPIRE _("does not expire")
|
#define NO_EXPIRE _("does not expire")
|
||||||
#define LIST_INCORRECT_RANGE _("Incorrect range specified. The correct syntax is \002#\037from\037-\037to\037\002.")
|
#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" \
|
#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" \
|
"nick, type \002%s%s IDENTIFY \037password\037\002. Otherwise,\n" \
|
||||||
"please choose a different nick.")
|
"please choose a different nick.")
|
||||||
@@ -99,7 +99,7 @@ namespace Language
|
|||||||
#define NICK_CANNOT_BE_REGISTERED _("Nickname \002%s\002 may not be registered.")
|
#define NICK_CANNOT_BE_REGISTERED _("Nickname \002%s\002 may not be registered.")
|
||||||
#define NICK_ALREADY_REGISTERED _("Nickname \002%s\002 is already registered!")
|
#define NICK_ALREADY_REGISTERED _("Nickname \002%s\002 is already registered!")
|
||||||
#define NICK_SET_DISPLAY_CHANGED _("The new display is now \002%s\002.")
|
#define NICK_SET_DISPLAY_CHANGED _("The new display is now \002%s\002.")
|
||||||
#define NICK_CONFIRM_INVALID _("Invalid passcode has been entered, please check the e-mail again, and retry.")
|
#define NICK_CONFIRM_INVALID _("Invalid passcode has been entered, please check the email again, and retry.")
|
||||||
#define CHAN_NOT_ALLOWED_TO_JOIN _("You are not permitted to be on this channel.")
|
#define CHAN_NOT_ALLOWED_TO_JOIN _("You are not permitted to be on this channel.")
|
||||||
#define CHAN_X_INVALID _("Channel %s is not a valid channel.")
|
#define CHAN_X_INVALID _("Channel %s is not a valid channel.")
|
||||||
#define CHAN_REACHED_CHANNEL_LIMIT _("Sorry, you have already reached your limit of \002%d\002 channels.")
|
#define CHAN_REACHED_CHANNEL_LIMIT _("Sorry, you have already reached your limit of \002%d\002 channels.")
|
||||||
@@ -116,15 +116,14 @@ namespace Language
|
|||||||
"Type \002%s%s READ %zu\002 to read it.")
|
"Type \002%s%s READ %zu\002 to read it.")
|
||||||
#define MEMO_HAVE_NO_MEMOS _("You have no memos.")
|
#define MEMO_HAVE_NO_MEMOS _("You have no memos.")
|
||||||
#define MEMO_X_HAS_NO_MEMOS _("%s has no memos.")
|
#define MEMO_X_HAS_NO_MEMOS _("%s has no memos.")
|
||||||
#define MEMO_SEND_DISABLED _("Sorry, memo sending is temporarily disabled.")
|
|
||||||
#define MEMO_HAVE_NO_NEW_MEMOS _("You have no new memos.")
|
#define MEMO_HAVE_NO_NEW_MEMOS _("You have no new memos.")
|
||||||
#define MEMO_X_HAS_NO_NEW_MEMOS _("%s has no new memos.")
|
#define MEMO_X_HAS_NO_NEW_MEMOS _("%s has no new memos.")
|
||||||
#define BOT_DOES_NOT_EXIST _("Bot \002%s\002 does not exist.")
|
#define BOT_DOES_NOT_EXIST _("Bot \002%s\002 does not exist.")
|
||||||
#define BOT_NOT_ASSIGNED _("You must assign a bot to the channel before using this command.")
|
#define BOT_NOT_ASSIGNED _("You must assign a bot to the channel before using this command.")
|
||||||
#define BOT_NOT_ON_CHANNEL _("Bot is not on channel \002%s\002.")
|
#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_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_IDENT_ERROR _("A vident 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_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 %d characters.")
|
#define HOST_SET_IDENTTOOLONG _("Error! The vident 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_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")
|
#define HOST_NO_VIDENT _("Your IRCd does not support vidents. If this is incorrect please report this as a possible bug.")
|
||||||
|
|||||||
+1
-1
@@ -26,6 +26,7 @@ namespace Mail
|
|||||||
: public Thread
|
: public Thread
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
Anope::string error;
|
||||||
Anope::string sendmail_path;
|
Anope::string sendmail_path;
|
||||||
Anope::string send_from;
|
Anope::string send_from;
|
||||||
Anope::string mail_to;
|
Anope::string mail_to;
|
||||||
@@ -35,7 +36,6 @@ namespace Mail
|
|||||||
Anope::string content_type;
|
Anope::string content_type;
|
||||||
bool dont_quote_addresses;
|
bool dont_quote_addresses;
|
||||||
|
|
||||||
bool success = false;
|
|
||||||
public:
|
public:
|
||||||
/** Construct this message. Once constructed call Thread::Start to launch the mail sending.
|
/** Construct this message. Once constructed call Thread::Start to launch the mail sending.
|
||||||
* @param sf Config->SendFrom
|
* @param sf Config->SendFrom
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@ public:
|
|||||||
~Memo();
|
~Memo();
|
||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override;
|
void Serialize(Serialize::Data &data) const override;
|
||||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
|
||||||
|
|
||||||
Anope::string owner;
|
Anope::string owner;
|
||||||
/* When it was sent */
|
/* When it was sent */
|
||||||
|
|||||||
+16
-16
@@ -24,7 +24,7 @@ namespace Message
|
|||||||
struct CoreExport Away
|
struct CoreExport Away
|
||||||
: IRCDMessage
|
: 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;
|
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
|
struct CoreExport Capab
|
||||||
: IRCDMessage
|
: 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;
|
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
|
struct CoreExport Invite
|
||||||
: IRCDMessage
|
: 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;
|
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
|
struct CoreExport Join
|
||||||
: IRCDMessage
|
: 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;
|
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
|
struct CoreExport Kick
|
||||||
: IRCDMessage
|
: 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;
|
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
|
struct CoreExport Mode
|
||||||
: IRCDMessage
|
: 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;
|
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
|
struct CoreExport Notice
|
||||||
: IRCDMessage
|
: 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;
|
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
|
struct CoreExport Part
|
||||||
: IRCDMessage
|
: 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;
|
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
|
struct CoreExport Ping
|
||||||
: IRCDMessage
|
: 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;
|
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
|
struct CoreExport Privmsg
|
||||||
: IRCDMessage
|
: 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;
|
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
|
struct CoreExport Quit
|
||||||
: IRCDMessage
|
: 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;
|
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
|
struct CoreExport Stats
|
||||||
: IRCDMessage
|
: 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;
|
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
|
struct CoreExport Time
|
||||||
: IRCDMessage
|
: 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;
|
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
|
struct CoreExport Topic
|
||||||
: IRCDMessage
|
: 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;
|
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
|
struct CoreExport Version
|
||||||
: IRCDMessage
|
: 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;
|
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
|
struct CoreExport Whois
|
||||||
: IRCDMessage
|
: 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;
|
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
|
/** Get the banned mask for this entry
|
||||||
* @return The mask
|
* @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
|
/** Check if this entry matches a user
|
||||||
* @param u The user
|
* @param u The user
|
||||||
|
|||||||
+13
-33
@@ -777,23 +777,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void OnChangeCoreDisplay(NickCore *nc, const Anope::string &newdisplay) { throw NotImplementedException(); }
|
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()
|
/** called from NickCore::ClearCert()
|
||||||
* @param nc pointer to the NickCore
|
* @param nc pointer to the NickCore
|
||||||
*/
|
*/
|
||||||
@@ -855,12 +838,12 @@ public:
|
|||||||
/** Called when a vhost is deleted
|
/** Called when a vhost is deleted
|
||||||
* @param na The nickalias of the vhost
|
* @param na The nickalias of the vhost
|
||||||
*/
|
*/
|
||||||
virtual void OnDeleteVhost(NickAlias *na) { throw NotImplementedException(); }
|
virtual void OnDeleteVHost(NickAlias *na) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a vhost is set
|
/** Called when a vhost is set
|
||||||
* @param na The nickalias of the vhost
|
* @param na The nickalias of the vhost
|
||||||
*/
|
*/
|
||||||
virtual void OnSetVhost(NickAlias *na) { throw NotImplementedException(); }
|
virtual void OnSetVHost(NickAlias *na) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a users host changes
|
/** Called when a users host changes
|
||||||
* @param u The user
|
* @param u The user
|
||||||
@@ -964,23 +947,26 @@ public:
|
|||||||
* @param u The user sending the PRIVMSG
|
* @param u The user sending the PRIVMSG
|
||||||
* @param bi The target of the PRIVMSG
|
* @param bi The target of the PRIVMSG
|
||||||
* @param message The message
|
* @param message The message
|
||||||
|
* @param tags Message tags
|
||||||
* @return EVENT_STOP to halt processing
|
* @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
|
/** Called when we receive a NOTICE for one of our clients
|
||||||
* @param u The user sending the NOTICE
|
* @param u The user sending the NOTICE
|
||||||
* @param bi The target of the NOTICE
|
* @param bi The target of the NOTICE
|
||||||
|
* @param tags Message tags
|
||||||
* @param message The message
|
* @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
|
/** Called when we receive a PRIVMSG for a registered channel we are in
|
||||||
* @param u The source of the message
|
* @param u The source of the message
|
||||||
* @param c The channel
|
* @param c The channel
|
||||||
* @param msg The message
|
* @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
|
/** Called when a message is logged
|
||||||
* @param l The log message
|
* @param l The log message
|
||||||
@@ -1051,9 +1037,10 @@ public:
|
|||||||
* @param source The source of the message
|
* @param source The source of the message
|
||||||
* @param command The command being executed
|
* @param command The command being executed
|
||||||
* @param params Parameters
|
* @param params Parameters
|
||||||
|
* @param tags Tags
|
||||||
* @return EVENT_STOP to prevent the protocol module from processing this message
|
* @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
|
/** Called to determine if a channel mode can be set by a user
|
||||||
* @param u The user
|
* @param u The user
|
||||||
@@ -1075,13 +1062,6 @@ public:
|
|||||||
* @return EVENT_STOP to force the user off of the nick
|
* @return EVENT_STOP to force the user off of the nick
|
||||||
*/
|
*/
|
||||||
virtual EventReturn OnNickValidate(User *u, NickAlias *na) { throw NotImplementedException(); }
|
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
|
enum Implementation
|
||||||
@@ -1099,15 +1079,15 @@ enum Implementation
|
|||||||
I_OnCreateChan, I_OnDelChan, I_OnChannelCreate, I_OnChannelDelete, I_OnAkickAdd, I_OnAkickDel, I_OnCheckKick,
|
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_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_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_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_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,
|
I_OnChannelModeSet, I_OnChannelModeUnset, I_OnUserModeSet, I_OnUserModeUnset, I_OnChannelModeAdd, I_OnUserModeAdd,
|
||||||
I_OnMLock, I_OnUnMLock, I_OnModuleLoad, I_OnModuleUnload, I_OnServerSync, I_OnUplinkSync, I_OnBotPrivmsg, I_OnBotNotice,
|
I_OnMLock, I_OnUnMLock, I_OnModuleLoad, I_OnModuleUnload, I_OnServerSync, I_OnUplinkSync, I_OnBotPrivmsg, I_OnBotNotice,
|
||||||
I_OnPrivmsg, I_OnLog, I_OnLogMessage, I_OnDnsRequest, I_OnCheckModes, I_OnChannelSync, I_OnSetCorrectModes,
|
I_OnPrivmsg, I_OnLog, I_OnLogMessage, I_OnDnsRequest, I_OnCheckModes, I_OnChannelSync, I_OnSetCorrectModes,
|
||||||
I_OnSerializeCheck, I_OnSerializableConstruct, I_OnSerializableDestruct, I_OnSerializableUpdate,
|
I_OnSerializeCheck, I_OnSerializableConstruct, I_OnSerializableDestruct, I_OnSerializableUpdate,
|
||||||
I_OnSerializeTypeCreate, I_OnSetChannelOption, I_OnSetNickOption, I_OnMessage, I_OnCanSet, I_OnCheckDelete,
|
I_OnSerializeTypeCreate, I_OnSetChannelOption, I_OnSetNickOption, I_OnMessage, I_OnCanSet, I_OnCheckDelete,
|
||||||
I_OnExpireTick, I_OnNickValidate, I_OnChannelUnban,
|
I_OnExpireTick, I_OnNickValidate,
|
||||||
I_SIZE
|
I_SIZE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -46,13 +46,13 @@ struct BadWords
|
|||||||
* @param type The type (SINGLE START END)
|
* @param type The type (SINGLE START END)
|
||||||
* @return The badword
|
* @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
|
/** Get a badword structure by index
|
||||||
* @param index The index
|
* @param index The index
|
||||||
* @return The badword
|
* @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
|
/** Get how many badwords are on this channel
|
||||||
* @return The number of badwords in the vector
|
* @return The number of badwords in the vector
|
||||||
|
|||||||
@@ -33,5 +33,5 @@ public:
|
|||||||
delete (*this)->at(i - 1);
|
delete (*this)->at(i - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual EntryMsg* Create() = 0;
|
virtual EntryMsg *Create() = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,26 +13,135 @@
|
|||||||
|
|
||||||
namespace Encryption
|
namespace Encryption
|
||||||
{
|
{
|
||||||
typedef std::pair<const unsigned char *, size_t> Hash;
|
/** Base class for encryption contexts. */
|
||||||
typedef std::pair<const uint32_t *, size_t> IV;
|
|
||||||
|
|
||||||
class Context
|
class Context
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~Context() = default;
|
virtual ~Context() = default;
|
||||||
|
|
||||||
|
/** Updates the encryption context with the specified data.
|
||||||
|
* @param str The data to update the context with.
|
||||||
|
*/
|
||||||
|
inline void Update(const Anope::string &str)
|
||||||
|
{
|
||||||
|
Update(reinterpret_cast<const unsigned char *>(str.c_str()), str.length());
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Updates the encryption context with the specified data.
|
||||||
|
* @param data The data to update the context with.
|
||||||
|
* @param len The length of the data.
|
||||||
|
*/
|
||||||
virtual void Update(const unsigned char *data, size_t len) = 0;
|
virtual void Update(const unsigned char *data, size_t len) = 0;
|
||||||
virtual void Finalize() = 0;
|
|
||||||
virtual Hash GetFinalizedHash() = 0;
|
/** Finalises the encryption context and returns the digest. */
|
||||||
|
virtual Anope::string Finalize() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** Provider of encryption contexts. */
|
||||||
class Provider
|
class Provider
|
||||||
: public Service
|
: public Service
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Provider(Module *creator, const Anope::string &sname) : Service(creator, "Encryption::Provider", sname) { }
|
/** The byte size of the block cipher. */
|
||||||
|
const size_t block_size;
|
||||||
|
|
||||||
|
/** The byte size of the resulting digest. */
|
||||||
|
const size_t digest_size;
|
||||||
|
|
||||||
|
/** Creates a provider of encryption contexts.
|
||||||
|
* @param creator The module that created this provider.
|
||||||
|
* @param algorithm The name of the encryption algorithm.
|
||||||
|
* @param bs The byte size of the block cipher.
|
||||||
|
* @param ds The byte size of the resulting digest.
|
||||||
|
*/
|
||||||
|
Provider(Module *creator, const Anope::string &algorithm, size_t bs, size_t ds)
|
||||||
|
: Service(creator, "Encryption::Provider", algorithm)
|
||||||
|
, block_size(bs)
|
||||||
|
, digest_size(ds)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
virtual ~Provider() = default;
|
virtual ~Provider() = default;
|
||||||
|
|
||||||
virtual Context *CreateContext(IV * = NULL) = 0;
|
/** Checks whether a plain text value matches a hash created by this provider. */
|
||||||
virtual IV GetDefaultIV() = 0;
|
virtual bool Compare(const Anope::string &hash, const Anope::string &plain)
|
||||||
|
{
|
||||||
|
return !hash.empty() && hash.equals_cs(ToPrintable(Encrypt(plain)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Called on initialising a encryption provider to check it works properly. */
|
||||||
|
void Check(const Anope::map<Anope::string> &checks)
|
||||||
|
{
|
||||||
|
for (const auto &[hash, plain] : checks)
|
||||||
|
{
|
||||||
|
if (!Compare(hash, plain))
|
||||||
|
throw ModuleException("BUG: unable to generate " + this->name + " hashes safely! Please report this!");
|
||||||
|
}
|
||||||
|
Log(LOG_DEBUG) << "The " << this->name << " encryption provider appears to be working correctly.";
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Creates a new encryption context. */
|
||||||
|
virtual std::unique_ptr<Context> CreateContext() = 0;
|
||||||
|
|
||||||
|
/** Quickly encrypts the specified values and returns the digest. */
|
||||||
|
template<typename... Args>
|
||||||
|
Anope::string Encrypt(Args &&...args)
|
||||||
|
{
|
||||||
|
auto context = CreateContext();
|
||||||
|
context->Update(std::forward<Args>(args)...);
|
||||||
|
return context->Finalize();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Calculates the RFC 2104 hash-based message authentication code for the specified data. */
|
||||||
|
inline Anope::string HMAC(const Anope::string &key, const Anope::string &data)
|
||||||
|
{
|
||||||
|
if (!block_size)
|
||||||
|
return {};
|
||||||
|
|
||||||
|
auto keybuf = key.length() > block_size ? Encrypt(key) : key;
|
||||||
|
keybuf.resize(block_size);
|
||||||
|
|
||||||
|
Anope::string hmac1;
|
||||||
|
Anope::string hmac2;
|
||||||
|
for (size_t i = 0; i < block_size; ++i)
|
||||||
|
{
|
||||||
|
hmac1.push_back(static_cast<char>(keybuf[i] ^ 0x5C));
|
||||||
|
hmac2.push_back(static_cast<char>(keybuf[i] ^ 0x36));
|
||||||
|
}
|
||||||
|
hmac2.append(data);
|
||||||
|
hmac1.append(Encrypt(hmac2));
|
||||||
|
|
||||||
|
return Encrypt(hmac1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Converts a hash to its printable form. */
|
||||||
|
virtual Anope::string ToPrintable(const Anope::string &hash)
|
||||||
|
{
|
||||||
|
return Anope::Hex(hash);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Helper template for creating simple providers of encryption contexts. */
|
||||||
|
template <typename T>
|
||||||
|
class SimpleProvider final
|
||||||
|
: public Provider
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/** Creates a simple provider of encryption contexts.
|
||||||
|
* @param creator The module that created this provider.
|
||||||
|
* @param algorithm The name of the encryption algorithm.
|
||||||
|
* @param bs The byte size of the block cipher.
|
||||||
|
* @param ds The byte size of the resulting digest.
|
||||||
|
*/
|
||||||
|
SimpleProvider(Module *creator, const Anope::string &algorithm, size_t bs, size_t ds)
|
||||||
|
: Provider(creator, algorithm, bs, ds)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @copydoc Encryption::Provider::CreateContext. */
|
||||||
|
std::unique_ptr<Context> CreateContext() override
|
||||||
|
{
|
||||||
|
return std::make_unique<T>();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* (C) 2003-2024 Anope Team
|
||||||
|
* Contact us at team@anope.org
|
||||||
|
*
|
||||||
|
* Please read COPYING and README for further details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
class HostRequest
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
HostRequest() = default;
|
||||||
|
|
||||||
|
public:
|
||||||
|
Anope::string nick;
|
||||||
|
Anope::string ident;
|
||||||
|
Anope::string host;
|
||||||
|
time_t time = 0;
|
||||||
|
|
||||||
|
virtual ~HostRequest() = default;
|
||||||
|
};
|
||||||
@@ -27,9 +27,9 @@ struct HTTPReply final
|
|||||||
std::vector<cookie> cookies;
|
std::vector<cookie> cookies;
|
||||||
|
|
||||||
HTTPReply() = default;
|
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;
|
content_type = other.content_type;
|
||||||
headers = other.headers;
|
headers = other.headers;
|
||||||
@@ -169,7 +169,7 @@ public:
|
|||||||
|
|
||||||
virtual bool RegisterPage(HTTPPage *page) = 0;
|
virtual bool RegisterPage(HTTPPage *page) = 0;
|
||||||
virtual void UnregisterPage(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
|
namespace HTTPUtils
|
||||||
@@ -180,7 +180,7 @@ namespace HTTPUtils
|
|||||||
|
|
||||||
for (unsigned i = 0; i < url.length(); ++i)
|
for (unsigned i = 0; i < url.length(); ++i)
|
||||||
{
|
{
|
||||||
const char& c = url[i];
|
const char &c = url[i];
|
||||||
|
|
||||||
if (c == '%' && i + 2 < url.length())
|
if (c == '%' && i + 2 < url.length())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* (C) 2003-2024 Anope Team
|
||||||
|
* Contact us at team@anope.org
|
||||||
|
*
|
||||||
|
* Please read COPYING and README for further details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
class OperInfo
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
OperInfo() = default;
|
||||||
|
|
||||||
|
OperInfo(const Anope::string &t, const Anope::string &i, const Anope::string &a, time_t c)
|
||||||
|
: target(t)
|
||||||
|
, info(i)
|
||||||
|
, adder(a)
|
||||||
|
, created(c)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
Anope::string target;
|
||||||
|
Anope::string info;
|
||||||
|
Anope::string adder;
|
||||||
|
time_t created = 0;
|
||||||
|
|
||||||
|
virtual ~OperInfo() = default;
|
||||||
|
};
|
||||||
|
|
||||||
|
class OperInfoList
|
||||||
|
: public Serialize::Checker<std::vector<OperInfo *>>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
OperInfoList()
|
||||||
|
: Serialize::Checker<std::vector<OperInfo *>>("OperInfo")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~OperInfoList()
|
||||||
|
{
|
||||||
|
for (auto *info : *(*this))
|
||||||
|
delete info;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual OperInfo *Create() = 0;
|
||||||
|
};
|
||||||
@@ -54,6 +54,15 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void EraseCert(const Anope::string &entry) = 0;
|
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
|
/** Clears the entire nick's cert list
|
||||||
*
|
*
|
||||||
* Deletes all the memory allocated in the certificate list vector and then clears the vector.
|
* Deletes all the memory allocated in the certificate list vector and then clears the vector.
|
||||||
@@ -69,5 +78,5 @@ class CertService
|
|||||||
public:
|
public:
|
||||||
CertService(Module *c) : Service(c, "CertService", "certs") { }
|
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 void RemoveForbid(ForbidData *d) = 0;
|
||||||
|
|
||||||
virtual ForbidData* CreateForbid() = 0;
|
virtual ForbidData *CreateForbid() = 0;
|
||||||
|
|
||||||
virtual ForbidData *FindForbid(const Anope::string &mask, ForbidType type) = 0;
|
virtual ForbidData *FindForbid(const Anope::string &mask, ForbidType type) = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ struct Exception final
|
|||||||
|
|
||||||
Exception() : Serializable("Exception") { }
|
Exception() : Serializable("Exception") { }
|
||||||
void Serialize(Serialize::Data &data) const override;
|
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
|
class SessionService
|
||||||
@@ -70,7 +70,7 @@ void Exception::Serialize(Serialize::Data &data) const
|
|||||||
data["expires"] << this->expires;
|
data["expires"] << this->expires;
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable* Exception::Unserialize(Serializable *obj, Serialize::Data &data)
|
Serializable *Exception::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
{
|
{
|
||||||
if (!session_service)
|
if (!session_service)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -8,21 +8,68 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#define GLOBAL_NO_MESSAGE _("You do not have any messages queued and did not specify a message to send.")
|
||||||
|
#define GLOBAL_QUEUE_CONFLICT _("You can not send a single message while you have messages queued.")
|
||||||
|
|
||||||
class GlobalService
|
class GlobalService
|
||||||
: public Service
|
: public Service
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
GlobalService(Module *m) : Service(m, "GlobalService", "Global")
|
GlobalService(Module *m)
|
||||||
|
: Service(m, "GlobalService", "Global")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Retrieves the bot which sends global messages unless otherwise specified. */
|
/** Retrieves the bot which sends global messages unless otherwise specified. */
|
||||||
virtual Reference<BotInfo> GetDefaultSender() = 0;
|
virtual Reference<BotInfo> GetDefaultSender() const = 0;
|
||||||
|
|
||||||
/** Send out a global message to all users
|
/** Clears any queued messages for the specified account.
|
||||||
* @param sender Our client which should send the global
|
* @param nc The account to clear queued messages for.
|
||||||
* @param source The sender of the global
|
|
||||||
* @param message The message
|
|
||||||
*/
|
*/
|
||||||
virtual void SendGlobal(BotInfo *sender, const Anope::string &source, const Anope::string &message) = 0;
|
virtual void ClearQueue(NickCore *nc) = 0;
|
||||||
|
|
||||||
|
/** Retrieves the size of the messages queue for the specified user.
|
||||||
|
* @param nc The account to count queued messages for.
|
||||||
|
*/
|
||||||
|
inline size_t CountQueue(NickCore* nc) const
|
||||||
|
{
|
||||||
|
auto *q = GetQueue(nc);
|
||||||
|
return q ? q->size() : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Retrieves the messages queue for the specified user.
|
||||||
|
* @param nc The account to retrieve queued messages for.
|
||||||
|
*/
|
||||||
|
virtual const std::vector<Anope::string> *GetQueue(NickCore* nc) const = 0;
|
||||||
|
|
||||||
|
/** Queues a message to be sent later.
|
||||||
|
* @param nc The account to queue the message for.
|
||||||
|
* @param message The message to queue.
|
||||||
|
* @return The new number of messages in the queue.
|
||||||
|
*/
|
||||||
|
virtual size_t Queue(NickCore *nc, const Anope::string &message) = 0;
|
||||||
|
|
||||||
|
/** Sends a single message to all users on the network.
|
||||||
|
* @param message The message to send.
|
||||||
|
* @param source If non-nullptr then the source of the message.
|
||||||
|
* @param sender If non-nullptr then the bot to send the message from.
|
||||||
|
* @param server If non-nullptr then the server to send messages to.
|
||||||
|
* @return If the message was sent then true; otherwise, false.
|
||||||
|
*/
|
||||||
|
virtual bool SendSingle(const Anope::string &message, CommandSource *source = nullptr, BotInfo *sender = nullptr, Server *server = nullptr) = 0;
|
||||||
|
|
||||||
|
/** Sends a message queue to all users on the network.
|
||||||
|
* @param source The source of the message.
|
||||||
|
* @param sender If non-nullptr then the bot to send the message from.
|
||||||
|
* @param server If non-nullptr then the server to send messages to.
|
||||||
|
* @return If the message queue was sent then true; otherwise, false.
|
||||||
|
*/
|
||||||
|
virtual bool SendQueue(CommandSource &source, BotInfo *sender = nullptr, Server *server = nullptr) = 0;
|
||||||
|
|
||||||
|
/** Unqueues a message from the message queue.
|
||||||
|
* @param nc The account to unqueue the message from.
|
||||||
|
* @param idx The index of the item to remove.
|
||||||
|
* @return Whether the message was removed from the queue.
|
||||||
|
*/
|
||||||
|
virtual bool Unqueue(NickCore *nc, size_t idx) = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace SASL
|
|||||||
|
|
||||||
virtual Anope::string GetAgent() = 0;
|
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;
|
virtual void SendMessage(SASL::Session *session, const Anope::string &type, const Anope::string &data) = 0;
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ namespace SASL
|
|||||||
public:
|
public:
|
||||||
Mechanism(Module *o, const Anope::string &sname) : Service(o, "SASL::Mechanism", sname) { }
|
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;
|
virtual void ProcessMessage(Session *session, const Message &) = 0;
|
||||||
|
|
||||||
|
|||||||
+11
-10
@@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
namespace SQL
|
namespace SQL
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -24,7 +26,7 @@ namespace SQL
|
|||||||
Clear();
|
Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::iostream& operator[](const Anope::string &key) override
|
std::iostream &operator[](const Anope::string &key) override
|
||||||
{
|
{
|
||||||
std::stringstream *&ss = data[key];
|
std::stringstream *&ss = data[key];
|
||||||
if (!ss)
|
if (!ss)
|
||||||
@@ -107,7 +109,7 @@ namespace SQL
|
|||||||
Query() { }
|
Query() { }
|
||||||
Query(const Anope::string &q) : query(q) { }
|
Query(const Anope::string &q) : query(q) { }
|
||||||
|
|
||||||
Query& operator=(const Anope::string &q)
|
Query &operator=(const Anope::string &q)
|
||||||
{
|
{
|
||||||
this->query = q;
|
this->query = q;
|
||||||
this->parameters.clear();
|
this->parameters.clear();
|
||||||
@@ -124,15 +126,14 @@ namespace SQL
|
|||||||
return !(*this == other);
|
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
|
auto str = Anope::TryString(value);
|
||||||
{
|
if (!str.has_value())
|
||||||
Anope::string string_value = stringify(value);
|
return;
|
||||||
this->parameters[key].data = string_value;
|
|
||||||
this->parameters[key].escape = escape;
|
this->parameters[key].data = str.value();
|
||||||
}
|
this->parameters[key].escape = escape;
|
||||||
catch (const ConvertException &ex) { }
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public:
|
|||||||
Anope::string name;
|
Anope::string name;
|
||||||
Anope::string id;
|
Anope::string id;
|
||||||
std::deque<Anope::string> data;
|
std::deque<Anope::string> data;
|
||||||
HTTPReply& r;
|
HTTPReply &r;
|
||||||
|
|
||||||
XMLRPCRequest(HTTPReply &_r) : r(_r) { }
|
XMLRPCRequest(HTTPReply &_r) : r(_r) { }
|
||||||
inline void reply(const Anope::string &dname, const Anope::string &ddata) { this->replies.emplace(dname, ddata); }
|
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 */
|
/* Whether the user must be an IRC operator (umode +o) to be considered a services operator */
|
||||||
bool require_oper = true;
|
bool require_oper = true;
|
||||||
Anope::string password;
|
Anope::string password;
|
||||||
Anope::string certfp;
|
std::vector<Anope::string> certfp;
|
||||||
/* Hosts allowed to use this operator block */
|
/* Hosts allowed to use this operator block */
|
||||||
std::vector<Anope::string> hosts;
|
std::vector<Anope::string> hosts;
|
||||||
Anope::string vhost;
|
Anope::string vhost;
|
||||||
@@ -115,10 +115,10 @@ public:
|
|||||||
/** Gets the icommands for this opertype
|
/** Gets the icommands for this opertype
|
||||||
* @return A list of commands
|
* @return A list of commands
|
||||||
*/
|
*/
|
||||||
const std::list<Anope::string> GetCommands() const;
|
std::list<Anope::string> GetCommands() const;
|
||||||
|
|
||||||
/** Gets the privileges for this opertype
|
/** Gets the privileges for this opertype
|
||||||
* @return A list of privileges
|
* @return A list of privileges
|
||||||
*/
|
*/
|
||||||
const std::list<Anope::string> GetPrivs() const;
|
std::list<Anope::string> GetPrivs() const;
|
||||||
};
|
};
|
||||||
|
|||||||
+174
-60
@@ -16,6 +16,17 @@
|
|||||||
#include "service.h"
|
#include "service.h"
|
||||||
#include "modes.h"
|
#include "modes.h"
|
||||||
|
|
||||||
|
/** Thrown when a protocol error happens. */
|
||||||
|
class CoreExport ProtocolException final
|
||||||
|
: public ModuleException
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ProtocolException(const Anope::string &message)
|
||||||
|
: ModuleException(message)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/* Encapsulates the IRCd protocol we are speaking. */
|
/* Encapsulates the IRCd protocol we are speaking. */
|
||||||
class CoreExport IRCDProto
|
class CoreExport IRCDProto
|
||||||
: public Service
|
: public Service
|
||||||
@@ -25,61 +36,111 @@ class CoreExport IRCDProto
|
|||||||
protected:
|
protected:
|
||||||
IRCDProto(Module *creator, const Anope::string &proto_name);
|
IRCDProto(Module *creator, const Anope::string &proto_name);
|
||||||
public:
|
public:
|
||||||
|
/** Retrieves the protocol name. */
|
||||||
|
const Anope::string &GetProtocolName() const { return proto_name; }
|
||||||
|
|
||||||
virtual ~IRCDProto();
|
virtual ~IRCDProto();
|
||||||
|
|
||||||
virtual void SendSVSKillInternal(const MessageSource &, User *, const Anope::string &);
|
virtual void SendNoticeInternal(const MessageSource &, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags = {});
|
||||||
virtual void SendModeInternal(const MessageSource &, const Channel *, const Anope::string &);
|
virtual void SendPrivmsgInternal(const MessageSource &, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags = {});
|
||||||
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 SendCTCPInternal(const MessageSource &, const Anope::string &dest, const Anope::string &buf);
|
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();
|
/** Parses an incoming message from the IRC server.
|
||||||
virtual bool Parse(const Anope::string &, Anope::map<Anope::string> &, Anope::string &, Anope::string &, std::vector<Anope::string> &);
|
* @param message The message to parse.
|
||||||
virtual Anope::string Format(const Anope::string &source, const Anope::string &message);
|
* @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 */
|
/* Modes used by default by our clients */
|
||||||
Anope::string DefaultPseudoclientModes;
|
Anope::string DefaultPseudoclientModes = "+io";
|
||||||
|
|
||||||
/* Can we force change a users's nick? */
|
/* Can we force change a users's nick? */
|
||||||
bool CanSVSNick;
|
bool CanSVSNick = false;
|
||||||
|
|
||||||
/* Can we force join or part users? */
|
/* Can we force join or part users? */
|
||||||
bool CanSVSJoin;
|
bool CanSVSJoin = false;
|
||||||
/* Can we set vhosts/vidents on users? */
|
|
||||||
bool CanSetVHost, CanSetVIdent;
|
/* 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? */
|
/* Can we ban specific gecos from being used? */
|
||||||
bool CanSNLine;
|
bool CanSNLine = false;
|
||||||
|
|
||||||
/* Can we ban specific nicknames from being used? */
|
/* Can we ban specific nicknames from being used? */
|
||||||
bool CanSQLine;
|
bool CanSQLine = false;
|
||||||
|
|
||||||
/* Can we ban specific channel names from being used? */
|
/* Can we ban specific channel names from being used? */
|
||||||
bool CanSQLineChannel;
|
bool CanSQLineChannel = false;
|
||||||
|
|
||||||
/* Can we ban by IP? */
|
/* Can we ban by IP? */
|
||||||
bool CanSZLine;
|
bool CanSZLine = false;
|
||||||
|
|
||||||
/* Can we place temporary holds on specific nicknames? */
|
/* Can we place temporary holds on specific nicknames? */
|
||||||
bool CanSVSHold;
|
bool CanSVSHold = false;
|
||||||
|
|
||||||
/* See ns_cert */
|
/* See ns_cert */
|
||||||
bool CanCertFP;
|
bool CanCertFP = false;
|
||||||
/* Can we send arbitrary message tags? */
|
|
||||||
bool CanSendTags;
|
|
||||||
/* Can users log out before being fully connected? */
|
/* 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. */
|
/* 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 */
|
/* If this IRCd has unique ids, whether the IDs and nicknames are ambiguous */
|
||||||
bool AmbiguousID;
|
bool AmbiguousID = false;
|
||||||
/* The maximum number of modes we are allowed to set with one MODE command */
|
|
||||||
unsigned MaxModes;
|
/** Can we ask the server to unban a user? */
|
||||||
|
bool CanClearBans = false;
|
||||||
|
|
||||||
|
/* The maximum length of a channel name. */
|
||||||
|
size_t MaxChannel = 0;
|
||||||
|
|
||||||
|
/* The maximum length of a hostname. */
|
||||||
|
size_t MaxHost = 0;
|
||||||
|
|
||||||
/* The maximum number of bytes a line may have */
|
/* The maximum number of bytes a line may have */
|
||||||
unsigned MaxLine;
|
size_t MaxLine = 512;
|
||||||
|
|
||||||
|
/* The maximum number of modes we are allowed to set with one MODE command */
|
||||||
|
size_t MaxModes = 3;
|
||||||
|
|
||||||
|
/* The maximum length of a nickname. */
|
||||||
|
size_t MaxNick = 0;
|
||||||
|
|
||||||
|
/* The maximum length of a username. */
|
||||||
|
size_t MaxUser = 0;
|
||||||
|
|
||||||
|
|
||||||
/* Retrieves the next free UID or SID */
|
/* Retrieves the next free UID or SID */
|
||||||
virtual Anope::string UID_Retrieve();
|
virtual Anope::string UID_Retrieve();
|
||||||
virtual Anope::string SID_Retrieve();
|
virtual Anope::string SID_Retrieve();
|
||||||
|
|
||||||
|
/** Extracts a timestamp from a string. */
|
||||||
|
virtual time_t ExtractTimestamp(const Anope::string &str);
|
||||||
|
|
||||||
|
/** Sends an error to the uplink before disconnecting.
|
||||||
|
* @param reason The error message.
|
||||||
|
*/
|
||||||
|
virtual void SendError(const Anope::string &reason);
|
||||||
|
|
||||||
/** Sets the server in NOOP mode. If NOOP mode is enabled, no users
|
/** Sets the server in NOOP mode. If NOOP mode is enabled, no users
|
||||||
* will be able to oper on the server.
|
* will be able to oper on the server.
|
||||||
* @param s The server
|
* @param s The server
|
||||||
@@ -98,8 +159,8 @@ public:
|
|||||||
* @param vident The ident to set
|
* @param vident The ident to set
|
||||||
* @param vhost The vhost to set
|
* @param vhost The vhost to set
|
||||||
*/
|
*/
|
||||||
virtual void SendVhost(User *u, const Anope::string &vident, const Anope::string &vhost) { }
|
virtual void SendVHost(User *u, const Anope::string &vident, const Anope::string &vhost) { }
|
||||||
virtual void SendVhostDel(User *) { }
|
virtual void SendVHostDel(User *) { }
|
||||||
|
|
||||||
/** Sets an akill. This is a recursive function that can be called multiple times
|
/** Sets an akill. This is a recursive function that can be called multiple times
|
||||||
* for the same xline, but for different users, if the xline is not one that can be
|
* for the same xline, but for different users, if the xline is not one that can be
|
||||||
@@ -127,19 +188,30 @@ public:
|
|||||||
/** Kills a user
|
/** Kills a user
|
||||||
* @param source Who is doing the kill
|
* @param source Who is doing the kill
|
||||||
* @param user The user to be killed
|
* @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 SendModeInternal(const MessageSource &source, Channel *chan, const Anope::string &modes, const std::vector<Anope::string> &values);
|
||||||
virtual void SendMode(const MessageSource &source, User *u, const char *fmt, ...) ATTR_FORMAT(4, 5);
|
template <typename... Args>
|
||||||
|
void SendMode(const MessageSource &source, Channel *chan, const Anope::string &modes, Args &&...args)
|
||||||
|
{
|
||||||
|
SendModeInternal(source, chan, modes, { Anope::ToString(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, { Anope::ToString(args)... });
|
||||||
|
}
|
||||||
|
|
||||||
/** Introduces a client to the rest of the network
|
/** Introduces a client to the rest of the network
|
||||||
* @param u The client to introduce
|
* @param u The client to introduce
|
||||||
*/
|
*/
|
||||||
virtual void SendClientIntroduction(User *u) = 0;
|
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 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);
|
virtual void SendPrivmsg(const MessageSource &source, const Anope::string &dest, const char *fmt, ...) ATTR_FORMAT(4, 5);
|
||||||
@@ -149,7 +221,10 @@ public:
|
|||||||
virtual void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) = 0;
|
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 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 SendPing(const Anope::string &servname, const Anope::string &who);
|
||||||
virtual void SendPong(const Anope::string &servname, const Anope::string &who);
|
virtual void SendPong(const Anope::string &servname, const Anope::string &who);
|
||||||
|
|
||||||
@@ -161,7 +236,7 @@ public:
|
|||||||
* stacker to be set "soon".
|
* stacker to be set "soon".
|
||||||
*/
|
*/
|
||||||
virtual void SendJoin(User *u, Channel *c, const ChannelStatus *status) = 0;
|
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.
|
/** Force joins a user that isn't ours to a channel.
|
||||||
* @param bi The source of the message
|
* @param bi The source of the message
|
||||||
@@ -180,7 +255,7 @@ public:
|
|||||||
virtual void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) { }
|
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 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.
|
/** Sends a nick change of one of our clients.
|
||||||
*/
|
*/
|
||||||
@@ -211,7 +286,12 @@ public:
|
|||||||
virtual void SendServer(const Server *) = 0;
|
virtual void SendServer(const Server *) = 0;
|
||||||
virtual void SendSquit(Server *, const Anope::string &message);
|
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, { Anope::ToString(args)... });
|
||||||
|
}
|
||||||
|
|
||||||
virtual void SendLogin(User *u, NickAlias *na) = 0;
|
virtual void SendLogin(User *u, NickAlias *na) = 0;
|
||||||
virtual void SendLogout(User *u) = 0;
|
virtual void SendLogout(User *u) = 0;
|
||||||
@@ -226,6 +306,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void SendOper(User *u);
|
virtual void SendOper(User *u);
|
||||||
|
|
||||||
|
virtual void SendClearBans(const MessageSource &user, Channel *c, User* u) { }
|
||||||
|
|
||||||
virtual void SendSASLMechanisms(std::vector<Anope::string> &) { }
|
virtual void SendSASLMechanisms(std::vector<Anope::string> &) { }
|
||||||
virtual void SendSASLMessage(const SASL::Message &) { }
|
virtual void SendSASLMessage(const SASL::Message &) { }
|
||||||
virtual void SendSVSLogin(const Anope::string &uid, NickAlias *na) { }
|
virtual void SendSVSLogin(const Anope::string &uid, NickAlias *na) { }
|
||||||
@@ -235,14 +317,15 @@ public:
|
|||||||
virtual bool IsIdentValid(const Anope::string &);
|
virtual bool IsIdentValid(const Anope::string &);
|
||||||
virtual bool IsHostValid(const Anope::string &);
|
virtual bool IsHostValid(const Anope::string &);
|
||||||
virtual bool IsExtbanValid(const Anope::string &) { return false; }
|
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
|
/** Retrieve the maximum number of list modes settable on this channel
|
||||||
* Defaults to Config->ListSize
|
* Defaults to Config->ListSize
|
||||||
*/
|
*/
|
||||||
virtual unsigned GetMaxListFor(Channel *c);
|
virtual size_t GetMaxListFor(Channel *c, ChannelMode *cm);
|
||||||
virtual unsigned GetMaxListFor(Channel *c, ChannelMode *cm);
|
|
||||||
|
|
||||||
virtual Anope::string NormalizeMask(const Anope::string &mask);
|
virtual Anope::string NormalizeMask(const Anope::string &mask);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CoreExport MessageSource final
|
class CoreExport MessageSource final
|
||||||
@@ -252,7 +335,7 @@ class CoreExport MessageSource final
|
|||||||
Server *s = nullptr;
|
Server *s = nullptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MessageSource(const Anope::string &);
|
explicit MessageSource(const Anope::string &);
|
||||||
MessageSource(User *u);
|
MessageSource(User *u);
|
||||||
MessageSource(Server *s);
|
MessageSource(Server *s);
|
||||||
const Anope::string &GetName() const;
|
const Anope::string &GetName() const;
|
||||||
@@ -262,26 +345,57 @@ public:
|
|||||||
Server *GetServer() const;
|
Server *GetServer() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum IRCDMessageFlag
|
|
||||||
{
|
|
||||||
IRCDMESSAGE_SOFT_LIMIT,
|
|
||||||
IRCDMESSAGE_REQUIRE_SERVER,
|
|
||||||
IRCDMESSAGE_REQUIRE_USER
|
|
||||||
};
|
|
||||||
|
|
||||||
|
/** Base class for protocol module message handlers. */
|
||||||
class CoreExport IRCDMessage
|
class CoreExport IRCDMessage
|
||||||
: public Service
|
: public Service
|
||||||
{
|
{
|
||||||
Anope::string name;
|
|
||||||
unsigned param_count;
|
|
||||||
std::set<IRCDMessageFlag> flags;
|
|
||||||
public:
|
public:
|
||||||
IRCDMessage(Module *owner, const Anope::string &n, unsigned p = 0);
|
/** An enumeration of potential flags a command can have. */
|
||||||
unsigned GetParamCount() const;
|
enum Flag
|
||||||
virtual void Run(MessageSource &, const std::vector<Anope::string> ¶ms, const Anope::map<Anope::string> &tags) = 0;
|
: uint8_t
|
||||||
|
{
|
||||||
|
/** The parameter count is a minimum instead of an exact limit. */
|
||||||
|
FLAG_SOFT_LIMIT,
|
||||||
|
|
||||||
void SetFlag(IRCDMessageFlag f) { flags.insert(f); }
|
/** The message must come from a server. */
|
||||||
bool HasFlag(IRCDMessageFlag f) const { return flags.count(f); }
|
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 */
|
/** MessageTokenizer allows tokens in the IRC wire format to be read from a string */
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
#include "serialize.h"
|
#include "serialize.h"
|
||||||
#include "bots.h"
|
#include "bots.h"
|
||||||
|
|
||||||
typedef Anope::hash_map<ChannelInfo *> registered_channel_map;
|
typedef Anope::unordered_map<ChannelInfo *> registered_channel_map;
|
||||||
|
|
||||||
extern CoreExport Serialize::Checker<registered_channel_map> RegisteredChannelList;
|
extern CoreExport Serialize::Checker<registered_channel_map> RegisteredChannelList;
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ public:
|
|||||||
AutoKick();
|
AutoKick();
|
||||||
~AutoKick();
|
~AutoKick();
|
||||||
void Serialize(Serialize::Data &data) const override;
|
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)
|
/* It matters that Base is here before Extensible (it is inherited by Serializable)
|
||||||
@@ -95,10 +95,10 @@ public:
|
|||||||
ChannelInfo(const ChannelInfo &ci);
|
ChannelInfo(const ChannelInfo &ci);
|
||||||
|
|
||||||
~ChannelInfo();
|
~ChannelInfo();
|
||||||
ChannelInfo& operator=(const ChannelInfo &) = default;
|
ChannelInfo &operator=(const ChannelInfo &) = default;
|
||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override;
|
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
|
/** Change the founder of the channel
|
||||||
* @params nc The new founder
|
* @params nc The new founder
|
||||||
@@ -169,7 +169,7 @@ public:
|
|||||||
* @param t The time the akick was added, defaults to now
|
* @param t The time the akick was added, defaults to now
|
||||||
* @param lu The time the akick was last used, defaults to never
|
* @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
|
/** Add an akick entry to the channel by reason
|
||||||
* @param user The user who added the akick
|
* @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 t The time the akick was added, defaults to now
|
||||||
* @param lu The time the akick was last used, defaults to never
|
* @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
|
/** Get an entry from the channel akick list
|
||||||
* @param index The index in the akick vector
|
* @param index The index in the akick vector
|
||||||
* @return The akick structure, or NULL if not found
|
* @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
|
/** Get the size of the akick vector for this channel
|
||||||
* @return The akick vector size
|
* @return The akick vector size
|
||||||
@@ -238,7 +238,7 @@ public:
|
|||||||
* @param name channel name to lookup
|
* @param name channel name to lookup
|
||||||
* @return the ChannelInfo associated with the channel
|
* @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 AddChannelReference(const Anope::string &what);
|
||||||
void RemoveChannelReference(const Anope::string &what);
|
void RemoveChannelReference(const Anope::string &what);
|
||||||
|
|||||||
+10
-10
@@ -29,7 +29,7 @@ namespace Serialize
|
|||||||
|
|
||||||
virtual ~Data() = default;
|
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 std::set<Anope::string> KeySet() const { throw CoreException("Not supported"); }
|
||||||
virtual size_t Hash() 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
|
/** Get the type of serializable object this is
|
||||||
* @return The serializable object type
|
* @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;
|
virtual void Serialize(Serialize::Data &data) const = 0;
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ public:
|
|||||||
class CoreExport Serialize::Type final
|
class CoreExport Serialize::Type final
|
||||||
: public Base
|
: 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::vector<Anope::string> TypeOrder;
|
||||||
static std::map<Anope::string, Serialize::Type *> Types;
|
static std::map<Anope::string, Serialize::Type *> Types;
|
||||||
@@ -168,7 +168,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
void UpdateTimestamp();
|
void UpdateTimestamp();
|
||||||
|
|
||||||
Module* GetOwner() const { return this->owner; }
|
Module *GetOwner() const { return this->owner; }
|
||||||
|
|
||||||
static Serialize::Type *Find(const Anope::string &name);
|
static Serialize::Type *Find(const Anope::string &name);
|
||||||
|
|
||||||
@@ -201,23 +201,23 @@ class Serialize::Checker
|
|||||||
public:
|
public:
|
||||||
Checker(const Anope::string &n) : name(n) { }
|
Checker(const Anope::string &n) : name(n) { }
|
||||||
|
|
||||||
inline const T* operator->() const
|
inline const T *operator->() const
|
||||||
{
|
{
|
||||||
this->Check();
|
this->Check();
|
||||||
return &this->obj;
|
return &this->obj;
|
||||||
}
|
}
|
||||||
inline T* operator->()
|
inline T *operator->()
|
||||||
{
|
{
|
||||||
this->Check();
|
this->Check();
|
||||||
return &this->obj;
|
return &this->obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const T& operator*() const
|
inline const T &operator*() const
|
||||||
{
|
{
|
||||||
this->Check();
|
this->Check();
|
||||||
return this->obj;
|
return this->obj;
|
||||||
}
|
}
|
||||||
inline T& operator*()
|
inline T &operator*()
|
||||||
{
|
{
|
||||||
this->Check();
|
this->Check();
|
||||||
return this->obj;
|
return this->obj;
|
||||||
@@ -305,7 +305,7 @@ public:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline T* operator*() const
|
inline T *operator*() const
|
||||||
{
|
{
|
||||||
if (!this->invalid)
|
if (!this->invalid)
|
||||||
{
|
{
|
||||||
@@ -318,7 +318,7 @@ public:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline T* operator->() const
|
inline T *operator->() const
|
||||||
{
|
{
|
||||||
if (!this->invalid)
|
if (!this->invalid)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@ namespace Servers
|
|||||||
* the only server whose uplink *is* Me that is not a juped server.
|
* the only server whose uplink *is* Me that is not a juped server.
|
||||||
* @return Our uplink, or NULL if not uplinked to anything
|
* @return Our uplink, or NULL if not uplinked to anything
|
||||||
*/
|
*/
|
||||||
extern CoreExport Server* GetUplink();
|
extern CoreExport Server *GetUplink();
|
||||||
|
|
||||||
/* Server maps by name and id */
|
/* Server maps by name and id */
|
||||||
extern CoreExport Anope::map<Server *> ByName;
|
extern CoreExport Anope::map<Server *> ByName;
|
||||||
|
|||||||
+23
-29
@@ -11,39 +11,33 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstdarg>
|
||||||
|
#include <cstddef>
|
||||||
|
#include <cstdint>
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
#include <bitset>
|
||||||
|
#include <deque>
|
||||||
|
#include <exception>
|
||||||
|
#include <fstream>
|
||||||
|
#include <iostream>
|
||||||
|
#include <list>
|
||||||
|
#include <map>
|
||||||
|
#include <set>
|
||||||
|
#include <sstream>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "defs.h"
|
||||||
#include "sysconf.h"
|
#include "sysconf.h"
|
||||||
|
|
||||||
#define BUFSIZE 1024
|
#define BUFSIZE 1024
|
||||||
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <cstdarg>
|
|
||||||
#include <stdexcept>
|
|
||||||
|
|
||||||
#include <cstring>
|
|
||||||
|
|
||||||
#ifndef _WIN32
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Pull in the various bits of STL */
|
|
||||||
#include <cstdint>
|
|
||||||
#include <cstddef>
|
|
||||||
#include <iostream>
|
|
||||||
#include <fstream>
|
|
||||||
#include <sstream>
|
|
||||||
#include <map>
|
|
||||||
#include <exception>
|
|
||||||
#include <list>
|
|
||||||
#include <vector>
|
|
||||||
#include <deque>
|
|
||||||
#include <bitset>
|
|
||||||
#include <set>
|
|
||||||
#include <algorithm>
|
|
||||||
#include <iterator>
|
|
||||||
|
|
||||||
#include "defs.h"
|
|
||||||
|
|
||||||
#define _(x) x
|
#define _(x) x
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
|||||||
+1
-1
@@ -313,7 +313,7 @@ public:
|
|||||||
|
|
||||||
/** Gets the new line from the input buffer, if any
|
/** Gets the new line from the input buffer, if any
|
||||||
*/
|
*/
|
||||||
const Anope::string GetLine();
|
Anope::string GetLine();
|
||||||
|
|
||||||
/** Write to the socket
|
/** Write to the socket
|
||||||
* @param message The message
|
* @param message The message
|
||||||
|
|||||||
@@ -20,6 +20,9 @@
|
|||||||
// Whether Anope was built in debug mode.
|
// Whether Anope was built in debug mode.
|
||||||
#cmakedefine01 DEBUG_BUILD
|
#cmakedefine01 DEBUG_BUILD
|
||||||
|
|
||||||
|
// Whether the clock_gettime() function is available.
|
||||||
|
#cmakedefine01 HAVE_CLOCK_GETTIME
|
||||||
|
|
||||||
// Whether Anope was built with localization support.
|
// Whether Anope was built with localization support.
|
||||||
#cmakedefine01 HAVE_LOCALIZATION
|
#cmakedefine01 HAVE_LOCALIZATION
|
||||||
|
|
||||||
@@ -29,10 +32,6 @@
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# define popen _popen
|
# define popen _popen
|
||||||
# define pclose _pclose
|
# define pclose _pclose
|
||||||
# ifdef _MSC_VER
|
|
||||||
# define PATH_MAX MAX_PATH
|
|
||||||
# endif
|
|
||||||
# define sleep(x) Sleep(x * 1000)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined __GNUC__
|
#if defined __GNUC__
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
/* Handle for this thread */
|
/* Handle for this thread */
|
||||||
std::thread *handle = nullptr;
|
std::unique_ptr<std::thread> handle;
|
||||||
|
|
||||||
/** Threads destructor
|
/** Threads destructor
|
||||||
*/
|
*/
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ class CoreExport Timer
|
|||||||
private:
|
private:
|
||||||
/** The owner of the timer, if any
|
/** The owner of the timer, if any
|
||||||
*/
|
*/
|
||||||
Module *owner;
|
Module *owner = nullptr;
|
||||||
|
|
||||||
/** The triggering time
|
/** The triggering time
|
||||||
*/
|
*/
|
||||||
|
|||||||
+26
-17
@@ -13,10 +13,36 @@
|
|||||||
|
|
||||||
#include "sockets.h"
|
#include "sockets.h"
|
||||||
#include "protocol.h"
|
#include "protocol.h"
|
||||||
|
#include "servers.h"
|
||||||
|
|
||||||
namespace Uplink
|
namespace Uplink
|
||||||
{
|
{
|
||||||
extern void Connect();
|
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, { Anope::ToString(args)... });
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename... Args>
|
||||||
|
void Send(const Anope::map<Anope::string> &tags, const Anope::string &command, Args &&...args)
|
||||||
|
{
|
||||||
|
SendInternal(tags, Me, command, { Anope::ToString(args)... });
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename... Args>
|
||||||
|
void Send(const MessageSource &source, const Anope::string &command, Args &&...args)
|
||||||
|
{
|
||||||
|
SendInternal({}, source, command, { Anope::ToString(args)... });
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename... Args>
|
||||||
|
void Send(const Anope::string &command, Args &&...args)
|
||||||
|
{
|
||||||
|
SendInternal({}, Me, command, { Anope::ToString(args)... });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is the socket to our uplink */
|
/* This is the socket to our uplink */
|
||||||
@@ -31,22 +57,5 @@ public:
|
|||||||
bool ProcessRead() override;
|
bool ProcessRead() override;
|
||||||
void OnConnect() override;
|
void OnConnect() override;
|
||||||
void OnError(const Anope::string &) 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;
|
extern CoreExport UplinkSocket *UplinkSock;
|
||||||
|
|||||||
+8
-13
@@ -19,7 +19,7 @@
|
|||||||
#include "account.h"
|
#include "account.h"
|
||||||
#include "sockets.h"
|
#include "sockets.h"
|
||||||
|
|
||||||
typedef Anope::hash_map<User *> user_map;
|
typedef Anope::unordered_map<User *> user_map;
|
||||||
|
|
||||||
extern CoreExport user_map UserListByNick, UserListByUID;
|
extern CoreExport user_map UserListByNick, UserListByUID;
|
||||||
|
|
||||||
@@ -44,8 +44,6 @@ protected:
|
|||||||
Anope::string vident;
|
Anope::string vident;
|
||||||
Anope::string ident;
|
Anope::string ident;
|
||||||
Anope::string uid;
|
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) */
|
/* Map of user modes and the params this user has (if any) */
|
||||||
ModeList modes;
|
ModeList modes;
|
||||||
/* NickCore account the user is currently logged in as, if they are logged in */
|
/* NickCore account the user is currently logged in as, if they are logged in */
|
||||||
@@ -116,7 +114,7 @@ protected:
|
|||||||
virtual ~User();
|
virtual ~User();
|
||||||
|
|
||||||
public:
|
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
|
/** Update the nickname of a user record accordingly, should be
|
||||||
* called from ircd protocol.
|
* 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 char *fmt, ...) ATTR_FORMAT(3, 4);
|
||||||
void SendMessage(BotInfo *source, const Anope::string &msg) override;
|
void SendMessage(BotInfo *source, const Anope::string &msg) override;
|
||||||
|
void SendMessage(CommandSource &source, const Anope::string &msg) override;
|
||||||
|
|
||||||
/** Identify the user to a nick.
|
/** Identify the user to a nick.
|
||||||
* updates last_seen, logs the user in,
|
* updates last_seen, logs the user in,
|
||||||
@@ -222,12 +221,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool IsIdentified(bool check_nick = false) const;
|
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.
|
/** Check if the user is connected securely.
|
||||||
* @return True if the user is connected securely; otherwise, false.
|
* @return True if the user is connected securely; otherwise, false.
|
||||||
*/
|
*/
|
||||||
@@ -250,8 +243,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool HasPriv(const Anope::string &privstr);
|
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();
|
void UpdateHost();
|
||||||
|
|
||||||
/** Check if the user has a mode
|
/** Check if the user has a mode
|
||||||
@@ -368,12 +360,15 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool BadPassword();
|
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
|
/** Finds a user by nick, or possibly UID
|
||||||
* @param name The nick, or possibly UID, to lookup
|
* @param name The nick, or possibly UID, to lookup
|
||||||
* @param nick_only set to true to only look up by nick, not UID
|
* @param nick_only set to true to only look up by nick, not UID
|
||||||
* @return the user, if they exist
|
* @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
|
/** Quits all users who are pending to be quit
|
||||||
*/
|
*/
|
||||||
|
|||||||
+3
-3
@@ -45,7 +45,7 @@ public:
|
|||||||
bool IsRegex() const;
|
bool IsRegex() const;
|
||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override;
|
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. */
|
/* Managers XLines. There is one XLineManager per type of XLine. */
|
||||||
@@ -125,7 +125,7 @@ public:
|
|||||||
* @param index The index
|
* @param index The index
|
||||||
* @return The XLine, or NULL if the index is out of bounds
|
* @return The XLine, or NULL if the index is out of bounds
|
||||||
*/
|
*/
|
||||||
XLine* GetEntry(unsigned index);
|
XLine *GetEntry(unsigned index);
|
||||||
|
|
||||||
/** Clear the XLine vector
|
/** Clear the XLine vector
|
||||||
* Note: This does not remove the XLines from the IRCd
|
* Note: This does not remove the XLines from the IRCd
|
||||||
@@ -145,7 +145,7 @@ public:
|
|||||||
* @param mask The mask
|
* @param mask The mask
|
||||||
* @return The XLine the user matches, or NULL
|
* @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
|
/** Check a user against all of the xlines in this XLineManager
|
||||||
* @param u The user
|
* @param u The user
|
||||||
|
|||||||
+483
-614
File diff suppressed because it is too large
Load Diff
+19
-19
@@ -7,9 +7,9 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Anope\n"
|
"Project-Id-Version: Anope\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2024-01-08 13:20+0000\n"
|
"POT-Creation-Date: 2024-02-22 16:34+0000\n"
|
||||||
"PO-Revision-Date: 2024-01-08 13:33+0000\n"
|
"PO-Revision-Date: 2024-02-22 16:36+0000\n"
|
||||||
"Last-Translator: Thomas Fargeix <t.fargeix@gmail.com>\n"
|
"Last-Translator: Val Lorentz <progval+git@progval.net>\n"
|
||||||
"Language-Team: French\n"
|
"Language-Team: French\n"
|
||||||
"Language: fr_FR\n"
|
"Language: fr_FR\n"
|
||||||
"MIME-Version: 1.0\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."
|
msgstr "Le bans du bot n'expireront plus automatiquement."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Bot hosts may only be %d characters long."
|
msgid "Bot hosts may only be %zu characters long."
|
||||||
msgstr "Les hosts des bots ne doivent contenir que %d caractères."
|
msgstr "Les hosts des bots ne doivent contenir que %zu caractères."
|
||||||
|
|
||||||
msgid "Bot hosts may only contain valid host characters."
|
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."
|
msgstr "Les hosts des bots ne doivent contenir que des caractères valides pour un host."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Bot idents may only be %d characters long."
|
msgid "Bot idents may only be %zu characters long."
|
||||||
msgstr "Les ident des bots ne doivent contenir que %d caractères."
|
msgstr "Les ident des bots ne doivent contenir que %zu caractères."
|
||||||
|
|
||||||
msgid "Bot idents may only contain valid ident characters."
|
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."
|
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"
|
msgstr "Pseudo du bot"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Bot nicks may only be %d characters long."
|
msgid "Bot nicks may only be %zu characters long."
|
||||||
msgstr "Les pseudos des bots ne doivent contenir que %d caractères."
|
msgstr "Les pseudos des bots ne doivent contenir que %zu caractères."
|
||||||
|
|
||||||
msgid "Bot nicks may only contain valid nick characters."
|
msgid "Bot nicks may only contain valid nick characters."
|
||||||
msgstr "Les pseudos des bots ne peuvent contenir que des caractères valides."
|
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"
|
msgstr "Erreur en rechargeant le fichier de configuration : %s"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "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 "Erreur ! L'ident du vHost est trop long, merci d'utiliser un ident plus court que %d caractères."
|
msgstr "Erreur ! L'ident du vHost est trop long, merci d'utiliser un ident plus court que %zu caractères."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "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 "Erreur ! Le vHost est trop long, merci d'utiliser un hostname plus court que %d caractères."
|
msgstr "Erreur ! Le vHost est trop long, merci d'utiliser un hostname plus court que %zu caractères."
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Examples:\n"
|
"Examples:\n"
|
||||||
@@ -5140,8 +5140,8 @@ msgid "Nick %s isn't registered."
|
|||||||
msgstr "Le pseudo %s n'est pas enregistré."
|
msgstr "Le pseudo %s n'est pas enregistré."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nick %s was truncated to %u characters."
|
msgid "Nick %s was truncated to %zu characters."
|
||||||
msgstr "Le pseudo %s a été tronqué à %u caractères."
|
msgstr "Le pseudo %s a été tronqué à %zu caractères."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nick %s will expire."
|
msgid "Nick %s will expire."
|
||||||
@@ -5184,8 +5184,8 @@ msgid "Nick %s is now suspended."
|
|||||||
msgstr "Le pseudo %s a été suspendu."
|
msgstr "Le pseudo %s a été suspendu."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nick too long, max length is %u characters."
|
msgid "Nick too long, max length is %zu characters."
|
||||||
msgstr "Pseudo trop long, la taille maximale est de %u caractères."
|
msgstr "Pseudo trop long, la taille maximale est de %zu caractères."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nickname %s has been dropped."
|
msgid "Nickname %s has been dropped."
|
||||||
@@ -5714,7 +5714,7 @@ msgid ""
|
|||||||
"your nickname as a password is a much worse idea ;) and,\n"
|
"your nickname as a password is a much worse idea ;) and,\n"
|
||||||
"in fact, %s will not allow it. Also, short\n"
|
"in fact, %s will not allow it. Also, short\n"
|
||||||
"passwords are vulnerable to trial-and-error searches, so\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."
|
"Finally, the space character cannot be used in passwords."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Enregistre votre pseudo dans la base de données de %s.\n"
|
"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"
|
"ne vous laissera pas faire.. De même, les mots de passe\n"
|
||||||
"courts sont vulnérables aux recherches méthodiques,\n"
|
"courts sont vulnérables aux recherches méthodiques,\n"
|
||||||
"donc vous devez choisir un mot de passe d'au moins \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."
|
"utilisé dans les mots de passe."
|
||||||
|
|
||||||
msgid "Registration is currently disabled."
|
msgid "Registration is currently disabled."
|
||||||
|
|||||||
+18
-18
@@ -7,8 +7,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Anope\n"
|
"Project-Id-Version: Anope\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2024-01-08 13:20+0000\n"
|
"POT-Creation-Date: 2024-02-22 16:34+0000\n"
|
||||||
"PO-Revision-Date: 2024-01-08 13:40+0000\n"
|
"PO-Revision-Date: 2024-02-22 16:38+0000\n"
|
||||||
"Last-Translator: Dragone2 <dragone2@risposteinformatiche.it>\n"
|
"Last-Translator: Dragone2 <dragone2@risposteinformatiche.it>\n"
|
||||||
"Language-Team: Italian\n"
|
"Language-Team: Italian\n"
|
||||||
"Language: it_IT\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."
|
msgstr "I ban del bot non scadranno automaticamente."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Bot hosts may only be %d characters long."
|
msgid "Bot hosts may only be %zu characters long."
|
||||||
msgstr "Gli host dei bot possono contenere solamente %d caratteri."
|
msgstr "Gli host dei bot possono contenere solamente %zu caratteri."
|
||||||
|
|
||||||
msgid "Bot hosts may only contain valid host characters."
|
msgid "Bot hosts may only contain valid host characters."
|
||||||
msgstr "Gli host dei bot possono contenere unicamente caratteri validi."
|
msgstr "Gli host dei bot possono contenere unicamente caratteri validi."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Bot idents may only be %d characters long."
|
msgid "Bot idents may only be %zu characters long."
|
||||||
msgstr "Le ident dei bot possono contenere solamente %d caratteri."
|
msgstr "Le ident dei bot possono contenere solamente %zu caratteri."
|
||||||
|
|
||||||
msgid "Bot idents may only contain valid ident characters."
|
msgid "Bot idents may only contain valid ident characters."
|
||||||
msgstr "Le ident dei bot possono contenere unicamente caratteri validi."
|
msgstr "Le ident dei bot possono contenere unicamente caratteri validi."
|
||||||
@@ -2661,8 +2661,8 @@ msgid "Bot nick"
|
|||||||
msgstr "Bot nick"
|
msgstr "Bot nick"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Bot nicks may only be %d characters long."
|
msgid "Bot nicks may only be %zu characters long."
|
||||||
msgstr "I nick dei Bot possono contenere solamente %d caratteri."
|
msgstr "I nick dei Bot possono contenere solamente %zu caratteri."
|
||||||
|
|
||||||
msgid "Bot nicks may only contain valid nick characters."
|
msgid "Bot nicks may only contain valid nick characters."
|
||||||
msgstr "I nick dei bot possono contenere unicamente caratteri validi."
|
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"
|
msgstr "Errore durante il ricaricamento del file di configurazione: %s"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "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 "Errore! L'ident del vHost è troppo lunga, usa una ident più corta di %d caratteri."
|
msgstr "Errore! L'ident del vHost è troppo lunga, usa una ident più corta di %zu caratteri."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "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 "Errore! Il vHost è troppo lungo, usa un hostname più corto di %d caratteri."
|
msgstr "Errore! Il vHost è troppo lungo, usa un hostname più corto di %zu caratteri."
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Examples:\n"
|
"Examples:\n"
|
||||||
@@ -5143,8 +5143,8 @@ msgid "Nick %s isn't registered."
|
|||||||
msgstr "Il nick %s non è registrato."
|
msgstr "Il nick %s non è registrato."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nick %s was truncated to %u characters."
|
msgid "Nick %s was truncated to %zu characters."
|
||||||
msgstr "Il nick %s è stato troncato a %u caratteri."
|
msgstr "Il nick %s è stato troncato a %zu caratteri."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nick %s will expire."
|
msgid "Nick %s will expire."
|
||||||
@@ -5187,8 +5187,8 @@ msgid "Nick %s is now suspended."
|
|||||||
msgstr "Il nick %s è ora sospeso."
|
msgstr "Il nick %s è ora sospeso."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nick too long, max length is %u characters."
|
msgid "Nick too long, max length is %zu characters."
|
||||||
msgstr "Nick troppo lungo, lunghezza massima consentita %u caratteri."
|
msgstr "Nick troppo lungo, lunghezza massima consentita %zu caratteri."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nickname %s has been dropped."
|
msgid "Nickname %s has been dropped."
|
||||||
@@ -5716,7 +5716,7 @@ msgid ""
|
|||||||
"your nickname as a password is a much worse idea ;) and,\n"
|
"your nickname as a password is a much worse idea ;) and,\n"
|
||||||
"in fact, %s will not allow it. Also, short\n"
|
"in fact, %s will not allow it. Also, short\n"
|
||||||
"passwords are vulnerable to trial-and-error searches, so\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."
|
"Finally, the space character cannot be used in passwords."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Registra il tuo nick nel database di %s. Quando il\n"
|
"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"
|
"anche peggiore, infatti %s non ti permetterà di farlo.\n"
|
||||||
"Inoltre, le password brevi sono facili da indovinare con\n"
|
"Inoltre, le password brevi sono facili da indovinare con\n"
|
||||||
"meno tentativi, pertanto è necessario scegliere una password \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."
|
"usati all'interno di una password."
|
||||||
|
|
||||||
msgid "Registration is currently disabled."
|
msgid "Registration is currently disabled."
|
||||||
|
|||||||
+19
-18
@@ -7,8 +7,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Anope\n"
|
"Project-Id-Version: Anope\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2024-01-30 04:54+0100\n"
|
"POT-Creation-Date: 2024-02-22 16:34+0000\n"
|
||||||
"PO-Revision-Date: 2024-01-31 05:55+0100\n"
|
"PO-Revision-Date: 2024-02-22 16:39+0000\n"
|
||||||
"Last-Translator: Robby <robby@chatbelgie.be>\n"
|
"Last-Translator: Robby <robby@chatbelgie.be>\n"
|
||||||
"Language-Team: Dutch\n"
|
"Language-Team: Dutch\n"
|
||||||
"Language: nl_NL\n"
|
"Language: nl_NL\n"
|
||||||
@@ -16,6 +16,7 @@ msgstr ""
|
|||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
"X-Generator: Poedit 3.4\n"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%d channel(s) cleared, and %d channel(s) dropped."
|
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."
|
msgstr "Bot bans zullen niet langer automatisch verlopen."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Bot hosts may only be %d characters long."
|
msgid "Bot hosts may only be %zu characters long."
|
||||||
msgstr "Bot hosts mogen maximaal %d karakters bevatten."
|
msgstr "Bot hosts mogen maximaal %zu karakters bevatten."
|
||||||
|
|
||||||
msgid "Bot hosts may only contain valid host characters."
|
msgid "Bot hosts may only contain valid host characters."
|
||||||
msgstr "Bot hosts mogen alleen geldige host-karakters bevatten."
|
msgstr "Bot hosts mogen alleen geldige host-karakters bevatten."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Bot idents may only be %d characters long."
|
msgid "Bot idents may only be %zu characters long."
|
||||||
msgstr "Bot idents mogen maximaal %d karakters bevatten."
|
msgstr "Bot idents mogen maximaal %zu karakters bevatten."
|
||||||
|
|
||||||
msgid "Bot idents may only contain valid ident characters."
|
msgid "Bot idents may only contain valid ident characters."
|
||||||
msgstr "Bot idents mogen alleen geldige ident-karakters bevatten."
|
msgstr "Bot idents mogen alleen geldige ident-karakters bevatten."
|
||||||
@@ -2667,8 +2668,8 @@ msgid "Bot nick"
|
|||||||
msgstr "Bot nick"
|
msgstr "Bot nick"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Bot nicks may only be %d characters long."
|
msgid "Bot nicks may only be %zu characters long."
|
||||||
msgstr "Bot nicks mogen maximaal %d karakters bevatten."
|
msgstr "Bot nicks mogen maximaal %zu karakters bevatten."
|
||||||
|
|
||||||
msgid "Bot nicks may only contain valid nick characters."
|
msgid "Bot nicks may only contain valid nick characters."
|
||||||
msgstr "Bot nicks mogen alleen geldige nick-karakters bevatten."
|
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"
|
msgstr "Fout bij laden configuratiebestand: %s"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "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 "Fout! De vHost ident is te lang, gelieve een ident korter dan %d karakters op te geven."
|
msgstr "Fout! De vHost ident is te lang, gelieve een ident korter dan %zu karakters op te geven."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "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 "Fout! De vHost is te lang, gelieve een host korter dan %d karakters op te geven."
|
msgstr "Fout! De vHost is te lang, gelieve een host korter dan %zu karakters op te geven."
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Examples:\n"
|
"Examples:\n"
|
||||||
@@ -5156,8 +5157,8 @@ msgid "Nick %s isn't registered."
|
|||||||
msgstr "Nick %s is niet geregistreerd."
|
msgstr "Nick %s is niet geregistreerd."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nick %s was truncated to %u characters."
|
msgid "Nick %s was truncated to %zu characters."
|
||||||
msgstr "Nick %s werd verkort naar %u karakters."
|
msgstr "Nick %s werd verkort naar %zu karakters."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nick %s will expire."
|
msgid "Nick %s will expire."
|
||||||
@@ -5200,8 +5201,8 @@ msgid "Nick %s is now suspended."
|
|||||||
msgstr "Nick %s is nu geschorst."
|
msgstr "Nick %s is nu geschorst."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nick too long, max length is %u characters."
|
msgid "Nick too long, max length is %zu characters."
|
||||||
msgstr "Nick te lang, maximum lengte is %u karakters."
|
msgstr "Nick te lang, maximum lengte is %zu karakters."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nickname %s has been dropped."
|
msgid "Nickname %s has been dropped."
|
||||||
@@ -5730,7 +5731,7 @@ msgid ""
|
|||||||
"your nickname as a password is a much worse idea ;) and,\n"
|
"your nickname as a password is a much worse idea ;) and,\n"
|
||||||
"in fact, %s will not allow it. Also, short\n"
|
"in fact, %s will not allow it. Also, short\n"
|
||||||
"passwords are vulnerable to trial-and-error searches, so\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."
|
"Finally, the space character cannot be used in passwords."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Registreert je nick in de %s database. Wanneer je nick\n"
|
"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"
|
"nick als een wachtwoord gebruiken is een veel slechter idee ;)\n"
|
||||||
"en in feite, %s staat het niet toe. Bovendien zijn korte wachtwoorden\n"
|
"en in feite, %s staat het niet toe. Bovendien zijn korte wachtwoorden\n"
|
||||||
"kwetsbaar voor zoekacties, dus kies je best een wachtwoord\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."
|
"gebruikt worden in wachtwoorden."
|
||||||
|
|
||||||
msgid "Registration is currently disabled."
|
msgid "Registration is currently disabled."
|
||||||
|
|||||||
+19
-19
@@ -7,9 +7,9 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Anope\n"
|
"Project-Id-Version: Anope\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2024-01-08 13:20+0000\n"
|
"POT-Creation-Date: 2024-02-22 16:34+0000\n"
|
||||||
"PO-Revision-Date: 2024-01-08 13:46+0000\n"
|
"PO-Revision-Date: 2024-02-22 16:42+0000\n"
|
||||||
"Last-Translator: Adam <adam@anope.org>\n"
|
"Last-Translator: k4be <k4be@pirc.pl>\n"
|
||||||
"Language-Team: Polish\n"
|
"Language-Team: Polish\n"
|
||||||
"Language: pl_PL\n"
|
"Language: pl_PL\n"
|
||||||
"MIME-Version: 1.0\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."
|
msgstr "Bany zakładane przez bota nie będą już się przedawniały."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Bot hosts may only be %d characters long."
|
msgid "Bot hosts may only be %zu characters long."
|
||||||
msgstr "Host bota może się składać maksymalnie z %d znaków."
|
msgstr "Host bota może się składać maksymalnie z %zu znaków."
|
||||||
|
|
||||||
msgid "Bot hosts may only contain valid host characters."
|
msgid "Bot hosts may only contain valid host characters."
|
||||||
msgstr "Host bota może zawierać tylko prawidłowe znaki."
|
msgstr "Host bota może zawierać tylko prawidłowe znaki."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Bot idents may only be %d characters long."
|
msgid "Bot idents may only be %zu characters long."
|
||||||
msgstr "Ident bota może się składać maksymalnie z %d znaków."
|
msgstr "Ident bota może się składać maksymalnie z %zu znaków."
|
||||||
|
|
||||||
msgid "Bot idents may only contain valid ident characters."
|
msgid "Bot idents may only contain valid ident characters."
|
||||||
msgstr "Ident bota może zawierać tylko prawidłowe znaki."
|
msgstr "Ident bota może zawierać tylko prawidłowe znaki."
|
||||||
@@ -2656,8 +2656,8 @@ msgid "Bot nick"
|
|||||||
msgstr "Nick bota"
|
msgstr "Nick bota"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Bot nicks may only be %d characters long."
|
msgid "Bot nicks may only be %zu characters long."
|
||||||
msgstr "Nick bota może się składać maksymalnie z %d znaków."
|
msgstr "Nick bota może się składać maksymalnie z %zu znaków."
|
||||||
|
|
||||||
msgid "Bot nicks may only contain valid nick characters."
|
msgid "Bot nicks may only contain valid nick characters."
|
||||||
msgstr "Nick bota może zawierać tylko prawidłowe znaki."
|
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"
|
msgstr "Błąd przeładowywania pliku konfiguracyjnego: %s"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "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 "Błąd: podany wirtualny ident jest zbyt długi. Proszę użyć nazwy krótszej niż %d znaków."
|
msgstr "Błąd: podany wirtualny ident jest zbyt długi. Proszę użyć nazwy krótszej niż %zu znaków."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "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 "Błąd: podany vHost jest zbyt długi. Proszę użyć nazwy krótszej niż %d znaków."
|
msgstr "Błąd: podany vHost jest zbyt długi. Proszę użyć nazwy krótszej niż %zu znaków."
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Examples:\n"
|
"Examples:\n"
|
||||||
@@ -5126,8 +5126,8 @@ msgid "Nick %s isn't registered."
|
|||||||
msgstr "Nick %s nie jest zarejestrowany."
|
msgstr "Nick %s nie jest zarejestrowany."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nick %s was truncated to %u characters."
|
msgid "Nick %s was truncated to %zu characters."
|
||||||
msgstr "Nick %s został skrócony do %u znaków."
|
msgstr "Nick %s został skrócony do %zu znaków."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nick %s will expire."
|
msgid "Nick %s will expire."
|
||||||
@@ -5170,8 +5170,8 @@ msgid "Nick %s is now suspended."
|
|||||||
msgstr "Nick %s został zawieszony."
|
msgstr "Nick %s został zawieszony."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nick too long, max length is %u characters."
|
msgid "Nick too long, max length is %zu characters."
|
||||||
msgstr "Zbyt długi nick. Maksymalna długość to %u znaków."
|
msgstr "Zbyt długi nick. Maksymalna długość to %zu znaków."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nickname %s has been dropped."
|
msgid "Nickname %s has been dropped."
|
||||||
@@ -5697,7 +5697,7 @@ msgid ""
|
|||||||
"your nickname as a password is a much worse idea ;) and,\n"
|
"your nickname as a password is a much worse idea ;) and,\n"
|
||||||
"in fact, %s will not allow it. Also, short\n"
|
"in fact, %s will not allow it. Also, short\n"
|
||||||
"passwords are vulnerable to trial-and-error searches, so\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."
|
"Finally, the space character cannot be used in passwords."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Rejestruje aktualnie używany nick w bazie %s.\n"
|
"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"
|
"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"
|
"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"
|
"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."
|
"Znak spacji nie może być użyty w haśle."
|
||||||
|
|
||||||
msgid "Registration is currently disabled."
|
msgid "Registration is currently disabled."
|
||||||
|
|||||||
+19
-19
@@ -7,8 +7,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Anope\n"
|
"Project-Id-Version: Anope\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2024-01-22 19:47+0000\n"
|
"POT-Creation-Date: 2024-02-22 16:34+0000\n"
|
||||||
"PO-Revision-Date: 2024-01-22 22:41+0300\n"
|
"PO-Revision-Date: 2024-02-22 16:43+0000\n"
|
||||||
"Last-Translator: CaPaCuL <capacul@gmail.com>\n"
|
"Last-Translator: CaPaCuL <capacul@gmail.com>\n"
|
||||||
"Language-Team: Turkish\n"
|
"Language-Team: Turkish\n"
|
||||||
"Language: tr_TR\n"
|
"Language: tr_TR\n"
|
||||||
@@ -16,7 +16,7 @@ msgstr ""
|
|||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
"X-Generator: Poedit 3.4.2\n"
|
"X-Generator: Poedit 3.4\n"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%d channel(s) cleared, and %d channel(s) dropped."
|
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."
|
msgstr "Bot banları artık otomatik olarak sona ermeyecek."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Bot hosts may only be %d characters long."
|
msgid "Bot hosts may only be %zu characters long."
|
||||||
msgstr "Bot hostları yalnızca %d karakter uzunluğunda olabilir."
|
msgstr "Bot hostları yalnızca %zu karakter uzunluğunda olabilir."
|
||||||
|
|
||||||
msgid "Bot hosts may only contain valid host characters."
|
msgid "Bot hosts may only contain valid host characters."
|
||||||
msgstr "Bot hostları yalnızca geçerli host karakterlerini içerebilir."
|
msgstr "Bot hostları yalnızca geçerli host karakterlerini içerebilir."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Bot idents may only be %d characters long."
|
msgid "Bot idents may only be %zu characters long."
|
||||||
msgstr "Bot identleri yalnızca %d karakter uzunluğunda olabilir."
|
msgstr "Bot identleri yalnızca %zu karakter uzunluğunda olabilir."
|
||||||
|
|
||||||
msgid "Bot idents may only contain valid ident characters."
|
msgid "Bot idents may only contain valid ident characters."
|
||||||
msgstr "Bot identleri yalnızca geçerli ident karakterlerini içerebilir."
|
msgstr "Bot identleri yalnızca geçerli ident karakterlerini içerebilir."
|
||||||
@@ -2650,8 +2650,8 @@ msgid "Bot nick"
|
|||||||
msgstr "Bot rumuzu"
|
msgstr "Bot rumuzu"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Bot nicks may only be %d characters long."
|
msgid "Bot nicks may only be %zu characters long."
|
||||||
msgstr "Bot rumuzları yalnızca %d karakter uzunluğunda olabilir."
|
msgstr "Bot rumuzları yalnızca %zu karakter uzunluğunda olabilir."
|
||||||
|
|
||||||
msgid "Bot nicks may only contain valid nick characters."
|
msgid "Bot nicks may only contain valid nick characters."
|
||||||
msgstr "Bot rumuzları yalnızca geçerli rumuz karakterlerini içerebilir."
|
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"
|
msgstr "Yapılandırma dosyası yeniden yüklenirken hata oluştu: %s"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "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 "Hata! vHost kimliği çok uzun, lütfen %d karakterden daha kısa bir ident kullanın."
|
msgstr "Hata! vHost kimliği çok uzun, lütfen %zu karakterden daha kısa bir ident kullanın."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "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 "Hata! vHost çok uzun, lütfen %d karakterden kısa bir host adı kullanın."
|
msgstr "Hata! vHost çok uzun, lütfen %zu karakterden kısa bir host adı kullanın."
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"Examples:\n"
|
"Examples:\n"
|
||||||
@@ -5106,8 +5106,8 @@ msgid "Nick %s isn't registered."
|
|||||||
msgstr "%s rumuzu kayıtlı değil."
|
msgstr "%s rumuzu kayıtlı değil."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nick %s was truncated to %u characters."
|
msgid "Nick %s was truncated to %zu characters."
|
||||||
msgstr "%s rumuzu, %u karaktere kısaltıldı."
|
msgstr "%s rumuzu, %zu karaktere kısaltıldı."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nick %s will expire."
|
msgid "Nick %s will expire."
|
||||||
@@ -5150,8 +5150,8 @@ msgid "Nick %s is now suspended."
|
|||||||
msgstr "%s rumuzu askıya alınmış."
|
msgstr "%s rumuzu askıya alınmış."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nick too long, max length is %u characters."
|
msgid "Nick too long, max length is %zu characters."
|
||||||
msgstr "Rumuz çok uzun, maks uzunluk %u karakterdir."
|
msgstr "Rumuz çok uzun, maks uzunluk %zu karakterdir."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nickname %s has been dropped."
|
msgid "Nickname %s has been dropped."
|
||||||
@@ -5680,7 +5680,7 @@ msgid ""
|
|||||||
"your nickname as a password is a much worse idea ;) and,\n"
|
"your nickname as a password is a much worse idea ;) and,\n"
|
||||||
"in fact, %s will not allow it. Also, short\n"
|
"in fact, %s will not allow it. Also, short\n"
|
||||||
"passwords are vulnerable to trial-and-error searches, so\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."
|
"Finally, the space character cannot be used in passwords."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Rumuzunuzu %s veritabanına kaydedin. Rumuzunuz kaydedildikten\n"
|
"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"
|
"gerçek adınızı şifre olarak kullanmak kötü bir fikirdir.\n"
|
||||||
"Rumuzunuzu şifre olarak kullanmak çok daha kötü bir fikir ;)\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"
|
"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"
|
"karakter uzunluğunda bir şifre seçmelisiniz. Son\n"
|
||||||
"olarak boşluk karakteri şifrelerde kullanılamaz."
|
"olarak boşluk karakteri şifrelerde kullanılamaz."
|
||||||
|
|
||||||
|
|||||||
@@ -19,18 +19,13 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../conanbuildinfo.cmake")
|
|||||||
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/extra/${NAME}.cpp" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}")
|
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/extra/${NAME}.cpp" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
enable_extra("enc_argon2" "ARGON2")
|
||||||
enable_extra("mysql" "LIBMYSQLCLIENT")
|
enable_extra("mysql" "LIBMYSQLCLIENT")
|
||||||
enable_extra("regex_pcre2" "PCRE2")
|
enable_extra("regex_pcre2" "PCRE2")
|
||||||
enable_extra("sqlite" "SQLITE3")
|
enable_extra("sqlite" "SQLITE3")
|
||||||
enable_extra("ssl_openssl" "OPENSSL")
|
enable_extra("ssl_openssl" "OPENSSL")
|
||||||
# this uses Wldap so should always be available
|
# this uses Wldap so should always be available
|
||||||
copy_extra("ldap")
|
copy_extra("ldap")
|
||||||
# these don't actually have extra dependencies, but require a module which does
|
|
||||||
copy_extra("sql_authentication")
|
|
||||||
copy_extra("sql_log")
|
|
||||||
copy_extra("sql_oper")
|
|
||||||
copy_extra("ldap_authentication")
|
|
||||||
copy_extra("ldap_oper")
|
|
||||||
|
|
||||||
# Package extra dlls
|
# Package extra dlls
|
||||||
file(GLOB EXTRA_DLLS "${Anope_SOURCE_DIR}/extradll/bin/*.dll" "${Anope_SOURCE_DIR}/extradll/lib/*.dll")
|
file(GLOB EXTRA_DLLS "${Anope_SOURCE_DIR}/extradll/bin/*.dll" "${Anope_SOURCE_DIR}/extradll/lib/*.dll")
|
||||||
|
|||||||
@@ -67,12 +67,8 @@ public:
|
|||||||
|
|
||||||
Anope::string Limit;
|
Anope::string Limit;
|
||||||
unsigned limit = 0;
|
unsigned limit = 0;
|
||||||
try
|
if (c->GetParam("LIMIT", Limit))
|
||||||
{
|
limit = Anope::Convert<unsigned>(Limit, limit);
|
||||||
if (c->GetParam("LIMIT", Limit))
|
|
||||||
limit = convertTo<unsigned>(Limit);
|
|
||||||
}
|
|
||||||
catch (const ConvertException &) { }
|
|
||||||
|
|
||||||
/* Should we be invited? */
|
/* Should we be invited? */
|
||||||
if (c->HasMode("INVITE") || (limit && c->users.size() >= limit))
|
if (c->HasMode("INVITE") || (limit && c->users.size() >= limit))
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public:
|
|||||||
|
|
||||||
if (Anope::ReadOnly)
|
if (Anope::ReadOnly)
|
||||||
{
|
{
|
||||||
source.Reply(_("Sorry, bot assignment is temporarily disabled."));
|
source.Reply(READ_ONLY_MODE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (Anope::ReadOnly)
|
if (Anope::ReadOnly)
|
||||||
{
|
{
|
||||||
source.Reply(_("Sorry, bot assignment is temporarily disabled."));
|
source.Reply(READ_ONLY_MODE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ public:
|
|||||||
|
|
||||||
if (Anope::ReadOnly)
|
if (Anope::ReadOnly)
|
||||||
{
|
{
|
||||||
source.Reply(_("Sorry, bot modification is temporarily disabled."));
|
source.Reply(READ_ONLY_MODE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ struct BadWordImpl final
|
|||||||
data.SetType("type", Serialize::Data::DT_INT); data["type"] << this->type;
|
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
|
struct BadWordsImpl final
|
||||||
@@ -40,7 +40,7 @@ struct BadWordsImpl final
|
|||||||
|
|
||||||
~BadWordsImpl() override;
|
~BadWordsImpl() override;
|
||||||
|
|
||||||
BadWord* AddBadWord(const Anope::string &word, BadWordType type) override
|
BadWord *AddBadWord(const Anope::string &word, BadWordType type) override
|
||||||
{
|
{
|
||||||
auto *bw = new BadWordImpl();
|
auto *bw = new BadWordImpl();
|
||||||
bw->chan = ci->name;
|
bw->chan = ci->name;
|
||||||
@@ -54,7 +54,7 @@ struct BadWordsImpl final
|
|||||||
return bw;
|
return bw;
|
||||||
}
|
}
|
||||||
|
|
||||||
BadWord* GetBadWord(unsigned index) const override
|
BadWord *GetBadWord(unsigned index) const override
|
||||||
{
|
{
|
||||||
if (this->badwords->empty() || index >= this->badwords->size())
|
if (this->badwords->empty() || index >= this->badwords->size())
|
||||||
return NULL;
|
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;
|
Anope::string sci, sword;
|
||||||
|
|
||||||
@@ -222,7 +222,7 @@ private:
|
|||||||
|
|
||||||
const BadWord *b = bw->GetBadWord(Number - 1);
|
const BadWord *b = bw->GetBadWord(Number - 1);
|
||||||
ListFormatter::ListEntry entry;
|
ListFormatter::ListEntry entry;
|
||||||
entry["Number"] = stringify(Number);
|
entry["Number"] = Anope::ToString(Number);
|
||||||
entry["Word"] = b->word;
|
entry["Word"] = b->word;
|
||||||
entry["Type"] = b->type == BW_SINGLE ? "(SINGLE)" : (b->type == BW_START ? "(START)" : (b->type == BW_END ? "(END)" : ""));
|
entry["Type"] = b->type == BW_SINGLE ? "(SINGLE)" : (b->type == BW_START ? "(START)" : (b->type == BW_END ? "(END)" : ""));
|
||||||
this->list.AddEntry(entry);
|
this->list.AddEntry(entry);
|
||||||
@@ -241,7 +241,7 @@ private:
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
ListFormatter::ListEntry entry;
|
ListFormatter::ListEntry entry;
|
||||||
entry["Number"] = stringify(i + 1);
|
entry["Number"] = Anope::ToString(i + 1);
|
||||||
entry["Word"] = b->word;
|
entry["Word"] = b->word;
|
||||||
entry["Type"] = b->type == BW_SINGLE ? "(SINGLE)" : (b->type == BW_START ? "(START)" : (b->type == BW_END ? "(END)" : ""));
|
entry["Type"] = b->type == BW_SINGLE ? "(SINGLE)" : (b->type == BW_START ? "(START)" : (b->type == BW_END ? "(END)" : ""));
|
||||||
list.AddEntry(entry);
|
list.AddEntry(entry);
|
||||||
@@ -407,7 +407,7 @@ public:
|
|||||||
|
|
||||||
if (Anope::ReadOnly)
|
if (Anope::ReadOnly)
|
||||||
{
|
{
|
||||||
source.Reply(_("Sorry, bad words list modification is temporarily disabled."));
|
source.Reply(READ_ONLY_MODE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+14
-17
@@ -28,23 +28,21 @@ private:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Configuration::Block *networkinfo = Config->GetBlock("networkinfo");
|
if (nick.length() > IRCD->MaxNick)
|
||||||
|
|
||||||
if (nick.length() > networkinfo->Get<unsigned>("nicklen"))
|
|
||||||
{
|
{
|
||||||
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->MaxNick);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.length() > networkinfo->Get<unsigned>("userlen"))
|
if (user.length() > IRCD->MaxUser)
|
||||||
{
|
{
|
||||||
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->MaxUser);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (host.length() > networkinfo->Get<unsigned>("hostlen"))
|
if (host.length() > IRCD->MaxHost)
|
||||||
{
|
{
|
||||||
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->MaxHost);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,23 +118,22 @@ private:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Configuration::Block *networkinfo = Config->GetBlock("networkinfo");
|
if (nick.length() > IRCD->MaxNick)
|
||||||
|
|
||||||
if (nick.length() > networkinfo->Get<unsigned>("nicklen"))
|
|
||||||
{
|
{
|
||||||
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->MaxNick);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.length() > networkinfo->Get<unsigned>("userlen"))
|
if (user.length() > IRCD->MaxUser)
|
||||||
{
|
{
|
||||||
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->MaxUser);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (host.length() > networkinfo->Get<unsigned>("hostlen"))
|
if (host.length() > IRCD->MaxHost)
|
||||||
{
|
{
|
||||||
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->MaxHost
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,7 +276,7 @@ public:
|
|||||||
|
|
||||||
if (Anope::ReadOnly)
|
if (Anope::ReadOnly)
|
||||||
{
|
{
|
||||||
source.Reply(_("Sorry, bot modification is temporarily disabled."));
|
source.Reply(READ_ONLY_MODE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class CommandBSInfo final
|
|||||||
: public Command
|
: public Command
|
||||||
{
|
{
|
||||||
private:
|
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;
|
Anope::string buf;
|
||||||
for (const auto &[_, ci] : *RegisteredChannelList)
|
for (const auto &[_, ci] : *RegisteredChannelList)
|
||||||
@@ -55,7 +55,7 @@ public:
|
|||||||
info[_("Real name")] = bi->realname;
|
info[_("Real name")] = bi->realname;
|
||||||
info[_("Created")] = Anope::strftime(bi->created, source.GetAccount());
|
info[_("Created")] = Anope::strftime(bi->created, source.GetAccount());
|
||||||
info[_("Options")] = bi->oper_only ? _("Private") : _("None");
|
info[_("Options")] = bi->oper_only ? _("Private") : _("None");
|
||||||
info[_("Used on")] = stringify(bi->GetChannelCount()) + " channel(s)";
|
info[_("Used on")] = Anope::ToString(bi->GetChannelCount()) + " channel(s)";
|
||||||
|
|
||||||
FOREACH_MOD(OnBotInfo, (source, bi, ci, info));
|
FOREACH_MOD(OnBotInfo, (source, bi, ci, info));
|
||||||
|
|
||||||
|
|||||||
+28
-82
@@ -106,11 +106,10 @@ struct KickerDataImpl final
|
|||||||
data["ttb"] >> ttb;
|
data["ttb"] >> ttb;
|
||||||
spacesepstream sep(ttb);
|
spacesepstream sep(ttb);
|
||||||
for (int i = 0; sep.GetToken(tok) && i < TTB_SIZE; ++i)
|
for (int i = 0; sep.GetToken(tok) && i < TTB_SIZE; ++i)
|
||||||
try
|
{
|
||||||
{
|
if (auto n = Anope::TryConvert<int16_t>(tok))
|
||||||
kd->ttb[i] = convertTo<int16_t>(tok);
|
kd->ttb[i] = n.value();
|
||||||
}
|
}
|
||||||
catch (const ConvertException &) { }
|
|
||||||
|
|
||||||
kd->Check(ci);
|
kd->Check(ci);
|
||||||
}
|
}
|
||||||
@@ -175,7 +174,7 @@ public:
|
|||||||
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override = 0;
|
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override = 0;
|
||||||
|
|
||||||
protected:
|
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 &chan = params[0];
|
||||||
const Anope::string &option = params[1];
|
const Anope::string &option = params[1];
|
||||||
@@ -183,7 +182,7 @@ protected:
|
|||||||
ci = ChannelInfo::Find(chan);
|
ci = ChannelInfo::Find(chan);
|
||||||
|
|
||||||
if (Anope::ReadOnly)
|
if (Anope::ReadOnly)
|
||||||
source.Reply(_("Sorry, kicker configuration is temporarily disabled."));
|
source.Reply(READ_ONLY_MODE);
|
||||||
else if (ci == NULL)
|
else if (ci == NULL)
|
||||||
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||||
else if (option.empty())
|
else if (option.empty())
|
||||||
@@ -206,21 +205,13 @@ protected:
|
|||||||
{
|
{
|
||||||
if (!ttb.empty())
|
if (!ttb.empty())
|
||||||
{
|
{
|
||||||
int16_t i;
|
kd->ttb[ttb_idx] = Anope::Convert<int16_t>(ttb, -1);
|
||||||
|
if (kd->ttb[ttb_idx] < 0)
|
||||||
try
|
|
||||||
{
|
|
||||||
i = convertTo<int16_t>(ttb);
|
|
||||||
if (i < 0)
|
|
||||||
throw ConvertException();
|
|
||||||
}
|
|
||||||
catch (const ConvertException &)
|
|
||||||
{
|
{
|
||||||
|
kd->ttb[ttb_idx] = 0;
|
||||||
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
|
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
kd->ttb[ttb_idx] = i;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
kd->ttb[ttb_idx] = 0;
|
kd->ttb[ttb_idx] = 0;
|
||||||
@@ -386,13 +377,8 @@ public:
|
|||||||
|
|
||||||
if (!ttb.empty())
|
if (!ttb.empty())
|
||||||
{
|
{
|
||||||
try
|
kd->ttb[TTB_CAPS] = Anope::Convert<int16_t>(ttb, -1);
|
||||||
{
|
if (kd->ttb[TTB_CAPS] < 0)
|
||||||
kd->ttb[TTB_CAPS] = convertTo<int16_t>(ttb);
|
|
||||||
if (kd->ttb[TTB_CAPS] < 0)
|
|
||||||
throw ConvertException();
|
|
||||||
}
|
|
||||||
catch (const ConvertException &)
|
|
||||||
{
|
{
|
||||||
kd->ttb[TTB_CAPS] = 0;
|
kd->ttb[TTB_CAPS] = 0;
|
||||||
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
|
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
|
||||||
@@ -402,21 +388,11 @@ public:
|
|||||||
else
|
else
|
||||||
kd->ttb[TTB_CAPS] = 0;
|
kd->ttb[TTB_CAPS] = 0;
|
||||||
|
|
||||||
kd->capsmin = 10;
|
kd->capsmin = Anope::Convert(min, 0);
|
||||||
try
|
|
||||||
{
|
|
||||||
kd->capsmin = convertTo<int16_t>(min);
|
|
||||||
}
|
|
||||||
catch (const ConvertException &) { }
|
|
||||||
if (kd->capsmin < 1)
|
if (kd->capsmin < 1)
|
||||||
kd->capsmin = 10;
|
kd->capsmin = 10;
|
||||||
|
|
||||||
kd->capspercent = 25;
|
kd->capspercent = Anope::Convert(percent, 0);
|
||||||
try
|
|
||||||
{
|
|
||||||
kd->capspercent = convertTo<int16_t>(percent);
|
|
||||||
}
|
|
||||||
catch (const ConvertException &) { }
|
|
||||||
if (kd->capspercent < 1 || kd->capspercent > 100)
|
if (kd->capspercent < 1 || kd->capspercent > 100)
|
||||||
kd->capspercent = 25;
|
kd->capspercent = 25;
|
||||||
|
|
||||||
@@ -518,42 +494,25 @@ public:
|
|||||||
|
|
||||||
if (!ttb.empty())
|
if (!ttb.empty())
|
||||||
{
|
{
|
||||||
int16_t i;
|
kd->ttb[TTB_FLOOD] = Anope::Convert<int16_t>(ttb, -1);
|
||||||
|
if (kd->ttb[TTB_FLOOD] < 0)
|
||||||
try
|
|
||||||
{
|
|
||||||
i = convertTo<int16_t>(ttb);
|
|
||||||
if (i < 0)
|
|
||||||
throw ConvertException();
|
|
||||||
}
|
|
||||||
catch (const ConvertException &)
|
|
||||||
{
|
{
|
||||||
|
kd->ttb[TTB_FLOOD] = 0;
|
||||||
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
|
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
kd->ttb[TTB_FLOOD] = i;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
kd->ttb[TTB_FLOOD] = 0;
|
kd->ttb[TTB_FLOOD] = 0;
|
||||||
|
|
||||||
kd->floodlines = 6;
|
kd->floodlines = Anope::Convert(lines, -1);
|
||||||
try
|
|
||||||
{
|
|
||||||
kd->floodlines = convertTo<int16_t>(lines);
|
|
||||||
}
|
|
||||||
catch (const ConvertException &) { }
|
|
||||||
if (kd->floodlines < 2)
|
if (kd->floodlines < 2)
|
||||||
kd->floodlines = 6;
|
kd->floodlines = 6;
|
||||||
|
|
||||||
kd->floodsecs = 10;
|
kd->floodsecs = Anope::Convert(secs, -1);
|
||||||
try
|
|
||||||
{
|
|
||||||
kd->floodsecs = convertTo<int16_t>(secs);
|
|
||||||
}
|
|
||||||
catch (const ConvertException &) { }
|
|
||||||
if (kd->floodsecs < 1)
|
if (kd->floodsecs < 1)
|
||||||
kd->floodsecs = 10;
|
kd->floodsecs = 10;
|
||||||
|
|
||||||
if (kd->floodsecs > Config->GetModule(me)->Get<time_t>("keepdata"))
|
if (kd->floodsecs > Config->GetModule(me)->Get<time_t>("keepdata"))
|
||||||
kd->floodsecs = Config->GetModule(me)->Get<time_t>("keepdata");
|
kd->floodsecs = Config->GetModule(me)->Get<time_t>("keepdata");
|
||||||
|
|
||||||
@@ -651,31 +610,18 @@ public:
|
|||||||
|
|
||||||
if (!ttb.empty())
|
if (!ttb.empty())
|
||||||
{
|
{
|
||||||
int16_t i;
|
kd->ttb[TTB_REPEAT] = Anope::Convert(ttb, -1);
|
||||||
|
if (kd->ttb[TTB_REPEAT] < 0)
|
||||||
try
|
|
||||||
{
|
|
||||||
i = convertTo<int16_t>(ttb);
|
|
||||||
if (i < 0)
|
|
||||||
throw ConvertException();
|
|
||||||
}
|
|
||||||
catch (const ConvertException &)
|
|
||||||
{
|
{
|
||||||
|
kd->ttb[TTB_REPEAT] = 0;
|
||||||
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
|
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
kd->ttb[TTB_REPEAT] = i;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
kd->ttb[TTB_REPEAT] = 0;
|
kd->ttb[TTB_REPEAT] = 0;
|
||||||
|
|
||||||
kd->repeattimes = 3;
|
kd->repeattimes = Anope::Convert<int16_t>(times, -1);
|
||||||
try
|
|
||||||
{
|
|
||||||
kd->repeattimes = convertTo<int16_t>(times);
|
|
||||||
}
|
|
||||||
catch (const ConvertException &) { }
|
|
||||||
if (kd->repeattimes < 1)
|
if (kd->repeattimes < 1)
|
||||||
kd->repeattimes = 3;
|
kd->repeattimes = 3;
|
||||||
|
|
||||||
@@ -826,7 +772,7 @@ public:
|
|||||||
|
|
||||||
if (Anope::ReadOnly)
|
if (Anope::ReadOnly)
|
||||||
{
|
{
|
||||||
source.Reply(_("Sorry, bot option setting is temporarily disabled."));
|
source.Reply(READ_ONLY_MODE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -892,7 +838,7 @@ public:
|
|||||||
|
|
||||||
if (Anope::ReadOnly)
|
if (Anope::ReadOnly)
|
||||||
{
|
{
|
||||||
source.Reply(_("Sorry, bot option setting is temporarily disabled."));
|
source.Reply(READ_ONLY_MODE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1091,7 +1037,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;
|
va_list args;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
@@ -1104,7 +1050,7 @@ class BSKick final
|
|||||||
vsnprintf(buf, sizeof(buf), fmt.c_str(), args);
|
vsnprintf(buf, sizeof(buf), fmt.c_str(), args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
ci->c->Kick(ci->bi, u, "%s", buf);
|
ci->c->Kick(ci->bi, u, Anope::string(buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -1241,7 +1187,7 @@ public:
|
|||||||
info.AddOption(_("Voices protection"));
|
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
|
/* Now we can make kicker stuff. We try to order the checks
|
||||||
* from the fastest one to the slowest one, since there's
|
* from the fastest one to the slowest one, since there's
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public:
|
|||||||
|
|
||||||
if (Anope::ReadOnly)
|
if (Anope::ReadOnly)
|
||||||
{
|
{
|
||||||
source.Reply(_("Sorry, changing bot options is temporarily disabled."));
|
source.Reply(READ_ONLY_MODE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public:
|
|||||||
* @param chan The channel
|
* @param chan The channel
|
||||||
*/
|
*/
|
||||||
ChanServTimer(Reference<BotInfo> &cs, ExtensibleItem<bool> &i, Module *m, Channel *chan)
|
ChanServTimer(Reference<BotInfo> &cs, ExtensibleItem<bool> &i, Module *m, Channel *chan)
|
||||||
: Timer(m, Config->GetModule(m)->Get<time_t>("inhabit", "15s"))
|
: Timer(m, Config->GetModule(m)->Get<time_t>("inhabit", "1m"))
|
||||||
, ChanServ(cs)
|
, ChanServ(cs)
|
||||||
, inhabit(i)
|
, inhabit(i)
|
||||||
, c(chan)
|
, c(chan)
|
||||||
@@ -116,12 +116,11 @@ public:
|
|||||||
|
|
||||||
ChanServ = bi;
|
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())
|
if (defaults.empty())
|
||||||
{
|
{
|
||||||
defaults.emplace_back("KEEPTOPIC");
|
defaults.emplace_back("KEEPTOPIC");
|
||||||
defaults.emplace_back("PEACE");
|
defaults.emplace_back("PEACE");
|
||||||
defaults.emplace_back("CS_SECURE");
|
|
||||||
defaults.emplace_back("SECUREFOUNDER");
|
defaults.emplace_back("SECUREFOUNDER");
|
||||||
defaults.emplace_back("SIGNKICK");
|
defaults.emplace_back("SIGNKICK");
|
||||||
}
|
}
|
||||||
@@ -137,7 +136,7 @@ public:
|
|||||||
ChanServ = NULL;
|
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"))
|
if (bi == ChanServ && Config->GetModule(this)->Get<bool>("opersonly") && !u->HasMode("OPER"))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,18 +37,13 @@ public:
|
|||||||
|
|
||||||
Anope::string AccessSerialize() const override
|
Anope::string AccessSerialize() const override
|
||||||
{
|
{
|
||||||
return stringify(this->level);
|
return Anope::ToString(this->level);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AccessUnserialize(const Anope::string &data) override
|
void AccessUnserialize(const Anope::string &data) override
|
||||||
{
|
{
|
||||||
try
|
if (auto l = Anope::TryConvert<int>(data))
|
||||||
{
|
this->level = l.value();
|
||||||
this->level = convertTo<int>(data);
|
|
||||||
}
|
|
||||||
catch (const ConvertException &)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator>(const ChanAccess &other) const override
|
bool operator>(const ChanAccess &other) const override
|
||||||
@@ -84,7 +79,7 @@ public:
|
|||||||
return new AccessChanAccess(this);
|
return new AccessChanAccess(this);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
AccessAccessProvider* AccessAccessProvider::me;
|
AccessAccessProvider *AccessAccessProvider::me;
|
||||||
|
|
||||||
class CommandCSAccess final
|
class CommandCSAccess final
|
||||||
: public Command
|
: public Command
|
||||||
@@ -95,11 +90,9 @@ class CommandCSAccess final
|
|||||||
Privilege *p = NULL;
|
Privilege *p = NULL;
|
||||||
int level = ACCESS_INVALID;
|
int level = ACCESS_INVALID;
|
||||||
|
|
||||||
try
|
if (auto lvl = Anope::TryConvert<int>(params[3]))
|
||||||
{
|
level = lvl.value();
|
||||||
level = convertTo<int>(params[3]);
|
else
|
||||||
}
|
|
||||||
catch (const ConvertException &)
|
|
||||||
{
|
{
|
||||||
p = PrivilegeManager::FindPrivilege(params[3]);
|
p = PrivilegeManager::FindPrivilege(params[3]);
|
||||||
if (p != NULL && defaultLevels[p->name])
|
if (p != NULL && defaultLevels[p->name])
|
||||||
@@ -207,7 +200,7 @@ class CommandCSAccess final
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned access_max = Config->GetModule("chanserv")->Get<unsigned>("accessmax", "1024");
|
unsigned access_max = Config->GetModule("chanserv")->Get<unsigned>("accessmax", "1000");
|
||||||
if (access_max && ci->GetDeepAccessCount() >= access_max)
|
if (access_max && ci->GetDeepAccessCount() >= access_max)
|
||||||
{
|
{
|
||||||
source.Reply(_("Sorry, you can only have %d access entries on a channel, including access entries from other channels."), access_max);
|
source.Reply(_("Sorry, you can only have %d access entries on a channel, including access entries from other channels."), access_max);
|
||||||
@@ -402,7 +395,7 @@ class CommandCSAccess final
|
|||||||
}
|
}
|
||||||
|
|
||||||
ListFormatter::ListEntry entry;
|
ListFormatter::ListEntry entry;
|
||||||
entry["Number"] = stringify(number);
|
entry["Number"] = Anope::ToString(number);
|
||||||
entry["Level"] = access->AccessSerialize();
|
entry["Level"] = access->AccessSerialize();
|
||||||
entry["Mask"] = access->Mask();
|
entry["Mask"] = access->Mask();
|
||||||
entry["By"] = access->creator;
|
entry["By"] = access->creator;
|
||||||
@@ -442,7 +435,7 @@ class CommandCSAccess final
|
|||||||
}
|
}
|
||||||
|
|
||||||
ListFormatter::ListEntry entry;
|
ListFormatter::ListEntry entry;
|
||||||
entry["Number"] = stringify(i + 1);
|
entry["Number"] = Anope::ToString(i + 1);
|
||||||
entry["Level"] = access->AccessSerialize();
|
entry["Level"] = access->AccessSerialize();
|
||||||
entry["Mask"] = access->Mask();
|
entry["Mask"] = access->Mask();
|
||||||
entry["By"] = access->creator;
|
entry["By"] = access->creator;
|
||||||
@@ -567,7 +560,7 @@ public:
|
|||||||
else if (!has_access)
|
else if (!has_access)
|
||||||
source.Reply(ACCESS_DENIED);
|
source.Reply(ACCESS_DENIED);
|
||||||
else if (Anope::ReadOnly && !is_list)
|
else if (Anope::ReadOnly && !is_list)
|
||||||
source.Reply(_("Sorry, channel access list modification is temporarily disabled."));
|
source.Reply(READ_ONLY_MODE);
|
||||||
else if (cmd.equals_ci("ADD"))
|
else if (cmd.equals_ci("ADD"))
|
||||||
this->DoAdd(source, ci, params);
|
this->DoAdd(source, ci, params);
|
||||||
else if (cmd.equals_ci("DEL"))
|
else if (cmd.equals_ci("DEL"))
|
||||||
@@ -652,11 +645,9 @@ class CommandCSLevels final
|
|||||||
level = ACCESS_FOUNDER;
|
level = ACCESS_FOUNDER;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
try
|
if (auto lvl = Anope::TryConvert<int>(lev))
|
||||||
{
|
level = lvl.value();
|
||||||
level = convertTo<int>(lev);
|
else
|
||||||
}
|
|
||||||
catch (const ConvertException &)
|
|
||||||
{
|
{
|
||||||
this->OnSyntaxError(source, "SET");
|
this->OnSyntaxError(source, "SET");
|
||||||
return;
|
return;
|
||||||
@@ -713,7 +704,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());
|
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());
|
source.Reply(_("Access level settings for channel %s:"), ci->name.c_str());
|
||||||
|
|
||||||
@@ -734,7 +725,7 @@ class CommandCSLevels final
|
|||||||
else if (j == ACCESS_FOUNDER)
|
else if (j == ACCESS_FOUNDER)
|
||||||
entry["Level"] = Language::Translate(source.GetAccount(), _("(founder only)"));
|
entry["Level"] = Language::Translate(source.GetAccount(), _("(founder only)"));
|
||||||
else
|
else
|
||||||
entry["Level"] = stringify(j);
|
entry["Level"] = Anope::ToString(j);
|
||||||
|
|
||||||
list.AddEntry(entry);
|
list.AddEntry(entry);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ class CommandCSAKick final
|
|||||||
lastused = UNKNOWN;
|
lastused = UNKNOWN;
|
||||||
|
|
||||||
ListFormatter::ListEntry entry;
|
ListFormatter::ListEntry entry;
|
||||||
entry["Number"] = stringify(number);
|
entry["Number"] = Anope::ToString(number);
|
||||||
if (akick->nc)
|
if (akick->nc)
|
||||||
entry["Mask"] = akick->nc->display;
|
entry["Mask"] = akick->nc->display;
|
||||||
else
|
else
|
||||||
@@ -351,7 +351,7 @@ class CommandCSAKick final
|
|||||||
lastused = UNKNOWN;
|
lastused = UNKNOWN;
|
||||||
|
|
||||||
ListFormatter::ListEntry entry;
|
ListFormatter::ListEntry entry;
|
||||||
entry["Number"] = stringify(i + 1);
|
entry["Number"] = Anope::ToString(i + 1);
|
||||||
if (akick->nc)
|
if (akick->nc)
|
||||||
entry["Mask"] = akick->nc->display;
|
entry["Mask"] = akick->nc->display;
|
||||||
else
|
else
|
||||||
@@ -466,7 +466,7 @@ public:
|
|||||||
else if (!has_access)
|
else if (!has_access)
|
||||||
source.Reply(ACCESS_DENIED);
|
source.Reply(ACCESS_DENIED);
|
||||||
else if (!cmd.equals_ci("LIST") && !cmd.equals_ci("VIEW") && !cmd.equals_ci("ENFORCE") && Anope::ReadOnly)
|
else if (!cmd.equals_ci("LIST") && !cmd.equals_ci("VIEW") && !cmd.equals_ci("ENFORCE") && Anope::ReadOnly)
|
||||||
source.Reply(_("Sorry, channel autokick list modification is temporarily disabled."));
|
source.Reply(READ_ONLY_MODE);
|
||||||
else if (cmd.equals_ci("ADD"))
|
else if (cmd.equals_ci("ADD"))
|
||||||
this->DoAdd(source, ci, params);
|
this->DoAdd(source, ci, params);
|
||||||
else if (cmd.equals_ci("DEL"))
|
else if (cmd.equals_ci("DEL"))
|
||||||
|
|||||||
@@ -15,16 +15,16 @@
|
|||||||
class CommandCSClone final
|
class CommandCSClone final
|
||||||
: public Command
|
: 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))
|
if (ci->HasExt(setting))
|
||||||
target_ci->Extend<bool>(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;
|
std::set<Anope::string> masks;
|
||||||
unsigned access_max = Config->GetModule("chanserv")->Get<unsigned>("accessmax", "1024");
|
unsigned access_max = Config->GetModule("chanserv")->Get<unsigned>("accessmax", "1000");
|
||||||
unsigned count = 0;
|
unsigned count = 0;
|
||||||
|
|
||||||
for (unsigned i = 0; i < target_ci->GetAccessCount(); ++i)
|
for (unsigned i = 0; i < target_ci->GetAccessCount(); ++i)
|
||||||
@@ -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());
|
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();
|
target_ci->ClearAkick();
|
||||||
for (unsigned i = 0; i < ci->GetAkickCount(); ++i)
|
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());
|
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 *target_badwords = target_ci->Require<BadWords>("badwords"),
|
||||||
*badwords = 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());
|
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())
|
for (const auto &[priv, level] : ci->GetLevelEntries())
|
||||||
{
|
{
|
||||||
@@ -196,7 +196,7 @@ public:
|
|||||||
target_ci->last_topic_setter = source.service->nick;
|
target_ci->last_topic_setter = source.service->nick;
|
||||||
|
|
||||||
const Anope::string settings[] = { "NOAUTOOP", "CS_KEEP_MODES", "PEACE", "PERSIST", "RESTRICTED",
|
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)
|
for (const auto &setting : settings)
|
||||||
CopySetting(ci, target_ci, setting);
|
CopySetting(ci, target_ci, setting);
|
||||||
|
|||||||
@@ -14,11 +14,16 @@
|
|||||||
class CommandCSDrop final
|
class CommandCSDrop final
|
||||||
: public Command
|
: public Command
|
||||||
{
|
{
|
||||||
|
private:
|
||||||
|
PrimitiveExtensibleItem<Anope::string> dropcode;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CommandCSDrop(Module *creator) : Command(creator, "chanserv/drop", 1, 2)
|
CommandCSDrop(Module *creator)
|
||||||
|
: Command(creator, "chanserv/drop", 1, 2)
|
||||||
|
, dropcode(creator, "channel-dropcode")
|
||||||
{
|
{
|
||||||
this->SetDesc(_("Cancel the registration of a channel"));
|
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
|
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override
|
||||||
@@ -27,7 +32,7 @@ public:
|
|||||||
|
|
||||||
if (Anope::ReadOnly && !source.HasPriv("chanserv/administration"))
|
if (Anope::ReadOnly && !source.HasPriv("chanserv/administration"))
|
||||||
{
|
{
|
||||||
source.Reply(_("Sorry, channel de-registration is temporarily disabled.")); // XXX: READ_ONLY_MODE?
|
source.Reply(READ_ONLY_MODE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,22 +43,33 @@ public:
|
|||||||
return;
|
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"))
|
if ((ci->HasExt("SECUREFOUNDER") ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER")) && !source.HasCommand("chanserv/drop"))
|
||||||
{
|
{
|
||||||
source.Reply(ACCESS_DENIED);
|
source.Reply(ACCESS_DENIED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto *code = dropcode.Get(ci);
|
||||||
|
if (params.size() < 2 || !code || !code->equals_ci(params[1]))
|
||||||
|
{
|
||||||
|
if (!code)
|
||||||
|
{
|
||||||
|
code = ci->Extend<Anope::string>("channel-dropcode");
|
||||||
|
*code = Anope::Random(15);
|
||||||
|
}
|
||||||
|
|
||||||
|
source.Reply(CONFIRM_DROP, ci->name.c_str(), Config->StrictPrivmsg.c_str(),
|
||||||
|
source.service->nick.c_str(), ci->name.c_str(), code->c_str());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
EventReturn MOD_RESULT;
|
EventReturn MOD_RESULT;
|
||||||
FOREACH_RESULT(OnChanDrop, MOD_RESULT, (source, ci));
|
FOREACH_RESULT(OnChanDrop, MOD_RESULT, (source, ci));
|
||||||
if (MOD_RESULT == EVENT_STOP)
|
if (MOD_RESULT == EVENT_STOP)
|
||||||
|
{
|
||||||
|
dropcode.Unset(ci);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool override = (ci->HasExt("SECUREFOUNDER") ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER"));
|
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") << ")";
|
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "(founder was: " << (ci->GetFounder() ? ci->GetFounder()->display : "none") << ")";
|
||||||
|
|||||||
@@ -166,14 +166,8 @@ private:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int l;
|
auto l = Anope::Convert<int>(l_str, -1);
|
||||||
try
|
if (l < 0)
|
||||||
{
|
|
||||||
l = convertTo<int>(l_str);
|
|
||||||
if (l < 0)
|
|
||||||
throw ConvertException();
|
|
||||||
}
|
|
||||||
catch (const ConvertException &)
|
|
||||||
{
|
{
|
||||||
source.Reply(_("The limit on %s is not valid."), ci->name.c_str());
|
source.Reply(_("The limit on %s is not valid."), ci->name.c_str());
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ struct EntryMsgImpl final
|
|||||||
data.SetType("when", Serialize::Data::DT_INT); data["when"] << this->when;
|
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
|
struct EntryMessageListImpl final
|
||||||
@@ -46,7 +46,7 @@ struct EntryMessageListImpl final
|
|||||||
{
|
{
|
||||||
EntryMessageListImpl(Extensible *) { }
|
EntryMessageListImpl(Extensible *) { }
|
||||||
|
|
||||||
EntryMsg* Create() override
|
EntryMsg *Create() override
|
||||||
{
|
{
|
||||||
return new EntryMsgImpl();
|
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;
|
Anope::string sci, screator, smessage;
|
||||||
time_t swhen;
|
time_t swhen;
|
||||||
@@ -104,7 +104,7 @@ class CommandEntryMessage final
|
|||||||
: public Command
|
: public Command
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
void DoList(CommandSource &source, ChannelInfo *ci)
|
static void DoList(CommandSource &source, ChannelInfo *ci)
|
||||||
{
|
{
|
||||||
EntryMessageList *messages = ci->Require<EntryMessageList>("entrymsg");
|
EntryMessageList *messages = ci->Require<EntryMessageList>("entrymsg");
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ private:
|
|||||||
EntryMsg *msg = (*messages)->at(i);
|
EntryMsg *msg = (*messages)->at(i);
|
||||||
|
|
||||||
ListFormatter::ListEntry entry;
|
ListFormatter::ListEntry entry;
|
||||||
entry["Number"] = stringify(i + 1);
|
entry["Number"] = Anope::ToString(i + 1);
|
||||||
entry["Creator"] = msg->creator;
|
entry["Creator"] = msg->creator;
|
||||||
entry["Created"] = Anope::strftime(msg->when, NULL, true);
|
entry["Created"] = Anope::strftime(msg->when, NULL, true);
|
||||||
entry["Message"] = msg->message;
|
entry["Message"] = msg->message;
|
||||||
@@ -162,21 +162,16 @@ private:
|
|||||||
source.Reply(_("Entry message list for \002%s\002 is empty."), ci->name.c_str());
|
source.Reply(_("Entry message list for \002%s\002 is empty."), ci->name.c_str());
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
try
|
auto i = Anope::Convert<unsigned>(message, 0);
|
||||||
|
if (i > 0 && i <= (*messages)->size())
|
||||||
{
|
{
|
||||||
unsigned i = convertTo<unsigned>(message);
|
delete (*messages)->at(i - 1);
|
||||||
if (i > 0 && i <= (*messages)->size())
|
if ((*messages)->empty())
|
||||||
{
|
ci->Shrink<EntryMessageList>("entrymsg");
|
||||||
delete (*messages)->at(i - 1);
|
Log(source.AccessFor(ci).HasPriv("SET") ? LOG_COMMAND : LOG_OVERRIDE, source, this, ci) << "to remove a message";
|
||||||
if ((*messages)->empty())
|
source.Reply(_("Entry message \002%i\002 for \002%s\002 deleted."), i, ci->name.c_str());
|
||||||
ci->Shrink<EntryMessageList>("entrymsg");
|
|
||||||
Log(source.AccessFor(ci).HasPriv("SET") ? LOG_COMMAND : LOG_OVERRIDE, source, this, ci) << "to remove a message";
|
|
||||||
source.Reply(_("Entry message \002%i\002 for \002%s\002 deleted."), i, ci->name.c_str());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
throw ConvertException();
|
|
||||||
}
|
}
|
||||||
catch (const ConvertException &)
|
else
|
||||||
{
|
{
|
||||||
source.Reply(_("Entry message \002%s\002 not found on channel \002%s\002."), message.c_str(), ci->name.c_str());
|
source.Reply(_("Entry message \002%s\002 not found on channel \002%s\002."), message.c_str(), ci->name.c_str());
|
||||||
}
|
}
|
||||||
@@ -283,10 +278,16 @@ public:
|
|||||||
if (u && c && c->ci && u->server->IsSynced())
|
if (u && c && c->ci && u->server->IsSynced())
|
||||||
{
|
{
|
||||||
EntryMessageList *messages = c->ci->GetExt<EntryMessageList>("entrymsg");
|
EntryMessageList *messages = c->ci->GetExt<EntryMessageList>("entrymsg");
|
||||||
|
if (!messages)
|
||||||
|
return;
|
||||||
|
|
||||||
if (messages != NULL)
|
for (const auto &message : *(*messages))
|
||||||
for (const auto &message : *(*messages))
|
{
|
||||||
u->SendMessage(c->ci->WhoSends(), "[%s] %s", c->ci->name.c_str(), message->message.c_str());
|
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
|
bool HasPriv(const Anope::string &priv) const override
|
||||||
{
|
{
|
||||||
std::map<Anope::string, char>::iterator it = defaultFlags.find(priv);
|
std::map<Anope::string, char>::iterator it = defaultFlags.find(priv);
|
||||||
if (it != defaultFlags.end() && this->flags.count(it->second) > 0)
|
return it != defaultFlags.end() && this->flags.count(it->second) > 0;
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Anope::string AccessSerialize() const override
|
Anope::string AccessSerialize() const override
|
||||||
@@ -76,7 +74,7 @@ public:
|
|||||||
return new FlagsChanAccess(this);
|
return new FlagsChanAccess(this);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
FlagsAccessProvider* FlagsAccessProvider::ap;
|
FlagsAccessProvider *FlagsAccessProvider::ap;
|
||||||
|
|
||||||
class CommandCSFlags final
|
class CommandCSFlags final
|
||||||
: public Command
|
: public Command
|
||||||
@@ -177,7 +175,7 @@ class CommandCSFlags final
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned access_max = Config->GetModule("chanserv")->Get<unsigned>("accessmax", "1024");
|
unsigned access_max = Config->GetModule("chanserv")->Get<unsigned>("accessmax", "1000");
|
||||||
if (access_max && ci->GetDeepAccessCount() >= access_max)
|
if (access_max && ci->GetDeepAccessCount() >= access_max)
|
||||||
{
|
{
|
||||||
source.Reply(_("Sorry, you can only have %d access entries on a channel, including access entries from other channels."), access_max);
|
source.Reply(_("Sorry, you can only have %d access entries on a channel, including access entries from other channels."), access_max);
|
||||||
@@ -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());
|
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] : "";
|
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)
|
for (size_t j = 1; j < arg.length(); ++j)
|
||||||
if (flags.find(arg[j]) == Anope::string::npos)
|
if (flags.find(arg[j]) == Anope::string::npos)
|
||||||
pass = false;
|
pass = false;
|
||||||
if (pass == false)
|
if (!pass)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (!Anope::Match(access->Mask(), arg))
|
else if (!Anope::Match(access->Mask(), arg))
|
||||||
@@ -333,7 +331,7 @@ class CommandCSFlags final
|
|||||||
|
|
||||||
ListFormatter::ListEntry entry;
|
ListFormatter::ListEntry entry;
|
||||||
++count;
|
++count;
|
||||||
entry["Number"] = stringify(i + 1);
|
entry["Number"] = Anope::ToString(i + 1);
|
||||||
entry["Mask"] = access->Mask();
|
entry["Mask"] = access->Mask();
|
||||||
entry["Flags"] = flags;
|
entry["Flags"] = flags;
|
||||||
entry["Creator"] = access->creator;
|
entry["Creator"] = access->creator;
|
||||||
@@ -413,7 +411,7 @@ public:
|
|||||||
if (!has_access)
|
if (!has_access)
|
||||||
source.Reply(ACCESS_DENIED);
|
source.Reply(ACCESS_DENIED);
|
||||||
else if (Anope::ReadOnly && !is_list)
|
else if (Anope::ReadOnly && !is_list)
|
||||||
source.Reply(_("Sorry, channel access list modification is temporarily disabled."));
|
source.Reply(READ_ONLY_MODE);
|
||||||
else if (is_list)
|
else if (is_list)
|
||||||
this->DoList(source, ci, params);
|
this->DoList(source, ci, params);
|
||||||
else if (cmd.equals_ci("CLEAR"))
|
else if (cmd.equals_ci("CLEAR"))
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public:
|
|||||||
|
|
||||||
if (show_all)
|
if (show_all)
|
||||||
{
|
{
|
||||||
info[_("Ban type")] = stringify(ci->bantype);
|
info[_("Ban type")] = Anope::ToString(ci->bantype);
|
||||||
}
|
}
|
||||||
|
|
||||||
FOREACH_MOD(OnChanInfo, (source, ci, info, show_all));
|
FOREACH_MOD(OnChanInfo, (source, ci, info, show_all));
|
||||||
|
|||||||
@@ -36,12 +36,10 @@ public:
|
|||||||
sepstream(pattern.substr(1), '-').GetToken(n1, 0);
|
sepstream(pattern.substr(1), '-').GetToken(n1, 0);
|
||||||
sepstream(pattern, '-').GetToken(n2, 1);
|
sepstream(pattern, '-').GetToken(n2, 1);
|
||||||
|
|
||||||
try
|
auto num1 = Anope::TryConvert<int>(n1);
|
||||||
{
|
auto num2 = Anope::TryConvert<int>(n2);
|
||||||
from = convertTo<int>(n1);
|
|
||||||
to = convertTo<int>(n2);
|
if (!num1.has_value() || !num2.has_value())
|
||||||
}
|
|
||||||
catch (const ConvertException &)
|
|
||||||
{
|
{
|
||||||
source.Reply(LIST_INCORRECT_RANGE);
|
source.Reply(LIST_INCORRECT_RANGE);
|
||||||
source.Reply(_("To search for channels starting with #, search for the channel\n"
|
source.Reply(_("To search for channels starting with #, search for the channel\n"
|
||||||
@@ -49,6 +47,8 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
from = num1.value();
|
||||||
|
to = num2.value();
|
||||||
pattern = "*";
|
pattern = "*";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ struct LogSettingImpl final
|
|||||||
data.SetType("created", Serialize::Data::DT_INT); data["created"] << created;
|
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;
|
Anope::string sci;
|
||||||
data["ci"] >> sci;
|
data["ci"] >> sci;
|
||||||
@@ -135,7 +135,7 @@ public:
|
|||||||
const LogSetting *log = (*ls)->at(i);
|
const LogSetting *log = (*ls)->at(i);
|
||||||
|
|
||||||
ListFormatter::ListEntry entry;
|
ListFormatter::ListEntry entry;
|
||||||
entry["Number"] = stringify(i + 1);
|
entry["Number"] = Anope::ToString(i + 1);
|
||||||
entry["Service"] = log->command_service;
|
entry["Service"] = log->command_service;
|
||||||
entry["Command"] = !log->command_name.empty() ? log->command_name : log->service_name;
|
entry["Command"] = !log->command_name.empty() ? log->command_name : log->service_name;
|
||||||
entry["Method"] = log->method;
|
entry["Method"] = log->method;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ struct ModeLockImpl final
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override;
|
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
|
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;
|
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;
|
Anope::string sci;
|
||||||
|
|
||||||
@@ -247,7 +247,7 @@ Serializable* ModeLockImpl::Unserialize(Serializable *obj, Serialize::Data &data
|
|||||||
class CommandCSMode final
|
class CommandCSMode final
|
||||||
: public Command
|
: 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)
|
if (!ci || !cm || cm->type != MODE_STATUS)
|
||||||
return false;
|
return false;
|
||||||
@@ -336,7 +336,7 @@ class CommandCSMode final
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (modelocks->GetMLock().size() >= Config->GetModule(this->owner)->Get<unsigned>("max", "32"))
|
if (modelocks->GetMLock().size() >= Config->GetModule(this->owner)->Get<unsigned>("max", "50"))
|
||||||
{
|
{
|
||||||
source.Reply(_("The mode lock list of \002%s\002 is full."), ci->name.c_str());
|
source.Reply(_("The mode lock list of \002%s\002 is full."), ci->name.c_str());
|
||||||
continue;
|
continue;
|
||||||
@@ -716,7 +716,7 @@ class CommandCSMode final
|
|||||||
std::vector<Anope::string> new_params;
|
std::vector<Anope::string> new_params;
|
||||||
new_params.push_back(params[0]);
|
new_params.push_back(params[0]);
|
||||||
new_params.emplace_back("SET");
|
new_params.emplace_back("SET");
|
||||||
new_params.push_back("-" + stringify(cm->mchar));
|
new_params.push_back("-" + Anope::ToString(cm->mchar));
|
||||||
new_params.emplace_back("*");
|
new_params.emplace_back("*");
|
||||||
this->DoSet(source, ci, new_params);
|
this->DoSet(source, ci, new_params);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public:
|
|||||||
ChannelInfo *ci = ChannelInfo::Find(params[0]);
|
ChannelInfo *ci = ChannelInfo::Find(params[0]);
|
||||||
|
|
||||||
if (Anope::ReadOnly)
|
if (Anope::ReadOnly)
|
||||||
source.Reply(_("Sorry, channel registration is temporarily disabled."));
|
source.Reply(READ_ONLY_MODE);
|
||||||
else if (nc->HasExt("UNCONFIRMED"))
|
else if (nc->HasExt("UNCONFIRMED"))
|
||||||
source.Reply(_("You must confirm your account before you can register a channel."));
|
source.Reply(_("You must confirm your account before you can register a channel."));
|
||||||
else if (chan[0] == '&')
|
else if (chan[0] == '&')
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ enum TypeInfo
|
|||||||
static bool simple;
|
static bool simple;
|
||||||
struct SeenInfo;
|
struct SeenInfo;
|
||||||
static SeenInfo *FindInfo(const Anope::string &nick);
|
static SeenInfo *FindInfo(const Anope::string &nick);
|
||||||
typedef Anope::hash_map<SeenInfo *> database_map;
|
typedef Anope::unordered_map<SeenInfo *> database_map;
|
||||||
database_map database;
|
database_map database;
|
||||||
|
|
||||||
struct SeenInfo final
|
struct SeenInfo final
|
||||||
@@ -55,7 +55,7 @@ struct SeenInfo final
|
|||||||
data.SetType("last", Serialize::Data::DT_INT); data["last"] << last;
|
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;
|
Anope::string snick;
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ struct SeenInfo final
|
|||||||
s = anope_dynamic_static_cast<SeenInfo *>(obj);
|
s = anope_dynamic_static_cast<SeenInfo *>(obj);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SeenInfo* &info = database[snick];
|
SeenInfo *&info = database[snick];
|
||||||
if (!info)
|
if (!info)
|
||||||
info = new SeenInfo();
|
info = new SeenInfo();
|
||||||
s = info;
|
s = info;
|
||||||
@@ -185,7 +185,7 @@ public:
|
|||||||
class CommandSeen final
|
class CommandSeen final
|
||||||
: public Command
|
: 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)
|
if (!source.c || !source.c->ci)
|
||||||
{
|
{
|
||||||
@@ -270,9 +270,9 @@ public:
|
|||||||
if (simple)
|
if (simple)
|
||||||
return this->SimpleSeen(source, params);
|
return this->SimpleSeen(source, params);
|
||||||
|
|
||||||
if (target.length() > Config->GetBlock("networkinfo")->Get<unsigned>("nicklen"))
|
if (target.length() > IRCD->MaxNick)
|
||||||
{
|
{
|
||||||
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->MaxNick);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -440,12 +440,12 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
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())
|
if (simple || !u->server->IsSynced())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SeenInfo* &info = database[nick];
|
SeenInfo *&info = database[nick];
|
||||||
if (!info)
|
if (!info)
|
||||||
info = new SeenInfo();
|
info = new SeenInfo();
|
||||||
info->nick = nick;
|
info->nick = nick;
|
||||||
|
|||||||
+10
-80
@@ -165,19 +165,16 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
auto new_type = Anope::Convert<int16_t>(params[1], -1);
|
||||||
{
|
if (new_type < 0 || new_type > 3)
|
||||||
int16_t new_type = convertTo<int16_t>(params[1]);
|
|
||||||
if (new_type < 0 || new_type > 3)
|
|
||||||
throw ConvertException("Invalid range");
|
|
||||||
Log(source.AccessFor(ci).HasPriv("SET") ? LOG_COMMAND : LOG_OVERRIDE, source, this, ci) << "to change the ban type to " << new_type;
|
|
||||||
ci->bantype = new_type;
|
|
||||||
source.Reply(_("Ban type for channel %s is now #%d."), ci->name.c_str(), ci->bantype);
|
|
||||||
}
|
|
||||||
catch (const ConvertException &)
|
|
||||||
{
|
{
|
||||||
source.Reply(_("\002%s\002 is not a valid ban type."), params[1].c_str());
|
source.Reply(_("\002%s\002 is not a valid ban type."), params[1].c_str());
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log(source.AccessFor(ci).HasPriv("SET") ? LOG_COMMAND : LOG_OVERRIDE, source, this, ci) << "to change the ban type to " << new_type;
|
||||||
|
ci->bantype = new_type;
|
||||||
|
source.Reply(_("Ban type for channel %s is now #%d."), ci->name.c_str(), ci->bantype);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OnHelp(CommandSource &source, const Anope::string &) override
|
bool OnHelp(CommandSource &source, const Anope::string &) override
|
||||||
@@ -682,70 +679,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
|
class CommandCSSetSecureFounder final
|
||||||
: public Command
|
: public Command
|
||||||
{
|
{
|
||||||
@@ -1110,7 +1043,7 @@ class CSSet final
|
|||||||
: public Module
|
: public Module
|
||||||
{
|
{
|
||||||
SerializableExtensibleItem<bool> noautoop, peace, securefounder,
|
SerializableExtensibleItem<bool> noautoop, peace, securefounder,
|
||||||
restricted, secure, secureops, signkick, signkick_level, noexpire,
|
restricted, secureops, signkick, signkick_level, noexpire,
|
||||||
persist;
|
persist;
|
||||||
|
|
||||||
struct KeepModes final
|
struct KeepModes final
|
||||||
@@ -1169,7 +1102,6 @@ class CSSet final
|
|||||||
CommandCSSetPeace commandcssetpeace;
|
CommandCSSetPeace commandcssetpeace;
|
||||||
CommandCSSetPersist commandcssetpersist;
|
CommandCSSetPersist commandcssetpersist;
|
||||||
CommandCSSetRestricted commandcssetrestricted;
|
CommandCSSetRestricted commandcssetrestricted;
|
||||||
CommandCSSetSecure commandcssetsecure;
|
|
||||||
CommandCSSetSecureFounder commandcssetsecurefounder;
|
CommandCSSetSecureFounder commandcssetsecurefounder;
|
||||||
CommandCSSetSecureOps commandcssetsecureops;
|
CommandCSSetSecureOps commandcssetsecureops;
|
||||||
CommandCSSetSignKick commandcssetsignkick;
|
CommandCSSetSignKick commandcssetsignkick;
|
||||||
@@ -1184,7 +1116,7 @@ public:
|
|||||||
CSSet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
|
CSSet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
|
||||||
noautoop(this, "NOAUTOOP"), peace(this, "PEACE"),
|
noautoop(this, "NOAUTOOP"), peace(this, "PEACE"),
|
||||||
securefounder(this, "SECUREFOUNDER"), restricted(this, "RESTRICTED"),
|
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"),
|
signkick_level(this, "SIGNKICK_LEVEL"), noexpire(this, "CS_NO_EXPIRE"),
|
||||||
persist(this, "PERSIST"),
|
persist(this, "PERSIST"),
|
||||||
keep_modes(this, "CS_KEEP_MODES"),
|
keep_modes(this, "CS_KEEP_MODES"),
|
||||||
@@ -1192,7 +1124,7 @@ public:
|
|||||||
commandcsset(this), commandcssetautoop(this), commandcssetbantype(this),
|
commandcsset(this), commandcssetautoop(this), commandcssetbantype(this),
|
||||||
commandcssetdescription(this), commandcssetfounder(this), commandcssetkeepmodes(this),
|
commandcssetdescription(this), commandcssetfounder(this), commandcssetkeepmodes(this),
|
||||||
commandcssetpeace(this), commandcssetpersist(this), commandcssetrestricted(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),
|
commandcssetsuccessor(this), commandcssetnoexpire(this),
|
||||||
|
|
||||||
inhabit("inhabit")
|
inhabit("inhabit")
|
||||||
@@ -1304,8 +1236,6 @@ public:
|
|||||||
info.AddOption(_("Peace"));
|
info.AddOption(_("Peace"));
|
||||||
if (restricted.HasExt(ci))
|
if (restricted.HasExt(ci))
|
||||||
info.AddOption(_("Restricted access"));
|
info.AddOption(_("Restricted access"));
|
||||||
if (secure.HasExt(ci))
|
|
||||||
info.AddOption(_("Security"));
|
|
||||||
if (securefounder.HasExt(ci))
|
if (securefounder.HasExt(ci))
|
||||||
info.AddOption(_("Secure founder"));
|
info.AddOption(_("Secure founder"));
|
||||||
if (secureops.HasExt(ci))
|
if (secureops.HasExt(ci))
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ static Anope::map<ExtensibleItem<CSMiscData> *> items;
|
|||||||
|
|
||||||
static ExtensibleItem<CSMiscData> *GetItem(const Anope::string &name)
|
static ExtensibleItem<CSMiscData> *GetItem(const Anope::string &name)
|
||||||
{
|
{
|
||||||
ExtensibleItem<CSMiscData>* &it = items[name];
|
ExtensibleItem<CSMiscData> *&it = items[name];
|
||||||
if (!it)
|
if (!it)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -51,7 +51,7 @@ struct CSMiscData final
|
|||||||
sdata["data"] << this->data;
|
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;
|
Anope::string sci, sname, sdata;
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ struct CSSuspendInfo final
|
|||||||
data["expires"] << expires;
|
data["expires"] << expires;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
{
|
{
|
||||||
Anope::string schan;
|
Anope::string schan;
|
||||||
data["chan"] >> schan;
|
data["chan"] >> schan;
|
||||||
@@ -214,6 +214,13 @@ class CSSuspend final
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void Expire(ChannelInfo *ci)
|
||||||
|
{
|
||||||
|
suspend.Unset(ci);
|
||||||
|
Log(this) << "Expiring suspend for " << ci->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Show(CommandSource &source, const Anope::string &what) const
|
bool Show(CommandSource &source, const Anope::string &what) const
|
||||||
{
|
{
|
||||||
return source.IsOper() || std::find(show.begin(), show.end(), what) != show.end();
|
return source.IsOper() || std::find(show.begin(), show.end(), what) != show.end();
|
||||||
@@ -259,23 +266,28 @@ public:
|
|||||||
|
|
||||||
expire = false;
|
expire = false;
|
||||||
|
|
||||||
if (!si->expires)
|
if (!Anope::NoExpire && si->expires && si->expires < Anope::CurTime)
|
||||||
return;
|
|
||||||
|
|
||||||
if (si->expires < Anope::CurTime)
|
|
||||||
{
|
{
|
||||||
ci->last_used = Anope::CurTime;
|
ci->last_used = Anope::CurTime;
|
||||||
suspend.Unset(ci);
|
Expire(ci);
|
||||||
|
|
||||||
Log(this) << "Expiring suspend for " << ci->name;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) override
|
EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) override
|
||||||
{
|
{
|
||||||
if (u->HasMode("OPER") || !c->ci || !suspend.HasExt(c->ci))
|
if (u->HasMode("OPER") || !c->ci)
|
||||||
return EVENT_CONTINUE;
|
return EVENT_CONTINUE;
|
||||||
|
|
||||||
|
CSSuspendInfo *si = suspend.Get(c->ci);
|
||||||
|
if (!si)
|
||||||
|
return EVENT_CONTINUE;
|
||||||
|
|
||||||
|
if (!Anope::NoExpire && si->expires && si->expires < Anope::CurTime)
|
||||||
|
{
|
||||||
|
Expire(c->ci);
|
||||||
|
return EVENT_CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
reason = Language::Translate(u, _("This channel may not be used."));
|
reason = Language::Translate(u, _("This channel may not be used."));
|
||||||
return EVENT_STOP;
|
return EVENT_STOP;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ public:
|
|||||||
|
|
||||||
ModeLocks *ml = ci->GetExt<ModeLocks>("modelocks");
|
ModeLocks *ml = ci->GetExt<ModeLocks>("modelocks");
|
||||||
const ModeLock *secret = ml ? ml->GetMLock("SECRET") : NULL;
|
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[_("Last topic")] = ci->last_topic;
|
||||||
info[_("Topic set by")] = ci->last_topic_setter;
|
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")))
|
if (!ci->c || !(source.AccessFor(ci).HasPriv("UNBAN") || source.AccessFor(ci).HasPriv("UNBANME")))
|
||||||
continue;
|
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)
|
for (const auto *mode : modes)
|
||||||
if (ci->c->Unban(source.GetUser(), mode->name, true))
|
if (ci->c->Unban(source.GetUser(), mode->name, true))
|
||||||
@@ -81,7 +86,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!source.AccessFor(ci).HasPriv("UNBAN") &&
|
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.HasPriv("chanserv/kick"))
|
||||||
{
|
{
|
||||||
source.Reply(ACCESS_DENIED);
|
source.Reply(ACCESS_DENIED);
|
||||||
@@ -91,10 +96,15 @@ public:
|
|||||||
bool override = !source.AccessFor(ci).HasPriv("UNBAN") && source.HasPriv("chanserv/kick");
|
bool override = !source.AccessFor(ci).HasPriv("UNBAN") && source.HasPriv("chanserv/kick");
|
||||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to unban " << u2->nick;
|
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to unban " << u2->nick;
|
||||||
|
|
||||||
FOREACH_MOD(OnChannelUnban, (u2, ci));
|
|
||||||
|
|
||||||
for (const auto *mode : modes)
|
if (IRCD->CanClearBans)
|
||||||
ci->c->Unban(u2, mode->name, source.GetUser() == u2);
|
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())
|
if (u2 == source.GetUser())
|
||||||
source.Reply(_("You have been unbanned from \002%s\002."), ci->c->name.c_str());
|
source.Reply(_("You have been unbanned from \002%s\002."), ci->c->name.c_str());
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
class CommandCSUp final
|
class CommandCSUp final
|
||||||
: public Command
|
: public Command
|
||||||
{
|
{
|
||||||
void SetModes(User *u, Channel *c)
|
static void SetModes(User *u, Channel *c)
|
||||||
{
|
{
|
||||||
if (!c->ci)
|
if (!c->ci)
|
||||||
return;
|
return;
|
||||||
@@ -133,7 +133,7 @@ public:
|
|||||||
class CommandCSDown final
|
class CommandCSDown final
|
||||||
: public Command
|
: public Command
|
||||||
{
|
{
|
||||||
void RemoveAll(User *u, Channel *c)
|
static void RemoveAll(User *u, Channel *c)
|
||||||
{
|
{
|
||||||
ChanUserContainer *cu = c->FindUser(u);
|
ChanUserContainer *cu = c->FindUser(u);
|
||||||
if (cu != NULL)
|
if (cu != NULL)
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ private:
|
|||||||
|
|
||||||
if (Anope::ReadOnly)
|
if (Anope::ReadOnly)
|
||||||
{
|
{
|
||||||
source.Reply(_("Sorry, channel %s list modification is temporarily disabled."), source.command.c_str());
|
source.Reply(READ_ONLY_MODE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,7 +208,7 @@ private:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned access_max = Config->GetModule("chanserv")->Get<unsigned>("accessmax", "1024");
|
unsigned access_max = Config->GetModule("chanserv")->Get<unsigned>("accessmax", "1000");
|
||||||
if (access_max && ci->GetDeepAccessCount() >= access_max)
|
if (access_max && ci->GetDeepAccessCount() >= access_max)
|
||||||
{
|
{
|
||||||
source.Reply(_("Sorry, you can only have %d access entries on a channel, including access entries from other channels."), access_max);
|
source.Reply(_("Sorry, you can only have %d access entries on a channel, including access entries from other channels."), access_max);
|
||||||
@@ -246,7 +246,7 @@ private:
|
|||||||
|
|
||||||
if (Anope::ReadOnly)
|
if (Anope::ReadOnly)
|
||||||
{
|
{
|
||||||
source.Reply(_("Sorry, channel %s list modification is temporarily disabled."), source.command.c_str());
|
source.Reply(READ_ONLY_MODE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -420,7 +420,7 @@ private:
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
ListFormatter::ListEntry entry;
|
ListFormatter::ListEntry entry;
|
||||||
entry["Number"] = stringify(Number);
|
entry["Number"] = Anope::ToString(Number);
|
||||||
entry["Mask"] = a->Mask();
|
entry["Mask"] = a->Mask();
|
||||||
entry["Description"] = a->description;
|
entry["Description"] = a->description;
|
||||||
this->list.AddEntry(entry);
|
this->list.AddEntry(entry);
|
||||||
@@ -440,7 +440,7 @@ private:
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
ListFormatter::ListEntry entry;
|
ListFormatter::ListEntry entry;
|
||||||
entry["Number"] = stringify(i + 1);
|
entry["Number"] = Anope::ToString(i + 1);
|
||||||
entry["Mask"] = a->Mask();
|
entry["Mask"] = a->Mask();
|
||||||
entry["Description"] = a->description;
|
entry["Description"] = a->description;
|
||||||
list.AddEntry(entry);
|
list.AddEntry(entry);
|
||||||
@@ -464,7 +464,7 @@ private:
|
|||||||
{
|
{
|
||||||
if (Anope::ReadOnly)
|
if (Anope::ReadOnly)
|
||||||
{
|
{
|
||||||
source.Reply(_("Sorry, channel %s list modification is temporarily disabled."), source.command.c_str());
|
source.Reply(READ_ONLY_MODE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -189,14 +189,14 @@ class MChanstats final
|
|||||||
sql->Run(&sqlinterface, q);
|
sql->Run(&sqlinterface, q);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t CountWords(const Anope::string &msg)
|
static size_t CountWords(const Anope::string &msg)
|
||||||
{
|
{
|
||||||
size_t words = 0;
|
size_t words = 0;
|
||||||
for (size_t pos = 0; pos != Anope::string::npos; pos = msg.find(" ", pos+1))
|
for (size_t pos = 0; pos != Anope::string::npos; pos = msg.find(" ", pos+1))
|
||||||
words++;
|
words++;
|
||||||
return 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;
|
size_t smileys = 0;
|
||||||
spacesepstream sep(smileylist);
|
spacesepstream sep(smileylist);
|
||||||
@@ -210,7 +210,7 @@ class MChanstats final
|
|||||||
return smileys;
|
return smileys;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Anope::string GetDisplay(User *u)
|
Anope::string GetDisplay(User *u)
|
||||||
{
|
{
|
||||||
if (u && u->Account() && ns_stats.HasExt(u->Account()))
|
if (u && u->Account() && ns_stats.HasExt(u->Account()))
|
||||||
return u->Account()->display;
|
return u->Account()->display;
|
||||||
@@ -581,7 +581,7 @@ public:
|
|||||||
this->RunQuery(query);
|
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))
|
if (!c->ci || !cs_stats.HasExt(c->ci))
|
||||||
return;
|
return;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -22,7 +22,7 @@ public:
|
|||||||
Anope::string last;
|
Anope::string last;
|
||||||
std::fstream *fs = nullptr;
|
std::fstream *fs = nullptr;
|
||||||
|
|
||||||
std::iostream& operator[](const Anope::string &key) override
|
std::iostream &operator[](const Anope::string &key) override
|
||||||
{
|
{
|
||||||
if (key != last)
|
if (key != last)
|
||||||
{
|
{
|
||||||
@@ -44,7 +44,7 @@ public:
|
|||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
bool read = false;
|
bool read = false;
|
||||||
|
|
||||||
std::iostream& operator[](const Anope::string &key) override
|
std::iostream &operator[](const Anope::string &key) override
|
||||||
{
|
{
|
||||||
if (!read)
|
if (!read)
|
||||||
{
|
{
|
||||||
@@ -52,12 +52,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (token.find("ID ") == 0)
|
if (token.find("ID ") == 0)
|
||||||
{
|
{
|
||||||
try
|
this->id = Anope::Convert(token.substr(3), 0);
|
||||||
{
|
|
||||||
this->id = convertTo<unsigned int>(token.substr(3));
|
|
||||||
}
|
|
||||||
catch (const ConvertException &) { }
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (token.find("DATA ") != 0)
|
else if (token.find("DATA ") != 0)
|
||||||
@@ -135,8 +130,8 @@ class DBFlatFile final
|
|||||||
|
|
||||||
for (const auto &db : dbs)
|
for (const auto &db : dbs)
|
||||||
{
|
{
|
||||||
const Anope::string &oldname = Anope::DataDir + "/" + db;
|
const auto oldname = Anope::ExpandData(db);
|
||||||
Anope::string newname = Anope::DataDir + "/backups/" + db + "-" + stringify(tm->tm_year + 1900) + Anope::printf("-%02i-", tm->tm_mon + 1) + Anope::printf("%02i", tm->tm_mday);
|
const auto newname = Anope::ExpandData("backups/" + db + "-" + Anope::ToString(tm->tm_year + 1900) + Anope::printf("-%02i-", tm->tm_mon + 1) + Anope::printf("%02i", tm->tm_mday));
|
||||||
|
|
||||||
/* Backup already exists or no database to backup */
|
/* Backup already exists or no database to backup */
|
||||||
if (Anope::IsFile(newname) || !Anope::IsFile(oldname))
|
if (Anope::IsFile(newname) || !Anope::IsFile(oldname))
|
||||||
@@ -221,7 +216,7 @@ public:
|
|||||||
{
|
{
|
||||||
std::set<Anope::string> tried_dbs;
|
std::set<Anope::string> tried_dbs;
|
||||||
|
|
||||||
const Anope::string &db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string>("database", "anope.db");
|
const auto db_name = Anope::ExpandData(Config->GetModule(this)->Get<const Anope::string>("database", "anope.db"));
|
||||||
|
|
||||||
std::fstream fd(db_name.c_str(), std::ios_base::in | std::ios_base::binary);
|
std::fstream fd(db_name.c_str(), std::ios_base::in | std::ios_base::binary);
|
||||||
if (!fd.is_open())
|
if (!fd.is_open())
|
||||||
@@ -301,9 +296,9 @@ public:
|
|||||||
|
|
||||||
Anope::string db_name;
|
Anope::string db_name;
|
||||||
if (s_type->GetOwner())
|
if (s_type->GetOwner())
|
||||||
db_name = Anope::DataDir + "/module_" + s_type->GetOwner()->name + ".db";
|
db_name = Anope::ExpandData("module_" + s_type->GetOwner()->name + ".db");
|
||||||
else
|
else
|
||||||
db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string>("database", "anope.db");
|
db_name = Anope::ExpandData(Config->GetModule(this)->Get<const Anope::string>("database", "anope.db"));
|
||||||
|
|
||||||
std::fstream *fs = databases[s_type->GetOwner()] = new std::fstream((db_name + ".tmp").c_str(), std::ios_base::out | std::ios_base::trunc | std::ios_base::binary);
|
std::fstream *fs = databases[s_type->GetOwner()] = new std::fstream((db_name + ".tmp").c_str(), std::ios_base::out | std::ios_base::trunc | std::ios_base::binary);
|
||||||
|
|
||||||
@@ -330,7 +325,7 @@ public:
|
|||||||
|
|
||||||
for (auto &[mod, f] : databases)
|
for (auto &[mod, f] : databases)
|
||||||
{
|
{
|
||||||
const Anope::string &db_name = Anope::DataDir + "/" + (mod ? (mod->name + ".db") : Config->GetModule(this)->Get<const Anope::string>("database", "anope.db"));
|
const auto db_name = Anope::ExpandData((mod ? (mod->name + ".db") : Config->GetModule(this)->Get<const Anope::string>("database", "anope.db")));
|
||||||
|
|
||||||
if (!f->is_open() || !f->good())
|
if (!f->is_open() || !f->good())
|
||||||
{
|
{
|
||||||
@@ -372,9 +367,9 @@ public:
|
|||||||
|
|
||||||
Anope::string db_name;
|
Anope::string db_name;
|
||||||
if (stype->GetOwner())
|
if (stype->GetOwner())
|
||||||
db_name = Anope::DataDir + "/module_" + stype->GetOwner()->name + ".db";
|
db_name = Anope::ExpandData("module_" + stype->GetOwner()->name + ".db");
|
||||||
else
|
else
|
||||||
db_name = Anope::DataDir + "/" + Config->GetModule(this)->Get<const Anope::string>("database", "anope.db");
|
db_name = Anope::ExpandData(Config->GetModule(this)->Get<const Anope::string>("database", "anope.db"));
|
||||||
|
|
||||||
std::fstream fd(db_name.c_str(), std::ios_base::in | std::ios_base::binary);
|
std::fstream fd(db_name.c_str(), std::ios_base::in | std::ios_base::binary);
|
||||||
if (!fd.is_open())
|
if (!fd.is_open())
|
||||||
|
|||||||
@@ -35,13 +35,12 @@ else \
|
|||||||
#define OLD_BI_PRIVATE 0x0001
|
#define OLD_BI_PRIVATE 0x0001
|
||||||
|
|
||||||
#define OLD_NI_KILLPROTECT 0x00000001 /* Kill others who take this nick */
|
#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_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_HARDMAX 0x00000008 /* Don't allow user to change memo limit */
|
||||||
#define OLD_NI_MEMO_SIGNON 0x00000010 /* Notify of memos at signon and un-away */
|
#define OLD_NI_MEMO_SIGNON 0x00000010 /* Notify of memos at signon and un-away */
|
||||||
#define OLD_NI_MEMO_RECEIVE 0x00000020 /* Notify of new memos when sent */
|
#define OLD_NI_MEMO_RECEIVE 0x00000020 /* Notify of new memos when sent */
|
||||||
#define OLD_NI_PRIVATE 0x00000040 /* Don't show in LIST to non-servadmins */
|
#define OLD_NI_PRIVATE 0x00000040 /* Don't show in LIST to non-servadmins */
|
||||||
#define OLD_NI_HIDE_EMAIL 0x00000080 /* Don't show E-mail in INFO */
|
#define OLD_NI_HIDE_EMAIL 0x00000080 /* Don't show email in INFO */
|
||||||
#define OLD_NI_HIDE_MASK 0x00000100 /* Don't show last seen address in INFO */
|
#define OLD_NI_HIDE_MASK 0x00000100 /* Don't show last seen address in INFO */
|
||||||
#define OLD_NI_HIDE_QUIT 0x00000200 /* Don't show last quit message in INFO */
|
#define OLD_NI_HIDE_QUIT 0x00000200 /* Don't show last quit message in INFO */
|
||||||
#define OLD_NI_KILL_QUICK 0x00000400 /* Kill in 20 seconds instead of 60 */
|
#define OLD_NI_KILL_QUICK 0x00000400 /* Kill in 20 seconds instead of 60 */
|
||||||
@@ -60,7 +59,6 @@ else \
|
|||||||
#define OLD_CI_TOPICLOCK 0x00000008
|
#define OLD_CI_TOPICLOCK 0x00000008
|
||||||
#define OLD_CI_RESTRICTED 0x00000010
|
#define OLD_CI_RESTRICTED 0x00000010
|
||||||
#define OLD_CI_PEACE 0x00000020
|
#define OLD_CI_PEACE 0x00000020
|
||||||
#define OLD_CI_SECURE 0x00000040
|
|
||||||
#define OLD_CI_VERBOTEN 0x00000080
|
#define OLD_CI_VERBOTEN 0x00000080
|
||||||
#define OLD_CI_ENCRYPTEDPW 0x00000100
|
#define OLD_CI_ENCRYPTEDPW 0x00000100
|
||||||
#define OLD_CI_NO_EXPIRE 0x00000200
|
#define OLD_CI_NO_EXPIRE 0x00000200
|
||||||
@@ -154,7 +152,7 @@ static void process_mlock(ChannelInfo *ci, uint32_t lock, bool status, uint32_t
|
|||||||
if (cm && ml)
|
if (cm && ml)
|
||||||
{
|
{
|
||||||
if (limit && mlock_info.c == 'l')
|
if (limit && mlock_info.c == 'l')
|
||||||
ml->SetMLock(cm, status, stringify(*limit));
|
ml->SetMLock(cm, status, Anope::ToString(*limit));
|
||||||
else if (key && mlock_info.c == 'k')
|
else if (key && mlock_info.c == 'k')
|
||||||
ml->SetMLock(cm, status, *key);
|
ml->SetMLock(cm, status, *key);
|
||||||
else
|
else
|
||||||
@@ -207,7 +205,7 @@ static Anope::string Hex(const char *data, size_t l)
|
|||||||
{
|
{
|
||||||
const char hextable[] = "0123456789abcdef";
|
const char hextable[] = "0123456789abcdef";
|
||||||
|
|
||||||
std::string rv;
|
Anope::string rv;
|
||||||
for (size_t i = 0; i < l; ++i)
|
for (size_t i = 0; i < l; ++i)
|
||||||
{
|
{
|
||||||
unsigned char c = data[i];
|
unsigned char c = data[i];
|
||||||
@@ -323,7 +321,7 @@ static dbFILE *open_db_read(const char *service, const char *filename, int versi
|
|||||||
int myversion;
|
int myversion;
|
||||||
|
|
||||||
f = new dbFILE;
|
f = new dbFILE;
|
||||||
strscpy(f->filename, (Anope::DataDir + "/" + filename).c_str(), sizeof(f->filename));
|
strscpy(f->filename, Anope::ExpandData(filename).c_str(), sizeof(f->filename));
|
||||||
f->mode = 'r';
|
f->mode = 'r';
|
||||||
fp = fopen(f->filename, "rb");
|
fp = fopen(f->filename, "rb");
|
||||||
if (!fp)
|
if (!fp)
|
||||||
@@ -449,7 +447,7 @@ static void LoadNicks()
|
|||||||
READ(read_string(buffer, f));
|
READ(read_string(buffer, f));
|
||||||
auto *nc = new NickCore(buffer);
|
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" };
|
"hide_mask", "hide_quit", "memo_signon", "memo_receive", "autoop", "msg", "ns_keepmodes" };
|
||||||
for (const auto &setting : settings)
|
for (const auto &setting : settings)
|
||||||
nc->Shrink<bool>(setting.upper());
|
nc->Shrink<bool>(setting.upper());
|
||||||
@@ -483,8 +481,6 @@ static void LoadNicks()
|
|||||||
READ(read_uint32(&u32, f));
|
READ(read_uint32(&u32, f));
|
||||||
if (u32 & OLD_NI_KILLPROTECT)
|
if (u32 & OLD_NI_KILLPROTECT)
|
||||||
nc->Extend<bool>("KILLPROTECT");
|
nc->Extend<bool>("KILLPROTECT");
|
||||||
if (u32 & OLD_NI_SECURE)
|
|
||||||
nc->Extend<bool>("NS_SECURE");
|
|
||||||
if (u32 & OLD_NI_MSG)
|
if (u32 & OLD_NI_MSG)
|
||||||
nc->Extend<bool>("MSG");
|
nc->Extend<bool>("MSG");
|
||||||
if (u32 & OLD_NI_MEMO_HARDMAX)
|
if (u32 & OLD_NI_MEMO_HARDMAX)
|
||||||
@@ -571,7 +567,6 @@ static void LoadNicks()
|
|||||||
for (uint16_t j = 0; j < u16; ++j)
|
for (uint16_t j = 0; j < u16; ++j)
|
||||||
{
|
{
|
||||||
READ(read_string(buffer, f));
|
READ(read_string(buffer, f));
|
||||||
nc->access.push_back(buffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t i16;
|
int16_t i16;
|
||||||
@@ -695,7 +690,7 @@ static void LoadVHosts()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
na->SetVhost(ident, host, creator, vtime);
|
na->SetVHost(ident, host, creator, vtime);
|
||||||
|
|
||||||
Log() << "Loaded vhost for " << na->nick;
|
Log() << "Loaded vhost for " << na->nick;
|
||||||
}
|
}
|
||||||
@@ -752,7 +747,7 @@ static void LoadChannels()
|
|||||||
READ(read_buffer(namebuf, f));
|
READ(read_buffer(namebuf, f));
|
||||||
auto *ci = new ChannelInfo(namebuf);
|
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" };
|
"signkick", "signkick_level", "topiclock", "persist", "noautoop", "cs_keepmodes" };
|
||||||
for (const auto &setting : settings)
|
for (const auto &setting : settings)
|
||||||
ci->Shrink<bool>(setting.upper());
|
ci->Shrink<bool>(setting.upper());
|
||||||
@@ -801,8 +796,6 @@ static void LoadChannels()
|
|||||||
ci->Extend<bool>("RESTRICTED");
|
ci->Extend<bool>("RESTRICTED");
|
||||||
if (tmpu32 & OLD_CI_PEACE)
|
if (tmpu32 & OLD_CI_PEACE)
|
||||||
ci->Extend<bool>("PEACE");
|
ci->Extend<bool>("PEACE");
|
||||||
if (tmpu32 & OLD_CI_SECURE)
|
|
||||||
ci->Extend<bool>("CS_SECURE");
|
|
||||||
if (tmpu32 & OLD_CI_NO_EXPIRE)
|
if (tmpu32 & OLD_CI_NO_EXPIRE)
|
||||||
ci->Extend<bool>("CS_NO_EXPIRE");
|
ci->Extend<bool>("CS_NO_EXPIRE");
|
||||||
if (tmpu32 & OLD_CI_MEMO_HARDMAX)
|
if (tmpu32 & OLD_CI_MEMO_HARDMAX)
|
||||||
@@ -896,7 +889,7 @@ static void LoadChannels()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
access->AccessUnserialize(stringify(level));
|
access->AccessUnserialize(Anope::ToString(level));
|
||||||
}
|
}
|
||||||
|
|
||||||
Anope::string mask;
|
Anope::string mask;
|
||||||
|
|||||||
@@ -26,9 +26,9 @@ public:
|
|||||||
delete stream;
|
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)
|
if (!stream)
|
||||||
stream = new std::stringstream();
|
stream = new std::stringstream();
|
||||||
return *stream;
|
return *stream;
|
||||||
@@ -162,7 +162,7 @@ public:
|
|||||||
|
|
||||||
std::vector<Anope::string> args;
|
std::vector<Anope::string> args;
|
||||||
args.emplace_back("HGETALL");
|
args.emplace_back("HGETALL");
|
||||||
args.push_back("hash:" + t->GetName() + ":" + stringify(obj->id));
|
args.push_back("hash:" + t->GetName() + ":" + Anope::ToString(obj->id));
|
||||||
|
|
||||||
/* Get object attrs to clear before updating */
|
/* Get object attrs to clear before updating */
|
||||||
redis->SendCommand(new Updater(this, t->GetName(), obj->id), args);
|
redis->SendCommand(new Updater(this, t->GetName(), obj->id), args);
|
||||||
@@ -248,7 +248,7 @@ public:
|
|||||||
|
|
||||||
std::vector<Anope::string> args;
|
std::vector<Anope::string> args;
|
||||||
args.emplace_back("HGETALL");
|
args.emplace_back("HGETALL");
|
||||||
args.push_back("hash:" + t->GetName() + ":" + stringify(obj->id));
|
args.push_back("hash:" + t->GetName() + ":" + Anope::ToString(obj->id));
|
||||||
|
|
||||||
/* Get all of the attributes for this object */
|
/* Get all of the attributes for this object */
|
||||||
redis->SendCommand(new Deleter(this, t->GetName(), obj->id), args);
|
redis->SendCommand(new Deleter(this, t->GetName(), obj->id), args);
|
||||||
@@ -278,19 +278,14 @@ void TypeLoader::OnResult(const Reply &r)
|
|||||||
if (reply->type != Reply::BULK)
|
if (reply->type != Reply::BULK)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int64_t id;
|
auto i = Anope::TryConvert<int64_t>(reply->bulk);
|
||||||
try
|
if (!i)
|
||||||
{
|
|
||||||
id = convertTo<int64_t>(reply->bulk);
|
|
||||||
}
|
|
||||||
catch (const ConvertException &)
|
|
||||||
{
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
|
auto id = i.value();
|
||||||
std::vector<Anope::string> args;
|
std::vector<Anope::string> args;
|
||||||
args.emplace_back("HGETALL");
|
args.emplace_back("HGETALL");
|
||||||
args.push_back("hash:" + this->type + ":" + stringify(id));
|
args.push_back("hash:" + this->type + ":" + Anope::ToString(id));
|
||||||
|
|
||||||
me->redis->SendCommand(new ObjectLoader(me, this->type, id), args);
|
me->redis->SendCommand(new ObjectLoader(me, this->type, id), args);
|
||||||
}
|
}
|
||||||
@@ -318,7 +313,7 @@ void ObjectLoader::OnResult(const Reply &r)
|
|||||||
data[key->bulk] << value->bulk;
|
data[key->bulk] << value->bulk;
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable* &obj = st->objects[this->id];
|
Serializable *&obj = st->objects[this->id];
|
||||||
obj = st->Unserialize(obj, data);
|
obj = st->Unserialize(obj, data);
|
||||||
if (obj)
|
if (obj)
|
||||||
{
|
{
|
||||||
@@ -337,7 +332,7 @@ void IDInterface::OnResult(const Reply &r)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable* &obj = o->GetSerializableType()->objects[r.i];
|
Serializable *&obj = o->GetSerializableType()->objects[r.i];
|
||||||
if (obj)
|
if (obj)
|
||||||
/* This shouldn't be possible */
|
/* This shouldn't be possible */
|
||||||
obj->id = 0;
|
obj->id = 0;
|
||||||
@@ -364,7 +359,7 @@ void Deleter::OnResult(const Reply &r)
|
|||||||
|
|
||||||
std::vector<Anope::string> args;
|
std::vector<Anope::string> args;
|
||||||
args.emplace_back("DEL");
|
args.emplace_back("DEL");
|
||||||
args.push_back("hash:" + this->type + ":" + stringify(this->id));
|
args.push_back("hash:" + this->type + ":" + Anope::ToString(this->id));
|
||||||
|
|
||||||
/* Delete hash object */
|
/* Delete hash object */
|
||||||
me->redis->SendCommand(NULL, args);
|
me->redis->SendCommand(NULL, args);
|
||||||
@@ -372,7 +367,7 @@ void Deleter::OnResult(const Reply &r)
|
|||||||
args.clear();
|
args.clear();
|
||||||
args.emplace_back("SREM");
|
args.emplace_back("SREM");
|
||||||
args.push_back("ids:" + this->type);
|
args.push_back("ids:" + this->type);
|
||||||
args.push_back(stringify(this->id));
|
args.push_back(Anope::ToString(this->id));
|
||||||
|
|
||||||
/* Delete id from ids set */
|
/* Delete id from ids set */
|
||||||
me->redis->SendCommand(NULL, args);
|
me->redis->SendCommand(NULL, args);
|
||||||
@@ -385,7 +380,7 @@ void Deleter::OnResult(const Reply &r)
|
|||||||
args.clear();
|
args.clear();
|
||||||
args.emplace_back("SREM");
|
args.emplace_back("SREM");
|
||||||
args.push_back("value:" + this->type + ":" + key->bulk + ":" + value->bulk);
|
args.push_back("value:" + this->type + ":" + key->bulk + ":" + value->bulk);
|
||||||
args.push_back(stringify(this->id));
|
args.push_back(Anope::ToString(this->id));
|
||||||
|
|
||||||
/* Delete value -> object id */
|
/* Delete value -> object id */
|
||||||
me->redis->SendCommand(NULL, args);
|
me->redis->SendCommand(NULL, args);
|
||||||
@@ -428,7 +423,7 @@ void Updater::OnResult(const Reply &r)
|
|||||||
std::vector<Anope::string> args;
|
std::vector<Anope::string> args;
|
||||||
args.emplace_back("SREM");
|
args.emplace_back("SREM");
|
||||||
args.push_back("value:" + this->type + ":" + key->bulk + ":" + value->bulk);
|
args.push_back("value:" + this->type + ":" + key->bulk + ":" + value->bulk);
|
||||||
args.push_back(stringify(this->id));
|
args.push_back(Anope::ToString(this->id));
|
||||||
|
|
||||||
/* Delete value -> object id */
|
/* Delete value -> object id */
|
||||||
me->redis->SendCommand(NULL, args);
|
me->redis->SendCommand(NULL, args);
|
||||||
@@ -438,12 +433,12 @@ void Updater::OnResult(const Reply &r)
|
|||||||
std::vector<Anope::string> args;
|
std::vector<Anope::string> args;
|
||||||
args.emplace_back("SADD");
|
args.emplace_back("SADD");
|
||||||
args.push_back("ids:" + this->type);
|
args.push_back("ids:" + this->type);
|
||||||
args.push_back(stringify(obj->id));
|
args.push_back(Anope::ToString(obj->id));
|
||||||
me->redis->SendCommand(NULL, args);
|
me->redis->SendCommand(NULL, args);
|
||||||
|
|
||||||
args.clear();
|
args.clear();
|
||||||
args.emplace_back("HMSET");
|
args.emplace_back("HMSET");
|
||||||
args.push_back("hash:" + this->type + ":" + stringify(obj->id));
|
args.push_back("hash:" + this->type + ":" + Anope::ToString(obj->id));
|
||||||
|
|
||||||
for (const auto &[key, value] : data.data)
|
for (const auto &[key, value] : data.data)
|
||||||
{
|
{
|
||||||
@@ -454,7 +449,7 @@ void Updater::OnResult(const Reply &r)
|
|||||||
|
|
||||||
args2.emplace_back("SADD");
|
args2.emplace_back("SADD");
|
||||||
args2.push_back("value:" + this->type + ":" + key + ":" + value->str());
|
args2.push_back("value:" + this->type + ":" + key + ":" + value->str());
|
||||||
args2.push_back(stringify(obj->id));
|
args2.push_back(Anope::ToString(obj->id));
|
||||||
|
|
||||||
/* Add to value -> object id set */
|
/* Add to value -> object id set */
|
||||||
me->redis->SendCommand(NULL, args2);
|
me->redis->SendCommand(NULL, args2);
|
||||||
@@ -505,16 +500,11 @@ void SubscriptionListener::OnResult(const Reply &r)
|
|||||||
if (s_type == NULL)
|
if (s_type == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
uint64_t obj_id;
|
auto oid = Anope::TryConvert<uint64_t>(id);
|
||||||
try
|
if (!oid.has_value())
|
||||||
{
|
|
||||||
obj_id = convertTo<uint64_t>(id);
|
|
||||||
}
|
|
||||||
catch (const ConvertException &)
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
|
auto obj_id = oid.value();
|
||||||
if (op == "hset" || op == "hdel")
|
if (op == "hset" || op == "hdel")
|
||||||
{
|
{
|
||||||
Serializable *s = s_type->objects[obj_id];
|
Serializable *s = s_type->objects[obj_id];
|
||||||
@@ -537,7 +527,7 @@ void SubscriptionListener::OnResult(const Reply &r)
|
|||||||
}
|
}
|
||||||
else if (op == "del")
|
else if (op == "del")
|
||||||
{
|
{
|
||||||
Serializable* &s = s_type->objects[obj_id];
|
Serializable *&s = s_type->objects[obj_id];
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -564,7 +554,7 @@ void SubscriptionListener::OnResult(const Reply &r)
|
|||||||
std::vector<Anope::string> args;
|
std::vector<Anope::string> args;
|
||||||
args.emplace_back("SREM");
|
args.emplace_back("SREM");
|
||||||
args.push_back("ids:" + type);
|
args.push_back("ids:" + type);
|
||||||
args.push_back(stringify(s->id));
|
args.push_back(Anope::ToString(s->id));
|
||||||
|
|
||||||
/* Delete object from id set */
|
/* Delete object from id set */
|
||||||
me->redis->SendCommand(NULL, args);
|
me->redis->SendCommand(NULL, args);
|
||||||
@@ -587,7 +577,7 @@ void ModifiedObject::OnResult(const Reply &r)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable* &obj = st->objects[this->id];
|
Serializable *&obj = st->objects[this->id];
|
||||||
|
|
||||||
/* Transaction start */
|
/* Transaction start */
|
||||||
me->redis->StartTransaction();
|
me->redis->StartTransaction();
|
||||||
@@ -604,7 +594,7 @@ void ModifiedObject::OnResult(const Reply &r)
|
|||||||
std::vector<Anope::string> args;
|
std::vector<Anope::string> args;
|
||||||
args.emplace_back("SREM");
|
args.emplace_back("SREM");
|
||||||
args.push_back("value:" + st->GetName() + ":" + key + ":" + value->str());
|
args.push_back("value:" + st->GetName() + ":" + key + ":" + value->str());
|
||||||
args.push_back(stringify(this->id));
|
args.push_back(Anope::ToString(this->id));
|
||||||
|
|
||||||
/* Delete value -> object id */
|
/* Delete value -> object id */
|
||||||
me->redis->SendCommand(NULL, args);
|
me->redis->SendCommand(NULL, args);
|
||||||
@@ -633,7 +623,7 @@ void ModifiedObject::OnResult(const Reply &r)
|
|||||||
std::vector<Anope::string> args;
|
std::vector<Anope::string> args;
|
||||||
args.emplace_back("SADD");
|
args.emplace_back("SADD");
|
||||||
args.push_back("value:" + st->GetName() + ":" + key + ":" + value->str());
|
args.push_back("value:" + st->GetName() + ":" + key + ":" + value->str());
|
||||||
args.push_back(stringify(obj->id));
|
args.push_back(Anope::ToString(obj->id));
|
||||||
|
|
||||||
/* Add to value -> object id set */
|
/* Add to value -> object id set */
|
||||||
me->redis->SendCommand(NULL, args);
|
me->redis->SendCommand(NULL, args);
|
||||||
@@ -642,7 +632,7 @@ void ModifiedObject::OnResult(const Reply &r)
|
|||||||
std::vector<Anope::string> args;
|
std::vector<Anope::string> args;
|
||||||
args.emplace_back("SADD");
|
args.emplace_back("SADD");
|
||||||
args.push_back("ids:" + st->GetName());
|
args.push_back("ids:" + st->GetName());
|
||||||
args.push_back(stringify(obj->id));
|
args.push_back(Anope::ToString(obj->id));
|
||||||
|
|
||||||
/* Add to type -> id set */
|
/* Add to type -> id set */
|
||||||
me->redis->SendCommand(NULL, args);
|
me->redis->SendCommand(NULL, args);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user