mirror of
https://github.com/anope/anope.git
synced 2026-07-10 22:23:12 +02:00
Compare commits
76 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ab0b851d28 | |||
| 4e3720b810 | |||
| 4b48fc98d3 | |||
| 82993c8d1e | |||
| d352718a39 | |||
| d44632e57d | |||
| 80451011dd | |||
| b4e673b2f4 | |||
| 58a78e9aa5 | |||
| 6da4a148fa | |||
| a3edb09eda | |||
| 27beb8f877 | |||
| 136680f917 | |||
| 378ae21ac7 | |||
| e35a86661d | |||
| 528b5938ec | |||
| 03bee17063 | |||
| fe18050c49 | |||
| aa0496f69b | |||
| 4ee22ab05e | |||
| 63ad540e55 | |||
| a1165eea94 | |||
| bfca74f6b3 | |||
| 3acf74483c | |||
| a3ec8329f4 | |||
| 7d0184ca34 | |||
| 31bc597c81 | |||
| e0b687f289 | |||
| 2de0dddb1c | |||
| ff65b68dfa | |||
| 94456a6063 | |||
| 41ea346551 | |||
| 439ad3e736 | |||
| 347d82f59b | |||
| fe68f40634 | |||
| 08b1344056 | |||
| ff67a80a71 | |||
| 230e85798d | |||
| 9604690e9d | |||
| 01e0cf4868 | |||
| 693eeed762 | |||
| 6e5713d64a | |||
| 249ad3dfea | |||
| b94c3740b9 | |||
| 59ec42f0e6 | |||
| 8a65f116b6 | |||
| 8105607257 | |||
| 601da1141e | |||
| 8c0edef714 | |||
| c3efd9426d | |||
| a386439f86 | |||
| 016a5b3903 | |||
| 60aeb2a71a | |||
| 54ea63df66 | |||
| 01fc3ea22e | |||
| 3388736fab | |||
| 0065a0f405 | |||
| 490f832dc0 | |||
| a44acb6de5 | |||
| 13e5ddf807 | |||
| e42c728ab8 | |||
| 4eec5c5435 | |||
| 2667d9e90c | |||
| f2b66278aa | |||
| 5b7d952626 | |||
| 24375d53e6 | |||
| 88ac47e217 | |||
| 8a1bffba9b | |||
| 01eef7a392 | |||
| 67b76fadca | |||
| 7861712437 | |||
| ccc088d946 | |||
| 4468fe77fa | |||
| e71a9e2894 | |||
| f80bdf06ba | |||
| 2d6033c73f |
+2
-18
@@ -31,12 +31,8 @@ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang$")
|
|||||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs OUTPUT_VARIABLE LINES OUTPUT_STRIP_TRAILING_WHITESPACE)
|
execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs OUTPUT_VARIABLE LINES OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
# Find only the part after "libraries: "
|
# Find only the part after "libraries: "
|
||||||
string(REGEX REPLACE ".*\nlibraries: (.*)$" "\\1" LINE "${LINES}")
|
string(REGEX REPLACE ".*\nlibraries: (.*)$" "\\1" LINE "${LINES}")
|
||||||
# Replace the colons in the list with semicolons (only when not on MinGW, which uses semicolons already), and if on MinGW, just copy the line
|
# Replace the colons in the list with semicolons
|
||||||
if(NOT MINGW)
|
string(REGEX REPLACE ":" ";" LIBRARIES ${LINE})
|
||||||
string(REGEX REPLACE ":" ";" LIBRARIES ${LINE})
|
|
||||||
else()
|
|
||||||
set(LIBRARIES "${LINE}")
|
|
||||||
endif()
|
|
||||||
# Iterate through the libraries
|
# Iterate through the libraries
|
||||||
foreach(LIBRARY ${LIBRARIES})
|
foreach(LIBRARY ${LIBRARIES})
|
||||||
# Check if the first character is an equal sign, and skip that library directory as it is (I believe) the primary default and shows up later in the list anyways
|
# Check if the first character is an equal sign, and skip that library directory as it is (I believe) the primary default and shows up later in the list anyways
|
||||||
@@ -106,13 +102,6 @@ if(NOT MSVC)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# If running under MinGW, we have to force the resource compiler settings (hopefully this will be fixed in a later version of CMake)
|
|
||||||
if(MINGW)
|
|
||||||
set(CMAKE_RC_COMPILER_INIT windres)
|
|
||||||
enable_language(RC)
|
|
||||||
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -o <OBJECT> <SOURCE>")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Include the checking functions used later in this CMakeLists.txt
|
# Include the checking functions used later in this CMakeLists.txt
|
||||||
include(CheckFunctionExists)
|
include(CheckFunctionExists)
|
||||||
include(CheckTypeSize)
|
include(CheckTypeSize)
|
||||||
@@ -189,11 +178,6 @@ if(CMAKE_THREAD_LIBS_INIT)
|
|||||||
list(APPEND LINK_LIBS ${CMAKE_THREAD_LIBS_INIT})
|
list(APPEND LINK_LIBS ${CMAKE_THREAD_LIBS_INIT})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Under MinGW, the -shared flag isn't properly set in the module-specific linker flags, add it from the C flags for shared libraries
|
|
||||||
if(MINGW)
|
|
||||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT PROGRAM_NAME)
|
if(NOT PROGRAM_NAME)
|
||||||
set(PROGRAM_NAME anope)
|
set(PROGRAM_NAME anope)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -13,10 +13,6 @@
|
|||||||
#
|
#
|
||||||
###########################################################################
|
###########################################################################
|
||||||
|
|
||||||
echo2 () {
|
|
||||||
$ECHO2 "$*$ECHO2SUF" # these are defined later
|
|
||||||
}
|
|
||||||
|
|
||||||
exists () { # because some shells don't have test -e
|
exists () { # because some shells don't have test -e
|
||||||
if [ -f $1 -o -d $1 -o -p $1 -o -c $1 -o -b $1 ] ; then
|
if [ -f $1 -o -d $1 -o -p $1 -o -c $1 -o -b $1 ] ; then
|
||||||
return 0
|
return 0
|
||||||
@@ -42,7 +38,6 @@ Run_Build_System () {
|
|||||||
WITH_PERM=""
|
WITH_PERM=""
|
||||||
EXTRA_INCLUDE=""
|
EXTRA_INCLUDE=""
|
||||||
EXTRA_LIBS=""
|
EXTRA_LIBS=""
|
||||||
GEN_TYPE=""
|
|
||||||
|
|
||||||
if [ "$INSTDIR" != "" ] ; then
|
if [ "$INSTDIR" != "" ] ; then
|
||||||
WITH_INST="-DINSTDIR:STRING=$INSTDIR"
|
WITH_INST="-DINSTDIR:STRING=$INSTDIR"
|
||||||
@@ -70,45 +65,25 @@ Run_Build_System () {
|
|||||||
EXTRA_LIBS="-DEXTRA_LIBS:STRING=$EXTRA_LIB_DIRS"
|
EXTRA_LIBS="-DEXTRA_LIBS:STRING=$EXTRA_LIB_DIRS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$SOURCE_DIR" = "." ] ; then
|
BUILD_PATHS="-B ${SOURCE_DIR}/build ${SOURCE_DIR}"
|
||||||
pwdsave=`pwd`
|
|
||||||
test -d build || mkdir build
|
|
||||||
cd "build"
|
|
||||||
REAL_SOURCE_DIR=".."
|
|
||||||
else
|
|
||||||
REAL_SOURCE_DIR="$SOURCE_DIR"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR"
|
CMAKE="cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $BUILD_PATHS"
|
||||||
|
echo $CMAKE
|
||||||
|
$CMAKE
|
||||||
|
|
||||||
cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "You should fix these issues and then run ./Config -quick to rerun CMake."
|
echo "You should fix these issues and then run ./Config -quick to rerun CMake."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
if [ "$SOURCE_DIR" = "." ] ; then
|
if [ "$PWD" = "${SOURCE_DIR}/build" ]; then
|
||||||
echo "Now cd build, then run make to build Anope."
|
|
||||||
cd "$pwdsave"
|
|
||||||
else
|
|
||||||
echo "Now run make to build Anope."
|
echo "Now run make to build Anope."
|
||||||
|
else
|
||||||
|
echo "Now cd build, then run make to build Anope."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
ECHO2SUF=''
|
|
||||||
if [ "`echo -n a ; echo -n b`" = "ab" ] ; then
|
|
||||||
ECHO2='echo -n'
|
|
||||||
elif [ "`echo 'a\c' ; echo 'b\c'`" = "ab" ] ; then
|
|
||||||
ECHO2='echo' ; ECHO2SUF='\c'
|
|
||||||
elif [ "`printf 'a' 2>&1 ; printf 'b' 2>&1`" = "ab" ] ; then
|
|
||||||
ECHO2='printf "%s"'
|
|
||||||
else
|
|
||||||
# oh well...
|
|
||||||
ECHO2='echo'
|
|
||||||
fi
|
|
||||||
export ECHO2 ECHO2SUF
|
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
# Init values
|
# Init values
|
||||||
###########################################################################
|
###########################################################################
|
||||||
@@ -121,7 +96,7 @@ EXTRA_INCLUDE_DIRS=
|
|||||||
EXTRA_LIB_DIRS=
|
EXTRA_LIB_DIRS=
|
||||||
EXTRA_CONFIG_ARGS=
|
EXTRA_CONFIG_ARGS=
|
||||||
CAN_QUICK="no"
|
CAN_QUICK="no"
|
||||||
SOURCE_DIR=`dirname $0`
|
SOURCE_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
# Check out the options
|
# Check out the options
|
||||||
@@ -138,7 +113,7 @@ while [ $# -ge 1 ] ; do
|
|||||||
exit 0
|
exit 0
|
||||||
elif [ $1 = "-devel" ] ; then
|
elif [ $1 = "-devel" ] ; then
|
||||||
DEBUG="yes"
|
DEBUG="yes"
|
||||||
INSTDIR="$PWD/run"
|
INSTDIR="$SOURCE_DIR/run"
|
||||||
elif [ $1 = "-nocache" ] ; then
|
elif [ $1 = "-nocache" ] ; then
|
||||||
IGNORE_CACHE="1"
|
IGNORE_CACHE="1"
|
||||||
elif [ $1 = "-nointro" ] ; then
|
elif [ $1 = "-nointro" ] ; then
|
||||||
@@ -199,7 +174,7 @@ export ok INPUT
|
|||||||
ok=0
|
ok=0
|
||||||
echo "In what directory should Anope be installed?"
|
echo "In what directory should Anope be installed?"
|
||||||
while [ $ok -eq 0 ] ; do
|
while [ $ok -eq 0 ] ; do
|
||||||
echo2 "[$INSTDIR] "
|
echo -n "[$INSTDIR] "
|
||||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||||
if [ ! "$INPUT" ] ; then
|
if [ ! "$INPUT" ] ; then
|
||||||
INPUT=$INSTDIR
|
INPUT=$INSTDIR
|
||||||
@@ -209,7 +184,7 @@ while [ $ok -eq 0 ] ; do
|
|||||||
echo "$INPUT exists, but is not a directory!"
|
echo "$INPUT exists, but is not a directory!"
|
||||||
else
|
else
|
||||||
echo "$INPUT does not exist. Create it?"
|
echo "$INPUT does not exist. Create it?"
|
||||||
echo2 "[y] "
|
echo -n "[y] "
|
||||||
read YN
|
read YN
|
||||||
if [ "$YN" != "n" ] ; then
|
if [ "$YN" != "n" ] ; then
|
||||||
if mkdir -p $INPUT ; then
|
if mkdir -p $INPUT ; then
|
||||||
@@ -238,7 +213,7 @@ else
|
|||||||
echo "should not force files to be owned by a particular group, just press"
|
echo "should not force files to be owned by a particular group, just press"
|
||||||
echo "Return.)"
|
echo "Return.)"
|
||||||
fi
|
fi
|
||||||
echo2 "[$RUNGROUP] "
|
echo -n "[$RUNGROUP] "
|
||||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||||
if [ "$INPUT" ] ; then
|
if [ "$INPUT" ] ; then
|
||||||
if [ "$INPUT" = "none" ] ; then
|
if [ "$INPUT" = "none" ] ; then
|
||||||
@@ -263,7 +238,7 @@ ok=0
|
|||||||
echo "What should the default umask for data files be (in octal)?"
|
echo "What should the default umask for data files be (in octal)?"
|
||||||
echo "(077 = only accessible by owner; 007 = accessible by owner and group)"
|
echo "(077 = only accessible by owner; 007 = accessible by owner and group)"
|
||||||
while [ $ok -eq 0 ] ; do
|
while [ $ok -eq 0 ] ; do
|
||||||
echo2 "[$UMASK] "
|
echo -n "[$UMASK] "
|
||||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||||
if [ ! "$INPUT" ] ; then
|
if [ ! "$INPUT" ] ; then
|
||||||
INPUT=$UMASK
|
INPUT=$UMASK
|
||||||
@@ -287,7 +262,7 @@ if [ "$DEBUG" = "yes" ] ; then
|
|||||||
TEMP_YN="y"
|
TEMP_YN="y"
|
||||||
fi
|
fi
|
||||||
echo "Would you like to build a debug version of Anope?"
|
echo "Would you like to build a debug version of Anope?"
|
||||||
echo2 "[$TEMP_YN] "
|
echo -n "[$TEMP_YN] "
|
||||||
read YN
|
read YN
|
||||||
if [ "$YN" ] ; then
|
if [ "$YN" ] ; then
|
||||||
if [ "$YN" = "y" ] ; then
|
if [ "$YN" = "y" ] ; then
|
||||||
@@ -305,7 +280,7 @@ echo "You may only need to do this if CMake is unable to locate"
|
|||||||
echo "missing dependencies without hints."
|
echo "missing dependencies without hints."
|
||||||
echo "Separate directories with semicolons."
|
echo "Separate directories with semicolons."
|
||||||
echo "If you need no extra include directories, enter NONE in all caps."
|
echo "If you need no extra include directories, enter NONE in all caps."
|
||||||
echo2 "[$EXTRA_INCLUDE_DIRS] "
|
echo -n "[$EXTRA_INCLUDE_DIRS] "
|
||||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||||
if [ "$INPUT" ] ; then
|
if [ "$INPUT" ] ; then
|
||||||
if [ "$INPUT" = "NONE" ] ; then
|
if [ "$INPUT" = "NONE" ] ; then
|
||||||
@@ -323,7 +298,7 @@ echo "You may only need to do this if CMake is unable to locate"
|
|||||||
echo "missing dependencies without hints."
|
echo "missing dependencies without hints."
|
||||||
echo "Separate directories with semicolons."
|
echo "Separate directories with semicolons."
|
||||||
echo "If you need no extra library directories, enter NONE in all caps."
|
echo "If you need no extra library directories, enter NONE in all caps."
|
||||||
echo2 "[$EXTRA_LIB_DIRS] "
|
echo -n "[$EXTRA_LIB_DIRS] "
|
||||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||||
if [ "$INPUT" ] ; then
|
if [ "$INPUT" ] ; then
|
||||||
if [ "$INPUT" = "NONE" ] ; then
|
if [ "$INPUT" = "NONE" ] ; then
|
||||||
@@ -338,7 +313,7 @@ echo ""
|
|||||||
|
|
||||||
echo "Are there any extra arguments you wish to pass to CMake?"
|
echo "Are there any extra arguments you wish to pass to CMake?"
|
||||||
echo "If you need no extra arguments to CMake, enter NONE in all caps."
|
echo "If you need no extra arguments to CMake, enter NONE in all caps."
|
||||||
echo2 "[$EXTRA_CONFIG_ARGS] "
|
echo -n "[$EXTRA_CONFIG_ARGS] "
|
||||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||||
if [ "$INPUT" ] ; then
|
if [ "$INPUT" ] ; then
|
||||||
if [ "$INPUT" = "NONE" ] ; then
|
if [ "$INPUT" = "NONE" ] ; then
|
||||||
@@ -355,7 +330,7 @@ echo ""
|
|||||||
# Store values
|
# Store values
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
echo2 "Saving configuration results in config.cache... "
|
echo -n "Saving configuration results in config.cache... "
|
||||||
|
|
||||||
cat <<EOT >$SOURCE_DIR/config.cache
|
cat <<EOT >$SOURCE_DIR/config.cache
|
||||||
INSTDIR="$INSTDIR"
|
INSTDIR="$INSTDIR"
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
# Only install example.chk and anope.example.conf from this directory
|
# Only install example.chk and anope.example.conf from this directory
|
||||||
# NOTE: I would've had this just find all files in the directory, but that would include files not needed (like this file)
|
# NOTE: I would've had this just find all files in the directory, but that would include files not needed (like this file)
|
||||||
set(DATA example.chk anope.example.conf botserv.example.conf hostserv.example.conf modules.example.conf operserv.example.conf chanserv.example.conf global.example.conf memoserv.example.conf nickserv.example.conf chanstats.example.conf irc2sql.example.conf stats.standalone.example.conf)
|
set(DATA cron.example.sh anope.example.conf botserv.example.conf hostserv.example.conf modules.example.conf operserv.example.conf chanserv.example.conf global.example.conf memoserv.example.conf nickserv.example.conf chanstats.example.conf irc2sql.example.conf stats.standalone.example.conf)
|
||||||
install(FILES ${DATA}
|
install(FILES ${DATA}
|
||||||
DESTINATION ${CONF_DIR}
|
DESTINATION ${CONF_DIR}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -402,7 +402,7 @@ options
|
|||||||
/*
|
/*
|
||||||
* Sets the delay between automatic database updates.
|
* Sets the delay between automatic database updates.
|
||||||
*/
|
*/
|
||||||
updatetimeout = 5m
|
updatetimeout = 2m
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sets the delay between checks for expired nicknames and channels.
|
* Sets the delay between checks for expired nicknames and channels.
|
||||||
@@ -511,7 +511,7 @@ options
|
|||||||
*
|
*
|
||||||
* Removing .UTF-8 will instead use the default encoding for the language, e.g. iso-8859-1 for western European languages.
|
* Removing .UTF-8 will instead use the default encoding for the language, e.g. iso-8859-1 for western European languages.
|
||||||
*/
|
*/
|
||||||
languages = "ca_ES.UTF-8 de_DE.UTF-8 el_GR.UTF-8 es_ES.UTF-8 fr_FR.UTF-8 hu_HU.UTF-8 it_IT.UTF-8 nl_NL.UTF-8 pl_PL.UTF-8 pt_PT.UTF-8 ru_RU.UTF-8 tr_TR.UTF-8"
|
languages = "de_DE.UTF-8 el_GR.UTF-8 es_ES.UTF-8 fr_FR.UTF-8 it_IT.UTF-8 nl_NL.UTF-8 pl_PL.UTF-8 pt_PT.UTF-8 tr_TR.UTF-8"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Default language that non- and newly-registered nicks will receive messages in.
|
* Default language that non- and newly-registered nicks will receive messages in.
|
||||||
@@ -730,7 +730,7 @@ log
|
|||||||
*
|
*
|
||||||
* Available privileges:
|
* Available privileges:
|
||||||
* botserv/administration - Can view and assign private BotServ bots
|
* botserv/administration - Can view and assign private BotServ bots
|
||||||
* botserv/fantasy - Can use fantasy commands without the FANTASIA privilege
|
* botserv/fantasy - Can use fantasy commands without the FANTASY privilege
|
||||||
* chanserv/administration - Can modify the settings of any channel (including changing of the owner!)
|
* chanserv/administration - Can modify the settings of any channel (including changing of the owner!)
|
||||||
* chanserv/access/list - Can view channel access and akick lists, but not modify them
|
* chanserv/access/list - Can view channel access and akick lists, but not modify them
|
||||||
* chanserv/access/modify - Can modify channel access and akick lists, and use /chanserv enforce
|
* chanserv/access/modify - Can modify channel access and akick lists, and use /chanserv enforce
|
||||||
@@ -746,6 +746,7 @@ log
|
|||||||
* nickserv/cert - Can modify other users certificate lists
|
* 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/drop/display - Allows dropping display nicks when preservedisplay is enabled
|
||||||
* nickserv/drop/override - Allows dropping nicks without using a confirmation code
|
* nickserv/drop/override - Allows dropping nicks without using a confirmation code
|
||||||
* nickserv/recover - Can recover other users nicks
|
* nickserv/recover - Can recover other users nicks
|
||||||
* operserv/config - Can modify services's configuration
|
* operserv/config - Can modify services's configuration
|
||||||
@@ -915,7 +916,7 @@ mail
|
|||||||
* If set, this option enables the mail commands in Anope. You may choose
|
* If set, this option enables the mail commands in Anope. You may choose
|
||||||
* to disable it if you have no Sendmail-compatible mailer installed. Whilst
|
* to disable it if you have no Sendmail-compatible mailer installed. Whilst
|
||||||
* this directive (and entire block) is optional, it is required if
|
* this directive (and entire block) is optional, it is required if
|
||||||
* nickserv:registration is set to yes.
|
* nickserv:registration is set to mail.
|
||||||
*/
|
*/
|
||||||
usemail = yes
|
usemail = yes
|
||||||
|
|
||||||
|
|||||||
@@ -107,10 +107,9 @@ module
|
|||||||
/*
|
/*
|
||||||
* The length of time before a channel registration expires.
|
* The length of time before a channel registration expires.
|
||||||
*
|
*
|
||||||
* This directive is optional, but recommended.
|
* This directive is optional. If not set, the default is never.
|
||||||
* If not set, the default is 30 days.
|
|
||||||
*/
|
*/
|
||||||
expire = 30d
|
#expire = 90d
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The maximum number of entries on a channel's access list.
|
* The maximum number of entries on a channel's access list.
|
||||||
@@ -392,7 +391,7 @@ privilege
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FANTASIA privilege.
|
* FANTASY privilege.
|
||||||
*
|
*
|
||||||
* Used by botserv/main and chanserv/xop.
|
* Used by botserv/main and chanserv/xop.
|
||||||
*
|
*
|
||||||
@@ -400,7 +399,7 @@ privilege
|
|||||||
*/
|
*/
|
||||||
privilege
|
privilege
|
||||||
{
|
{
|
||||||
name = "FANTASIA"
|
name = "FANTASY"
|
||||||
desc = _("Allowed to use fantasy commands")
|
desc = _("Allowed to use fantasy commands")
|
||||||
rank = 30
|
rank = 30
|
||||||
level = 3
|
level = 3
|
||||||
@@ -1278,7 +1277,7 @@ module
|
|||||||
* This directive is optional.
|
* This directive is optional.
|
||||||
* If not set, the default is never.
|
* If not set, the default is never.
|
||||||
*/
|
*/
|
||||||
expire = 90d
|
suspendexpire = 90d
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Settings to show to non-opers in ChanServ's INFO output.
|
* Settings to show to non-opers in ChanServ's INFO output.
|
||||||
|
|||||||
@@ -372,6 +372,7 @@ module { name = "help" }
|
|||||||
username = "anope"
|
username = "anope"
|
||||||
password = "mypassword"
|
password = "mypassword"
|
||||||
port = 3306
|
port = 3306
|
||||||
|
socket = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -754,7 +755,7 @@ module { name = "sasl" }
|
|||||||
name = "sqlite/main"
|
name = "sqlite/main"
|
||||||
|
|
||||||
/* The database name, it will be created if it does not exist. */
|
/* The database name, it will be created if it does not exist. */
|
||||||
database = "anope.db"
|
database = "anope.sqlite"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -772,16 +773,16 @@ module { name = "sasl" }
|
|||||||
name = "webcpanel"
|
name = "webcpanel"
|
||||||
|
|
||||||
/* Web server to use. */
|
/* Web server to use. */
|
||||||
server = "httpd/main";
|
server = "httpd/main"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The directory containing the webcpanel templates. This is relative to the
|
* The directory containing the webcpanel templates. This is relative to the
|
||||||
* data directory.
|
* data directory.
|
||||||
*/
|
*/
|
||||||
template_dir = "webcpanel/templates/default";
|
template_dir = "webcpanel/templates/default"
|
||||||
|
|
||||||
/* Page title. */
|
/* Page title. */
|
||||||
title = "Anope IRC Services";
|
title = "Anope IRC Services"
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -219,6 +219,12 @@ module
|
|||||||
* This directive is optional. If not set it defaults to 50.
|
* This directive is optional. If not set it defaults to 50.
|
||||||
*/
|
*/
|
||||||
maxpasslen = 50
|
maxpasslen = 50
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Whether all of the secondary nicks of a nick group have to expire or be
|
||||||
|
dropped before the display nick can expire or be dropped.
|
||||||
|
*/
|
||||||
|
preservedisplay = no
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -506,7 +512,6 @@ command { service = "NickServ"; name = "RESETPASS"; command = "nickserv/resetpas
|
|||||||
* nickserv/set/email, nickserv/saset/email - Used for setting a users email address.
|
* nickserv/set/email, nickserv/saset/email - Used for setting a users email address.
|
||||||
* nickserv/set/keepmodes, nickserv/saset/keepmodes - Configure whether or not services should retain a user's modes across sessions.
|
* nickserv/set/keepmodes, nickserv/saset/keepmodes - Configure whether or not services should retain a user's modes across sessions.
|
||||||
* 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/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/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.
|
||||||
@@ -542,9 +547,6 @@ command { service = "NickServ"; name = "SASET KEEPMODES"; command = "nickserv/sa
|
|||||||
command { service = "NickServ"; name = "SET KILL"; command = "nickserv/set/kill"; }
|
command { service = "NickServ"; name = "SET KILL"; command = "nickserv/set/kill"; }
|
||||||
command { service = "NickServ"; name = "SASET KILL"; command = "nickserv/saset/kill"; permission = "nickserv/saset/kill"; }
|
command { service = "NickServ"; name = "SASET KILL"; command = "nickserv/saset/kill"; permission = "nickserv/saset/kill"; }
|
||||||
|
|
||||||
command { service = "NickServ"; name = "SET LANGUAGE"; command = "nickserv/set/language"; }
|
|
||||||
command { service = "NickServ"; name = "SASET LANGUAGE"; command = "nickserv/saset/language"; permission = "nickserv/saset/language"; }
|
|
||||||
|
|
||||||
command { service = "NickServ"; name = "SET MESSAGE"; command = "nickserv/set/message"; }
|
command { service = "NickServ"; name = "SET MESSAGE"; command = "nickserv/set/message"; }
|
||||||
command { service = "NickServ"; name = "SASET MESSAGE"; command = "nickserv/saset/message"; permission = "nickserv/saset/message"; }
|
command { service = "NickServ"; name = "SASET MESSAGE"; command = "nickserv/saset/message"; permission = "nickserv/saset/message"; }
|
||||||
|
|
||||||
@@ -556,6 +558,16 @@ command { service = "NickServ"; name = "SASET NEVEROP"; command = "nickserv/sase
|
|||||||
|
|
||||||
command { service = "NickServ"; name = "SASET NOEXPIRE"; command = "nickserv/saset/noexpire"; permission = "nickserv/saset/noexpire"; }
|
command { service = "NickServ"; name = "SASET NOEXPIRE"; command = "nickserv/saset/noexpire"; permission = "nickserv/saset/noexpire"; }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ns_set_language
|
||||||
|
*
|
||||||
|
* Provides the command nickserv/set/language and nickserv/saset/language.
|
||||||
|
*
|
||||||
|
* Allows configuring the language that services uses.
|
||||||
|
*/
|
||||||
|
module { name = "ns_set_language" }
|
||||||
|
command { service = "NickServ"; name = "SET LANGUAGE"; command = "nickserv/set/language"; }
|
||||||
|
command { service = "NickServ"; name = "SASET LANGUAGE"; command = "nickserv/saset/language"; permission = "nickserv/saset/language"; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ns_set_misc
|
* ns_set_misc
|
||||||
|
|||||||
@@ -1,3 +1,29 @@
|
|||||||
|
Anope Version 2.1.8
|
||||||
|
-------------------
|
||||||
|
Added account identifiers to the nickserv/info output.
|
||||||
|
Added support for bool, float, and uint SQL columns.
|
||||||
|
Added the ability to automatically determine SQL column types based on the native type.
|
||||||
|
Added UNIX socket support to mysql module.
|
||||||
|
Changed smartjoin to use SendClearBans where available.
|
||||||
|
Dropped support for MinGW in favour of native builds.
|
||||||
|
Fixed parsing named extbans on InspIRCd.
|
||||||
|
Fixed parsing SVSMODE and SVS2MODE from UnrealIRCd.
|
||||||
|
Fixed sending global messages to remotely linked servers.
|
||||||
|
Removed the services server name from the CTCP version response.
|
||||||
|
|
||||||
|
Anope Version 2.1.7
|
||||||
|
-------------------
|
||||||
|
Added importing of akick reasons, forbid reasons, opers and session exceptions to db_atheme.
|
||||||
|
Added support for sending tag messages.
|
||||||
|
Added the ability to look up account information of an authenticated user.
|
||||||
|
Fixed a crash in ns_cert when an IRC user is not present during a nick registration.
|
||||||
|
Fixed a null pointer dereference in the global module.
|
||||||
|
Fixed a rare memory leak in os_akill and os_sxline.
|
||||||
|
Improved the performance of some code that looks up the primary nick from an account.
|
||||||
|
Removed the broken Catalan, Hungarian, and Russian translations.
|
||||||
|
Reworked the protocol interface for sending messages.
|
||||||
|
Updated the Turkish translation.
|
||||||
|
|
||||||
Anope Version 2.1.6
|
Anope Version 2.1.6
|
||||||
-------------------
|
-------------------
|
||||||
Added opportunistic upgrading of TLS fingerprints to more secure algorithms on InspIRCd.
|
Added opportunistic upgrading of TLS fingerprints to more secure algorithms on InspIRCd.
|
||||||
|
|||||||
@@ -1,3 +1,14 @@
|
|||||||
|
Anope Version 2.1.8
|
||||||
|
-------------------
|
||||||
|
Added module:preservedisplay to the nickserv module.
|
||||||
|
Added the nickserv/drop/display oper privilege.
|
||||||
|
|
||||||
|
Anope Version 2.1.7
|
||||||
|
-------------------
|
||||||
|
Moved nickserv/set/language and nickserv/saset/language to the ns_set_language module.
|
||||||
|
Renamed module:expire for the cs_suspend module to suspendexpire.
|
||||||
|
Renamed the FANTASIA privilege to FANTASY.
|
||||||
|
|
||||||
Anope Version 2.1.6
|
Anope Version 2.1.6
|
||||||
-------------------
|
-------------------
|
||||||
Added module:automatic to the ns_cert module (defaults to yes).
|
Added module:automatic to the ns_cert module (defaults to yes).
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ Anope Multi Language Support
|
|||||||
Then execute:
|
Then execute:
|
||||||
dpkg-reconfigure locales
|
dpkg-reconfigure locales
|
||||||
|
|
||||||
|
If you have already built Anope you will need to delete the build directory and rebuild from scratch.
|
||||||
|
|
||||||
Building Anope on Windows with gettext support is explained in docs/WIN32.txt
|
Building Anope on Windows with gettext support is explained in docs/WIN32.txt
|
||||||
|
|
||||||
2) Adding a new language
|
2) Adding a new language
|
||||||
|
|||||||
+3
-1
@@ -145,6 +145,8 @@ public:
|
|||||||
|
|
||||||
/* Unsaved data */
|
/* Unsaved data */
|
||||||
|
|
||||||
|
/** The display nick for this account. */
|
||||||
|
NickAlias *na = nullptr;
|
||||||
/* Number of channels registered by this account */
|
/* Number of channels registered by this account */
|
||||||
uint16_t channelcount = 0;
|
uint16_t channelcount = 0;
|
||||||
/* Users online now logged into this account */
|
/* Users online now logged into this account */
|
||||||
@@ -163,7 +165,7 @@ public:
|
|||||||
/** 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.
|
||||||
*/
|
*/
|
||||||
void SetDisplay(const NickAlias *na);
|
void SetDisplay(NickAlias *na);
|
||||||
|
|
||||||
/** Checks whether this account is a services oper or not.
|
/** Checks whether this account is a services oper or not.
|
||||||
* @return True if this account is a services oper, false otherwise.
|
* @return True if this account is a services oper, false otherwise.
|
||||||
|
|||||||
@@ -601,6 +601,20 @@ namespace Anope
|
|||||||
/** Expands a module path. */
|
/** Expands a module path. */
|
||||||
inline auto ExpandModule(const Anope::string &path) { return Expand(ModuleDir, path); }
|
inline auto ExpandModule(const Anope::string &path) { return Expand(ModuleDir, path); }
|
||||||
|
|
||||||
|
/** Formats a CTCP message for sending to a client.
|
||||||
|
* @param name The name of the CTCP.
|
||||||
|
* @param body If present then the body of the CTCP.
|
||||||
|
* @return A formatted CTCP ready to send to a client.
|
||||||
|
*/
|
||||||
|
extern CoreExport Anope::string FormatCTCP(const Anope::string &name, const Anope::string &body = "");
|
||||||
|
|
||||||
|
/** Parses a CTCP message received from a client.
|
||||||
|
* @param text The raw message to parse.
|
||||||
|
* @param name The location to store the name of the CTCP.
|
||||||
|
* @param body The location to store body of the CTCP if one is present.
|
||||||
|
* @return True if the message was a well formed CTCP; otherwise, false.
|
||||||
|
*/
|
||||||
|
extern CoreExport bool ParseCTCP(const Anope::string &text, Anope::string &name, Anope::string &body);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** sepstream allows for splitting token separated lists.
|
/** sepstream allows for splitting token separated lists.
|
||||||
|
|||||||
@@ -173,7 +173,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.Store(this->name, *t);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
||||||
@@ -194,8 +194,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
|
||||||
{
|
{
|
||||||
data.SetType(this->name, Serialize::Data::DT_INT);
|
data.Store(this->name, true);
|
||||||
data[this->name] << true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
||||||
|
|||||||
+1
-1
@@ -108,7 +108,7 @@ namespace Language
|
|||||||
#define CHAN_SETTING_CHANGED _("%s for %s set to %s.")
|
#define CHAN_SETTING_CHANGED _("%s for %s set to %s.")
|
||||||
#define CHAN_SETTING_UNSET _("%s for %s unset.")
|
#define CHAN_SETTING_UNSET _("%s for %s unset.")
|
||||||
#define CHAN_ACCESS_LEVEL_RANGE _("Access level must be between %d and %d inclusive.")
|
#define CHAN_ACCESS_LEVEL_RANGE _("Access level must be between %d and %d inclusive.")
|
||||||
#define CHAN_INFO_HEADER _("Information for channel \002%s\002:")
|
#define CHAN_INFO_HEADER _("Information about channel \002%s\002:")
|
||||||
#define CHAN_EXCEPTED _("\002%s\002 matches an except on %s and cannot be banned until the except has been removed.")
|
#define CHAN_EXCEPTED _("\002%s\002 matches an except on %s and cannot be banned until the except has been removed.")
|
||||||
#define MEMO_NEW_X_MEMO_ARRIVED _("There is a new memo on channel %s.\n" \
|
#define MEMO_NEW_X_MEMO_ARRIVED _("There is a new memo on channel %s.\n" \
|
||||||
"Type \002%s%s READ %s %zu\002 to read it.")
|
"Type \002%s%s READ %s %zu\002 to read it.")
|
||||||
|
|||||||
+118
-118
@@ -290,7 +290,7 @@ public:
|
|||||||
* @param cu The user, channel, and status of the user being kicked
|
* @param cu The user, channel, and status of the user being kicked
|
||||||
* @param kickmsg The reason for the kick.
|
* @param kickmsg The reason for the kick.
|
||||||
*/
|
*/
|
||||||
virtual void OnPreUserKicked(const MessageSource &source, ChanUserContainer *cu, const Anope::string &kickmsg) { throw NotImplementedException(); }
|
virtual void OnPreUserKicked(const MessageSource &source, ChanUserContainer *cu, const Anope::string &kickmsg) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a user has been kicked from a channel.
|
/** Called when a user has been kicked from a channel.
|
||||||
* @param source The kicker
|
* @param source The kicker
|
||||||
@@ -299,13 +299,13 @@ public:
|
|||||||
* @param status The status the kicked user had on the channel before they were kicked
|
* @param status The status the kicked user had on the channel before they were kicked
|
||||||
* @param kickmsg The reason for the kick.
|
* @param kickmsg The reason for the kick.
|
||||||
*/
|
*/
|
||||||
virtual void OnUserKicked(const MessageSource &source, User *target, const Anope::string &channel, ChannelStatus &status, const Anope::string &kickmsg) { throw NotImplementedException(); }
|
virtual void OnUserKicked(const MessageSource &source, User *target, const Anope::string &channel, ChannelStatus &status, const Anope::string &kickmsg) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when the configuration is being (re)loaded.
|
/** Called when the configuration is being (re)loaded.
|
||||||
* @param conf The config that is being built now and will replace the global Config object
|
* @param conf The config that is being built now and will replace the global Config object
|
||||||
* @throws A ConfigException to abort the config (re)loading process.
|
* @throws A ConfigException to abort the config (re)loading process.
|
||||||
*/
|
*/
|
||||||
virtual void OnReload(Configuration::Conf *conf) { throw NotImplementedException(); }
|
virtual void OnReload(Configuration::Conf *conf) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called before a bot is assigned to a channel.
|
/** Called before a bot is assigned to a channel.
|
||||||
* @param sender The user assigning the bot
|
* @param sender The user assigning the bot
|
||||||
@@ -313,35 +313,35 @@ public:
|
|||||||
* @param bi The bot being assigned.
|
* @param bi The bot being assigned.
|
||||||
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the assign.
|
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the assign.
|
||||||
*/
|
*/
|
||||||
virtual EventReturn OnPreBotAssign(User *sender, ChannelInfo *ci, BotInfo *bi) { throw NotImplementedException(); }
|
virtual EventReturn OnPreBotAssign(User *sender, ChannelInfo *ci, BotInfo *bi) ATTR_NOT_NULL(2, 3, 4) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a bot is assigned ot a channel
|
/** Called when a bot is assigned ot a channel
|
||||||
*/
|
*/
|
||||||
virtual void OnBotAssign(User *sender, ChannelInfo *ci, BotInfo *bi) { throw NotImplementedException(); }
|
virtual void OnBotAssign(User *sender, ChannelInfo *ci, BotInfo *bi) ATTR_NOT_NULL(2, 3, 4) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called before a bot is unassigned from a channel.
|
/** Called before a bot is unassigned from a channel.
|
||||||
* @param sender The user unassigning the bot
|
* @param sender The user unassigning the bot
|
||||||
* @param ci The channel the bot is being removed from
|
* @param ci The channel the bot is being removed from
|
||||||
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the unassign.
|
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the unassign.
|
||||||
*/
|
*/
|
||||||
virtual EventReturn OnBotUnAssign(User *sender, ChannelInfo *ci) { throw NotImplementedException(); }
|
virtual EventReturn OnBotUnAssign(User *sender, ChannelInfo *ci) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a new user connects to the network.
|
/** Called when a new user connects to the network.
|
||||||
* @param u The connecting user.
|
* @param u The connecting user.
|
||||||
* @param exempt set to true/is true if the user should be excepted from bans etc
|
* @param exempt set to true/is true if the user should be excepted from bans etc
|
||||||
*/
|
*/
|
||||||
virtual void OnUserConnect(User *u, bool &exempt) { throw NotImplementedException(); }
|
virtual void OnUserConnect(User *u, bool &exempt) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a new server connects to the network.
|
/** Called when a new server connects to the network.
|
||||||
* @param s The server that has connected to the network
|
* @param s The server that has connected to the network
|
||||||
*/
|
*/
|
||||||
virtual void OnNewServer(Server *s) { throw NotImplementedException(); }
|
virtual void OnNewServer(Server *s) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called after a user changed the nick
|
/** Called after a user changed the nick
|
||||||
* @param u The user.
|
* @param u The user.
|
||||||
* @param oldnick The old nick of the user
|
* @param oldnick The old nick of the user
|
||||||
*/
|
*/
|
||||||
virtual void OnUserNickChange(User *u, const Anope::string &oldnick) { throw NotImplementedException(); }
|
virtual void OnUserNickChange(User *u, const Anope::string &oldnick) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when someone uses the generic/help command
|
/** Called when someone uses the generic/help command
|
||||||
* @param source Command source
|
* @param source Command source
|
||||||
@@ -362,14 +362,14 @@ public:
|
|||||||
* @param params The parameters the user is sending
|
* @param params The parameters the user is sending
|
||||||
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
|
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
|
||||||
*/
|
*/
|
||||||
virtual EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) { throw NotImplementedException(); }
|
virtual EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called after a command has been executed.
|
/** Called after a command has been executed.
|
||||||
* @param source The source of the command
|
* @param source The source of the command
|
||||||
* @param command The command the user executed
|
* @param command The command the user executed
|
||||||
* @param params The parameters the user sent
|
* @param params The parameters the user sent
|
||||||
*/
|
*/
|
||||||
virtual void OnPostCommand(CommandSource &source, Command *command, const std::vector<Anope::string> ¶ms) { throw NotImplementedException(); }
|
virtual void OnPostCommand(CommandSource &source, Command *command, const std::vector<Anope::string> ¶ms) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when the databases are saved
|
/** Called when the databases are saved
|
||||||
*/
|
*/
|
||||||
@@ -391,7 +391,7 @@ public:
|
|||||||
* @param params The params
|
* @param params The params
|
||||||
* @return EVENT_STOP to halt processing and not run the command, EVENT_ALLOW to allow the command to be executed
|
* @return EVENT_STOP to halt processing and not run the command, EVENT_ALLOW to allow the command to be executed
|
||||||
*/
|
*/
|
||||||
virtual EventReturn OnBotFantasy(CommandSource &source, Command *c, ChannelInfo *ci, const std::vector<Anope::string> ¶ms) { throw NotImplementedException(); }
|
virtual EventReturn OnBotFantasy(CommandSource &source, Command *c, ChannelInfo *ci, const std::vector<Anope::string> ¶ms) ATTR_NOT_NULL(3, 4) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called on fantasy command without access
|
/** Called on fantasy command without access
|
||||||
* @param source The source of the command
|
* @param source The source of the command
|
||||||
@@ -400,31 +400,31 @@ public:
|
|||||||
* @param params The params
|
* @param params The params
|
||||||
* @return EVENT_STOP to halt processing and not run the command, EVENT_ALLOW to allow the command to be executed
|
* @return EVENT_STOP to halt processing and not run the command, EVENT_ALLOW to allow the command to be executed
|
||||||
*/
|
*/
|
||||||
virtual EventReturn OnBotNoFantasyAccess(CommandSource &source, Command *c, ChannelInfo *ci, const std::vector<Anope::string> ¶ms) { throw NotImplementedException(); }
|
virtual EventReturn OnBotNoFantasyAccess(CommandSource &source, Command *c, ChannelInfo *ci, const std::vector<Anope::string> ¶ms) ATTR_NOT_NULL(3, 4) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a bot places a ban
|
/** Called when a bot places a ban
|
||||||
* @param u User being banned
|
* @param u User being banned
|
||||||
* @param ci Channel the ban is placed on
|
* @param ci Channel the ban is placed on
|
||||||
* @param mask The mask being banned
|
* @param mask The mask being banned
|
||||||
*/
|
*/
|
||||||
virtual void OnBotBan(User *u, ChannelInfo *ci, const Anope::string &mask) { throw NotImplementedException(); }
|
virtual void OnBotBan(User *u, ChannelInfo *ci, const Anope::string &mask) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called before a badword is added to the badword list
|
/** Called before a badword is added to the badword list
|
||||||
* @param ci The channel
|
* @param ci The channel
|
||||||
* @param bw The badword
|
* @param bw The badword
|
||||||
*/
|
*/
|
||||||
virtual void OnBadWordAdd(ChannelInfo *ci, const BadWord *bw) { throw NotImplementedException(); }
|
virtual void OnBadWordAdd(ChannelInfo *ci, const BadWord *bw) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called before a badword is deleted from a channel
|
/** Called before a badword is deleted from a channel
|
||||||
* @param ci The channel
|
* @param ci The channel
|
||||||
* @param bw The badword
|
* @param bw The badword
|
||||||
*/
|
*/
|
||||||
virtual void OnBadWordDel(ChannelInfo *ci, const BadWord *bw) { throw NotImplementedException(); }
|
virtual void OnBadWordDel(ChannelInfo *ci, const BadWord *bw) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a bot is created or destroyed
|
/** Called when a bot is created or destroyed
|
||||||
*/
|
*/
|
||||||
virtual void OnCreateBot(BotInfo *bi) { throw NotImplementedException(); }
|
virtual void OnCreateBot(BotInfo *bi) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
virtual void OnDelBot(BotInfo *bi) { throw NotImplementedException(); }
|
virtual void OnDelBot(BotInfo *bi) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called before a bot kicks a user
|
/** Called before a bot kicks a user
|
||||||
* @param bi The bot sending the kick
|
* @param bi The bot sending the kick
|
||||||
@@ -433,13 +433,13 @@ public:
|
|||||||
* @param reason The reason
|
* @param reason The reason
|
||||||
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
|
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
|
||||||
*/
|
*/
|
||||||
virtual EventReturn OnBotKick(BotInfo *bi, Channel *c, User *u, const Anope::string &reason) { throw NotImplementedException(); }
|
virtual EventReturn OnBotKick(BotInfo *bi, Channel *c, User *u, const Anope::string &reason) ATTR_NOT_NULL(2, 3, 4) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called before a user parts a channel
|
/** Called before a user parts a channel
|
||||||
* @param u The user
|
* @param u The user
|
||||||
* @param c The channel
|
* @param c The channel
|
||||||
*/
|
*/
|
||||||
virtual void OnPrePartChannel(User *u, Channel *c) {}
|
virtual void OnPrePartChannel(User *u, Channel *c) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a user parts a channel
|
/** Called when a user parts a channel
|
||||||
* @param u The user
|
* @param u The user
|
||||||
@@ -447,14 +447,14 @@ public:
|
|||||||
* @param channel The channel name
|
* @param channel The channel name
|
||||||
* @param msg The part reason
|
* @param msg The part reason
|
||||||
*/
|
*/
|
||||||
virtual void OnPartChannel(User *u, Channel *c, const Anope::string &channel, const Anope::string &msg) { throw NotImplementedException(); }
|
virtual void OnPartChannel(User *u, Channel *c, const Anope::string &channel, const Anope::string &msg) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a user leaves a channel.
|
/** Called when a user leaves a channel.
|
||||||
* From either parting, being kicked, or quitting/killed!
|
* From either parting, being kicked, or quitting/killed!
|
||||||
* @param u The user
|
* @param u The user
|
||||||
* @param c The channel
|
* @param c The channel
|
||||||
*/
|
*/
|
||||||
virtual void OnLeaveChannel(User *u, Channel *c) { throw NotImplementedException(); }
|
virtual void OnLeaveChannel(User *u, Channel *c) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called after a user joins a channel
|
/** Called after a user joins a channel
|
||||||
* If this event triggers the user is allowed to be in the channel, and will
|
* If this event triggers the user is allowed to be in the channel, and will
|
||||||
@@ -463,7 +463,7 @@ public:
|
|||||||
* @param u The user
|
* @param u The user
|
||||||
* @param channel The channel
|
* @param channel The channel
|
||||||
*/
|
*/
|
||||||
virtual void OnJoinChannel(User *u, Channel *c) { throw NotImplementedException(); }
|
virtual void OnJoinChannel(User *u, Channel *c) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a new topic is set
|
/** Called when a new topic is set
|
||||||
* @param source The user changing the topic, if any
|
* @param source The user changing the topic, if any
|
||||||
@@ -471,18 +471,18 @@ public:
|
|||||||
* @param setter The user who set the new topic, if there is no source
|
* @param setter The user who set the new topic, if there is no source
|
||||||
* @param topic The new topic
|
* @param topic The new topic
|
||||||
*/
|
*/
|
||||||
virtual void OnTopicUpdated(User *source, Channel *c, const Anope::string &user, const Anope::string &topic) { throw NotImplementedException(); }
|
virtual void OnTopicUpdated(User *source, Channel *c, const Anope::string &user, const Anope::string &topic) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called before a channel expires
|
/** Called before a channel expires
|
||||||
* @param ci The channel
|
* @param ci The channel
|
||||||
* @param expire Set to true to allow the chan to expire
|
* @param expire Set to true to allow the chan to expire
|
||||||
*/
|
*/
|
||||||
virtual void OnPreChanExpire(ChannelInfo *ci, bool &expire) { throw NotImplementedException(); }
|
virtual void OnPreChanExpire(ChannelInfo *ci, bool &expire) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called before a channel expires
|
/** Called before a channel expires
|
||||||
* @param ci The channel
|
* @param ci The channel
|
||||||
*/
|
*/
|
||||||
virtual void OnChanExpire(ChannelInfo *ci) { throw NotImplementedException(); }
|
virtual void OnChanExpire(ChannelInfo *ci) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called before Anope connects to its uplink
|
/** Called before Anope connects to its uplink
|
||||||
*/
|
*/
|
||||||
@@ -494,7 +494,7 @@ public:
|
|||||||
|
|
||||||
/** Called when we are almost done synching with the uplink, just before we send the EOB
|
/** Called when we are almost done synching with the uplink, just before we send the EOB
|
||||||
*/
|
*/
|
||||||
virtual void OnPreUplinkSync(Server *serv) { throw NotImplementedException(); }
|
virtual void OnPreUplinkSync(Server *serv) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when Anope disconnects from its uplink, before it tries to reconnect
|
/** Called when Anope disconnects from its uplink, before it tries to reconnect
|
||||||
*/
|
*/
|
||||||
@@ -512,12 +512,12 @@ public:
|
|||||||
* @param na The nick
|
* @param na The nick
|
||||||
* @param expire Set to true to allow the nick to expire
|
* @param expire Set to true to allow the nick to expire
|
||||||
*/
|
*/
|
||||||
virtual void OnPreNickExpire(NickAlias *na, bool &expire) { throw NotImplementedException(); }
|
virtual void OnPreNickExpire(NickAlias *na, bool &expire) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a nick drops
|
/** Called when a nick drops
|
||||||
* @param na The nick
|
* @param na The nick
|
||||||
*/
|
*/
|
||||||
virtual void OnNickExpire(NickAlias *na) { throw NotImplementedException(); }
|
virtual void OnNickExpire(NickAlias *na) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when defcon level changes
|
/** Called when defcon level changes
|
||||||
* @param level The level
|
* @param level The level
|
||||||
@@ -528,13 +528,13 @@ public:
|
|||||||
* @param ex The exception
|
* @param ex The exception
|
||||||
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
|
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
|
||||||
*/
|
*/
|
||||||
virtual EventReturn OnExceptionAdd(Exception *ex) { throw NotImplementedException(); }
|
virtual EventReturn OnExceptionAdd(Exception *ex) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called before an exception is deleted
|
/** Called before an exception is deleted
|
||||||
* @param source The source deleting it
|
* @param source The source deleting it
|
||||||
* @param ex The exception
|
* @param ex The exception
|
||||||
*/
|
*/
|
||||||
virtual void OnExceptionDel(CommandSource &source, Exception *ex) { throw NotImplementedException(); }
|
virtual void OnExceptionDel(CommandSource &source, Exception *ex) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called before a XLine is added
|
/** Called before a XLine is added
|
||||||
* @param source The source of the XLine
|
* @param source The source of the XLine
|
||||||
@@ -542,31 +542,31 @@ public:
|
|||||||
* @param xlm The xline manager it was added to
|
* @param xlm The xline manager it was added to
|
||||||
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
|
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to halt the command and not process it
|
||||||
*/
|
*/
|
||||||
virtual EventReturn OnAddXLine(CommandSource &source, const XLine *x, XLineManager *xlm) { throw NotImplementedException(); }
|
virtual EventReturn OnAddXLine(CommandSource &source, const XLine *x, XLineManager *xlm) ATTR_NOT_NULL(3, 4) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called before a XLine is deleted
|
/** Called before a XLine is deleted
|
||||||
* @param source The source of the XLine
|
* @param source The source of the XLine
|
||||||
* @param x The XLine
|
* @param x The XLine
|
||||||
* @param xlm The xline manager it was deleted from
|
* @param xlm The xline manager it was deleted from
|
||||||
*/
|
*/
|
||||||
virtual void OnDelXLine(CommandSource &source, const XLine *x, XLineManager *xlm) { throw NotImplementedException(); }
|
virtual void OnDelXLine(CommandSource &source, const XLine *x, XLineManager *xlm) ATTR_NOT_NULL(4) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a user is checked for whether they are a services oper
|
/** Called when a user is checked for whether they are a services oper
|
||||||
* @param u The user
|
* @param u The user
|
||||||
* @return EVENT_ALLOW to allow, anything else to deny
|
* @return EVENT_ALLOW to allow, anything else to deny
|
||||||
*/
|
*/
|
||||||
virtual EventReturn IsServicesOper(User *u) { throw NotImplementedException(); }
|
virtual EventReturn IsServicesOper(User *u) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a server quits
|
/** Called when a server quits
|
||||||
* @param server The server
|
* @param server The server
|
||||||
*/
|
*/
|
||||||
virtual void OnServerQuit(Server *server) { throw NotImplementedException(); }
|
virtual void OnServerQuit(Server *server) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a user quits, or is killed
|
/** Called when a user quits, or is killed
|
||||||
* @param u The user
|
* @param u The user
|
||||||
* @param msg The quit message
|
* @param msg The quit message
|
||||||
*/
|
*/
|
||||||
virtual void OnUserQuit(User *u, const Anope::string &msg) { throw NotImplementedException(); }
|
virtual void OnUserQuit(User *u, const Anope::string &msg) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a user is quit, before and after being internally removed from
|
/** Called when a user is quit, before and after being internally removed from
|
||||||
* This is different from OnUserQuit, which takes place at the time of the quit.
|
* This is different from OnUserQuit, which takes place at the time of the quit.
|
||||||
@@ -574,43 +574,43 @@ public:
|
|||||||
* all lists (channels, user list, etc)
|
* all lists (channels, user list, etc)
|
||||||
* @param u The user
|
* @param u The user
|
||||||
*/
|
*/
|
||||||
virtual void OnPreUserLogoff(User *u) { throw NotImplementedException(); }
|
virtual void OnPreUserLogoff(User *u) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
virtual void OnPostUserLogoff(User *u) { throw NotImplementedException(); }
|
virtual void OnPostUserLogoff(User *u) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a new bot is made
|
/** Called when a new bot is made
|
||||||
* @param bi The bot
|
* @param bi The bot
|
||||||
*/
|
*/
|
||||||
virtual void OnBotCreate(BotInfo *bi) { throw NotImplementedException(); }
|
virtual void OnBotCreate(BotInfo *bi) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a bot is changed
|
/** Called when a bot is changed
|
||||||
* @param bi The bot
|
* @param bi The bot
|
||||||
*/
|
*/
|
||||||
virtual void OnBotChange(BotInfo *bi) { throw NotImplementedException(); }
|
virtual void OnBotChange(BotInfo *bi) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a bot is deleted
|
/** Called when a bot is deleted
|
||||||
* @param bi The bot
|
* @param bi The bot
|
||||||
*/
|
*/
|
||||||
virtual void OnBotDelete(BotInfo *bi) { throw NotImplementedException(); }
|
virtual void OnBotDelete(BotInfo *bi) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called after an access entry is deleted from a channel
|
/** Called after an access entry is deleted from a channel
|
||||||
* @param ci The channel
|
* @param ci The channel
|
||||||
* @param source The source of the command
|
* @param source The source of the command
|
||||||
* @param access The access entry that was removed
|
* @param access The access entry that was removed
|
||||||
*/
|
*/
|
||||||
virtual void OnAccessDel(ChannelInfo *ci, CommandSource &source, ChanAccess *access) { throw NotImplementedException(); }
|
virtual void OnAccessDel(ChannelInfo *ci, CommandSource &source, ChanAccess *access) ATTR_NOT_NULL(2, 4) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when access is added
|
/** Called when access is added
|
||||||
* @param ci The channel
|
* @param ci The channel
|
||||||
* @param source The source of the command
|
* @param source The source of the command
|
||||||
* @param access The access changed
|
* @param access The access changed
|
||||||
*/
|
*/
|
||||||
virtual void OnAccessAdd(ChannelInfo *ci, CommandSource &source, ChanAccess *access) { throw NotImplementedException(); }
|
virtual void OnAccessAdd(ChannelInfo *ci, CommandSource &source, ChanAccess *access) ATTR_NOT_NULL(2, 4) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when the access list is cleared
|
/** Called when the access list is cleared
|
||||||
* @param ci The channel
|
* @param ci The channel
|
||||||
* @param u The user who cleared the access
|
* @param u The user who cleared the access
|
||||||
*/
|
*/
|
||||||
virtual void OnAccessClear(ChannelInfo *ci, CommandSource &source) { throw NotImplementedException(); }
|
virtual void OnAccessClear(ChannelInfo *ci, CommandSource &source) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a level for a channel is changed
|
/** Called when a level for a channel is changed
|
||||||
* @param source The source of the command
|
* @param source The source of the command
|
||||||
@@ -618,63 +618,63 @@ public:
|
|||||||
* @param priv The privilege changed
|
* @param priv The privilege changed
|
||||||
* @param what The new level
|
* @param what The new level
|
||||||
*/
|
*/
|
||||||
virtual void OnLevelChange(CommandSource &source, ChannelInfo *ci, const Anope::string &priv, int16_t what) { throw NotImplementedException(); }
|
virtual void OnLevelChange(CommandSource &source, ChannelInfo *ci, const Anope::string &priv, int16_t what) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called right before a channel is dropped
|
/** Called right before a channel is dropped
|
||||||
* @param source The user dropping the channel
|
* @param source The user dropping the channel
|
||||||
* @param ci The channel
|
* @param ci The channel
|
||||||
*/
|
*/
|
||||||
virtual EventReturn OnChanDrop(CommandSource &source, ChannelInfo *ci) { throw NotImplementedException(); }
|
virtual EventReturn OnChanDrop(CommandSource &source, ChannelInfo *ci) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a channel is registered
|
/** Called when a channel is registered
|
||||||
* @param ci The channel
|
* @param ci The channel
|
||||||
*/
|
*/
|
||||||
virtual void OnChanRegistered(ChannelInfo *ci) { throw NotImplementedException(); }
|
virtual void OnChanRegistered(ChannelInfo *ci) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a channel is suspended
|
/** Called when a channel is suspended
|
||||||
* @param ci The channel
|
* @param ci The channel
|
||||||
*/
|
*/
|
||||||
virtual void OnChanSuspend(ChannelInfo *ci) { throw NotImplementedException(); }
|
virtual void OnChanSuspend(ChannelInfo *ci) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a channel is unsuspended
|
/** Called when a channel is unsuspended
|
||||||
* @param ci The channel
|
* @param ci The channel
|
||||||
*/
|
*/
|
||||||
virtual void OnChanUnsuspend(ChannelInfo *ci) { throw NotImplementedException(); }
|
virtual void OnChanUnsuspend(ChannelInfo *ci) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a channel is being created, for any reason
|
/** Called when a channel is being created, for any reason
|
||||||
* @param ci The channel
|
* @param ci The channel
|
||||||
*/
|
*/
|
||||||
virtual void OnCreateChan(ChannelInfo *ci) { throw NotImplementedException(); }
|
virtual void OnCreateChan(ChannelInfo *ci) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a channel is being deleted, for any reason
|
/** Called when a channel is being deleted, for any reason
|
||||||
* @param ci The channel
|
* @param ci The channel
|
||||||
*/
|
*/
|
||||||
virtual void OnDelChan(ChannelInfo *ci) { throw NotImplementedException(); }
|
virtual void OnDelChan(ChannelInfo *ci) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a new channel is created
|
/** Called when a new channel is created
|
||||||
* Note that this channel may not be introduced to the uplink at this point.
|
* Note that this channel may not be introduced to the uplink at this point.
|
||||||
* @param c The channel
|
* @param c The channel
|
||||||
*/
|
*/
|
||||||
virtual void OnChannelCreate(Channel *c) { throw NotImplementedException(); }
|
virtual void OnChannelCreate(Channel *c) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a channel is deleted
|
/** Called when a channel is deleted
|
||||||
* @param c The channel
|
* @param c The channel
|
||||||
*/
|
*/
|
||||||
virtual void OnChannelDelete(Channel *c) { throw NotImplementedException(); }
|
virtual void OnChannelDelete(Channel *c) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called after adding an akick to a channel
|
/** Called after adding an akick to a channel
|
||||||
* @param source The source of the command
|
* @param source The source of the command
|
||||||
* @param ci The channel
|
* @param ci The channel
|
||||||
* @param ak The akick
|
* @param ak The akick
|
||||||
*/
|
*/
|
||||||
virtual void OnAkickAdd(CommandSource &source, ChannelInfo *ci, const AutoKick *ak) { throw NotImplementedException(); }
|
virtual void OnAkickAdd(CommandSource &source, ChannelInfo *ci, const AutoKick *ak) ATTR_NOT_NULL(3, 4) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called before removing an akick from a channel
|
/** Called before removing an akick from a channel
|
||||||
* @param source The source of the command
|
* @param source The source of the command
|
||||||
* @param ci The channel
|
* @param ci The channel
|
||||||
* @param ak The akick
|
* @param ak The akick
|
||||||
*/
|
*/
|
||||||
virtual void OnAkickDel(CommandSource &source, ChannelInfo *ci, const AutoKick *ak) { throw NotImplementedException(); }
|
virtual void OnAkickDel(CommandSource &source, ChannelInfo *ci, const AutoKick *ak) ATTR_NOT_NULL(3, 4) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called after a user join a channel when we decide whether to kick them or not
|
/** Called after a user join a channel when we decide whether to kick them or not
|
||||||
* @param u The user
|
* @param u The user
|
||||||
@@ -684,7 +684,7 @@ public:
|
|||||||
* @param reason The reason for the kick
|
* @param reason The reason for the kick
|
||||||
* @return EVENT_STOP to prevent the user from joining by kicking/banning the user
|
* @return EVENT_STOP to prevent the user from joining by kicking/banning the user
|
||||||
*/
|
*/
|
||||||
virtual EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) { throw NotImplementedException(); }
|
virtual EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a user requests info for a channel
|
/** Called when a user requests info for a channel
|
||||||
* @param source The user requesting info
|
* @param source The user requesting info
|
||||||
@@ -692,109 +692,109 @@ public:
|
|||||||
* @param info Data to show the user requesting information
|
* @param info Data to show the user requesting information
|
||||||
* @param show_hidden true if we should show the user everything
|
* @param show_hidden true if we should show the user everything
|
||||||
*/
|
*/
|
||||||
virtual void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden) { throw NotImplementedException(); }
|
virtual void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Checks if access has the channel privilege 'priv'.
|
/** Checks if access has the channel privilege 'priv'.
|
||||||
* @param access THe access struct
|
* @param access THe access struct
|
||||||
* @param priv The privilege being checked for
|
* @param priv The privilege being checked for
|
||||||
* @return EVENT_ALLOW for yes, EVENT_STOP to stop all processing
|
* @return EVENT_ALLOW for yes, EVENT_STOP to stop all processing
|
||||||
*/
|
*/
|
||||||
virtual EventReturn OnCheckPriv(const ChanAccess *access, const Anope::string &priv) { throw NotImplementedException(); }
|
virtual EventReturn OnCheckPriv(const ChanAccess *access, const Anope::string &priv) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Check whether an access group has a privilege
|
/** Check whether an access group has a privilege
|
||||||
* @param group The group
|
* @param group The group
|
||||||
* @param priv The privilege
|
* @param priv The privilege
|
||||||
* @return MOD_ALLOW to allow, MOD_STOP to stop
|
* @return MOD_ALLOW to allow, MOD_STOP to stop
|
||||||
*/
|
*/
|
||||||
virtual EventReturn OnGroupCheckPriv(const AccessGroup *group, const Anope::string &priv) { throw NotImplementedException(); }
|
virtual EventReturn OnGroupCheckPriv(const AccessGroup *group, const Anope::string &priv) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a nick is dropped
|
/** Called when a nick is dropped
|
||||||
* @param source The source of the command
|
* @param source The source of the command
|
||||||
* @param na The nick
|
* @param na The nick
|
||||||
*/
|
*/
|
||||||
virtual void OnNickDrop(CommandSource &source, NickAlias *na) { throw NotImplementedException(); }
|
virtual void OnNickDrop(CommandSource &source, NickAlias *na) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a user groups their nick
|
/** Called when a user groups their nick
|
||||||
* @param u The user grouping
|
* @param u The user grouping
|
||||||
* @param target The target they're grouping to
|
* @param target The target they're grouping to
|
||||||
*/
|
*/
|
||||||
virtual void OnNickGroup(User *u, NickAlias *target) { throw NotImplementedException(); }
|
virtual void OnNickGroup(User *u, NickAlias *target) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a user identifies to a nick
|
/** Called when a user identifies to a nick
|
||||||
* @param u The user
|
* @param u The user
|
||||||
*/
|
*/
|
||||||
virtual void OnNickIdentify(User *u) { throw NotImplementedException(); }
|
virtual void OnNickIdentify(User *u) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a user is logged into an account
|
/** Called when a user is logged into an account
|
||||||
* @param u The user
|
* @param u The user
|
||||||
*/
|
*/
|
||||||
virtual void OnUserLogin(User *u) { throw NotImplementedException(); }
|
virtual void OnUserLogin(User *u) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a nick logs out
|
/** Called when a nick logs out
|
||||||
* @param u The nick
|
* @param u The nick
|
||||||
*/
|
*/
|
||||||
virtual void OnNickLogout(User *u) { throw NotImplementedException(); }
|
virtual void OnNickLogout(User *u) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a nick is registered
|
/** Called when a nick is registered
|
||||||
* @param user The user registering the nick, of any
|
* @param user The user registering the nick, of any
|
||||||
* @param The nick
|
* @param The nick
|
||||||
* @param pass The password of the newly registered nick
|
* @param pass The password of the newly registered nick
|
||||||
*/
|
*/
|
||||||
virtual void OnNickRegister(User *user, NickAlias *na, const Anope::string &pass) { throw NotImplementedException(); }
|
virtual void OnNickRegister(User *user, NickAlias *na, const Anope::string &pass) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a nick is confirmed. This will never be called if registration confirmation is not enabled.
|
/** Called when a nick is confirmed. This will never be called if registration confirmation is not enabled.
|
||||||
* @param user The user confirming the nick
|
* @param user The user confirming the nick
|
||||||
* @param The account being confirmed
|
* @param nc The account being confirmed
|
||||||
*/
|
*/
|
||||||
virtual void OnNickConfirm(User *user, NickCore *) { throw NotImplementedException(); }
|
virtual void OnNickConfirm(User *user, NickCore *nc) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a nick is suspended
|
/** Called when a nick is suspended
|
||||||
* @param na The nick alias
|
* @param na The nick alias
|
||||||
*/
|
*/
|
||||||
virtual void OnNickSuspend(NickAlias *na) { throw NotImplementedException(); }
|
virtual void OnNickSuspend(NickAlias *na) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a nick is unsuspended
|
/** Called when a nick is unsuspended
|
||||||
* @param na The nick alias
|
* @param na The nick alias
|
||||||
*/
|
*/
|
||||||
virtual void OnNickUnsuspended(NickAlias *na) { throw NotImplementedException(); }
|
virtual void OnNickUnsuspended(NickAlias *na) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called on delnick()
|
/** Called on delnick()
|
||||||
* @ param na pointer to the nickalias
|
* @ param na pointer to the nickalias
|
||||||
*/
|
*/
|
||||||
virtual void OnDelNick(NickAlias *na) { throw NotImplementedException(); }
|
virtual void OnDelNick(NickAlias *na) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a nickcore is created
|
/** Called when a nickcore is created
|
||||||
* @param nc The nickcore
|
* @param nc The nickcore
|
||||||
*/
|
*/
|
||||||
virtual void OnNickCoreCreate(NickCore *nc) { throw NotImplementedException(); }
|
virtual void OnNickCoreCreate(NickCore *nc) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called on delcore()
|
/** Called on delcore()
|
||||||
* @param nc pointer to the NickCore
|
* @param nc pointer to the NickCore
|
||||||
*/
|
*/
|
||||||
virtual void OnDelCore(NickCore *nc) { throw NotImplementedException(); }
|
virtual void OnDelCore(NickCore *nc) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called on change_core_display()
|
/** Called on change_core_display()
|
||||||
* @param nc pointer to the NickCore
|
* @param nc pointer to the NickCore
|
||||||
* @param newdisplay the new display
|
* @param newdisplay the new display
|
||||||
*/
|
*/
|
||||||
virtual void OnChangeCoreDisplay(NickCore *nc, const Anope::string &newdisplay) { throw NotImplementedException(); }
|
virtual void OnChangeCoreDisplay(NickCore *nc, const Anope::string &newdisplay) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** called from NickCore::ClearCert()
|
/** called from NickCore::ClearCert()
|
||||||
* @param nc pointer to the NickCore
|
* @param nc pointer to the NickCore
|
||||||
*/
|
*/
|
||||||
virtual void OnNickClearCert(NickCore *nc) { throw NotImplementedException(); }
|
virtual void OnNickClearCert(NickCore *nc) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a user adds an entry to their cert list
|
/** Called when a user adds an entry to their cert list
|
||||||
* @param nc The nick
|
* @param nc The nick
|
||||||
* @param entry The entry
|
* @param entry The entry
|
||||||
*/
|
*/
|
||||||
virtual void OnNickAddCert(NickCore *nc, const Anope::string &entry) { throw NotImplementedException(); }
|
virtual void OnNickAddCert(NickCore *nc, const Anope::string &entry) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called from NickCore::EraseCert()
|
/** Called from NickCore::EraseCert()
|
||||||
* @param nc pointer to the NickCore
|
* @param nc pointer to the NickCore
|
||||||
* @param entry The fingerprint
|
* @param entry The fingerprint
|
||||||
*/
|
*/
|
||||||
virtual void OnNickEraseCert(NickCore *nc, const Anope::string &entry) { throw NotImplementedException(); }
|
virtual void OnNickEraseCert(NickCore *nc, const Anope::string &entry) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a user requests info for a nick
|
/** Called when a user requests info for a nick
|
||||||
* @param source The user requesting info
|
* @param source The user requesting info
|
||||||
@@ -802,55 +802,55 @@ public:
|
|||||||
* @param info Data to show the user requesting information
|
* @param info Data to show the user requesting information
|
||||||
* @param show_hidden true if we should show the user everything
|
* @param show_hidden true if we should show the user everything
|
||||||
*/
|
*/
|
||||||
virtual void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) { throw NotImplementedException(); }
|
virtual void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a user uses botserv/info on a bot or channel.
|
/** Called when a user uses botserv/info on a bot or channel.
|
||||||
*/
|
*/
|
||||||
virtual void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) { throw NotImplementedException(); }
|
virtual void OnBotInfo(CommandSource &source, BotInfo *bi, ChannelInfo *ci, InfoFormatter &info) ATTR_NOT_NULL(4) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Check whether a username and password is correct
|
/** Check whether a username and password is correct
|
||||||
* @param u The user trying to identify, if applicable.
|
* @param u The user trying to identify, if applicable.
|
||||||
* @param req The login request
|
* @param req The login request
|
||||||
*/
|
*/
|
||||||
virtual void OnCheckAuthentication(User *u, IdentifyRequest *req) { throw NotImplementedException(); }
|
virtual void OnCheckAuthentication(User *u, IdentifyRequest *req) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a user does /ns update
|
/** Called when a user does /ns update
|
||||||
* @param u The user
|
* @param u The user
|
||||||
*/
|
*/
|
||||||
virtual void OnNickUpdate(User *u) { throw NotImplementedException(); }
|
virtual void OnNickUpdate(User *u) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when we get informed about a users SSL fingerprint
|
/** Called when we get informed about a users SSL fingerprint
|
||||||
* when we call this, the fingerprint should already be stored in the user struct
|
* when we call this, the fingerprint should already be stored in the user struct
|
||||||
* @param u pointer to the user
|
* @param u pointer to the user
|
||||||
*/
|
*/
|
||||||
virtual void OnFingerprint(User *u) { throw NotImplementedException(); }
|
virtual void OnFingerprint(User *u) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a user becomes (un)away
|
/** Called when a user becomes (un)away
|
||||||
* @param message The message, is .empty() if unaway
|
* @param message The message, is .empty() if unaway
|
||||||
*/
|
*/
|
||||||
virtual void OnUserAway(User *u, const Anope::string &message) { throw NotImplementedException(); }
|
virtual void OnUserAway(User *u, const Anope::string &message) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a user invites one of our users to a channel
|
/** Called when a user invites one of our users to a channel
|
||||||
* @param source The user doing the inviting
|
* @param source The user doing the inviting
|
||||||
* @param c The channel the user is inviting to
|
* @param c The channel the user is inviting to
|
||||||
* @param targ The user being invited
|
* @param targ The user being invited
|
||||||
*/
|
*/
|
||||||
virtual void OnInvite(User *source, Channel *c, User *targ) { throw NotImplementedException(); }
|
virtual void OnInvite(User *source, Channel *c, User *targ) ATTR_NOT_NULL(2, 3, 4) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** 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) ATTR_NOT_NULL(2) { 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) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a users host changes
|
/** Called when a users host changes
|
||||||
* @param u The user
|
* @param u The user
|
||||||
*/
|
*/
|
||||||
virtual void OnSetDisplayedHost(User *) { throw NotImplementedException(); }
|
virtual void OnSetDisplayedHost(User *u) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a memo is sent
|
/** Called when a memo is sent
|
||||||
* @param source The source of the memo
|
* @param source The source of the memo
|
||||||
@@ -858,14 +858,14 @@ public:
|
|||||||
* @param mi Memo info for target
|
* @param mi Memo info for target
|
||||||
* @param m The memo
|
* @param m The memo
|
||||||
*/
|
*/
|
||||||
virtual void OnMemoSend(const Anope::string &source, const Anope::string &target, MemoInfo *mi, Memo *m) { throw NotImplementedException(); }
|
virtual void OnMemoSend(const Anope::string &source, const Anope::string &target, MemoInfo *mi, Memo *m) ATTR_NOT_NULL(4, 5) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a memo is deleted
|
/** Called when a memo is deleted
|
||||||
* @param target The target the memo is being deleted from (nick or channel)
|
* @param target The target the memo is being deleted from (nick or channel)
|
||||||
* @param mi The memo info
|
* @param mi The memo info
|
||||||
* @param m The memo
|
* @param m The memo
|
||||||
*/
|
*/
|
||||||
virtual void OnMemoDel(const Anope::string &target, MemoInfo *mi, const Memo *m) { throw NotImplementedException(); }
|
virtual void OnMemoDel(const Anope::string &target, MemoInfo *mi, const Memo *m) ATTR_NOT_NULL(3, 4) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a mode is set on a channel
|
/** Called when a mode is set on a channel
|
||||||
* @param c The channel
|
* @param c The channel
|
||||||
@@ -874,7 +874,7 @@ public:
|
|||||||
* @param param The mode param, if there is one
|
* @param param The mode param, if there is one
|
||||||
* @return EVENT_STOP to make mlock/secureops etc checks not happen
|
* @return EVENT_STOP to make mlock/secureops etc checks not happen
|
||||||
*/
|
*/
|
||||||
virtual EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) { throw NotImplementedException(); }
|
virtual EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) ATTR_NOT_NULL(2, 4) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a mode is unset on a channel
|
/** Called when a mode is unset on a channel
|
||||||
* @param c The channel
|
* @param c The channel
|
||||||
@@ -883,67 +883,67 @@ public:
|
|||||||
* @param param The mode param, if there is one
|
* @param param The mode param, if there is one
|
||||||
* @return EVENT_STOP to make mlock/secureops etc checks not happen
|
* @return EVENT_STOP to make mlock/secureops etc checks not happen
|
||||||
*/
|
*/
|
||||||
virtual EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) { throw NotImplementedException(); }
|
virtual EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) ATTR_NOT_NULL(2, 4) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a mode is set on a user
|
/** Called when a mode is set on a user
|
||||||
* @param setter who/what is setting the mode
|
* @param setter who/what is setting the mode
|
||||||
* @param u The user
|
* @param u The user
|
||||||
* @param mname The mode name
|
* @param mname The mode name
|
||||||
*/
|
*/
|
||||||
virtual void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) { throw NotImplementedException(); }
|
virtual void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a mode is unset from a user
|
/** Called when a mode is unset from a user
|
||||||
* @param setter who/what is setting the mode
|
* @param setter who/what is setting the mode
|
||||||
* @param u The user
|
* @param u The user
|
||||||
* @param mname The mode name
|
* @param mname The mode name
|
||||||
*/
|
*/
|
||||||
virtual void OnUserModeUnset(const MessageSource &setter, User *u, const Anope::string &mname) { throw NotImplementedException(); }
|
virtual void OnUserModeUnset(const MessageSource &setter, User *u, const Anope::string &mname) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a channel mode is introduced into Anope
|
/** Called when a channel mode is introduced into Anope
|
||||||
* @param cm The mode
|
* @param cm The mode
|
||||||
*/
|
*/
|
||||||
virtual void OnChannelModeAdd(ChannelMode *cm) { throw NotImplementedException(); }
|
virtual void OnChannelModeAdd(ChannelMode *cm) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a user mode is introduced into Anope
|
/** Called when a user mode is introduced into Anope
|
||||||
* @param um The mode
|
* @param um The mode
|
||||||
*/
|
*/
|
||||||
virtual void OnUserModeAdd(UserMode *um) { throw NotImplementedException(); }
|
virtual void OnUserModeAdd(UserMode *um) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a mode is about to be mlocked
|
/** Called when a mode is about to be mlocked
|
||||||
* @param ci The channel the mode is being locked on
|
* @param ci The channel the mode is being locked on
|
||||||
* @param lock The mode lock
|
* @param lock The mode lock
|
||||||
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the mlock.
|
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the mlock.
|
||||||
*/
|
*/
|
||||||
virtual EventReturn OnMLock(ChannelInfo *ci, ModeLock *lock) { throw NotImplementedException(); }
|
virtual EventReturn OnMLock(ChannelInfo *ci, ModeLock *lock) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a mode is about to be unlocked
|
/** Called when a mode is about to be unlocked
|
||||||
* @param ci The channel the mode is being unlocked from
|
* @param ci The channel the mode is being unlocked from
|
||||||
* @param lock The mode lock
|
* @param lock The mode lock
|
||||||
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the mlock.
|
* @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the mlock.
|
||||||
*/
|
*/
|
||||||
virtual EventReturn OnUnMLock(ChannelInfo *ci, ModeLock *lock) { throw NotImplementedException(); }
|
virtual EventReturn OnUnMLock(ChannelInfo *ci, ModeLock *lock) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called after a module is loaded
|
/** Called after a module is loaded
|
||||||
* @param u The user loading the module, can be NULL
|
* @param u The user loading the module, can be NULL
|
||||||
* @param m The module
|
* @param m The module
|
||||||
*/
|
*/
|
||||||
virtual void OnModuleLoad(User *u, Module *m) { throw NotImplementedException(); }
|
virtual void OnModuleLoad(User *u, Module *m) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called before a module is unloaded
|
/** Called before a module is unloaded
|
||||||
* @param u The user, can be NULL
|
* @param u The user, can be NULL
|
||||||
* @param m The module
|
* @param m The module
|
||||||
*/
|
*/
|
||||||
virtual void OnModuleUnload(User *u, Module *m) { throw NotImplementedException(); }
|
virtual void OnModuleUnload(User *u, Module *m) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a server is synced
|
/** Called when a server is synced
|
||||||
* @param s The server, can be our uplink server
|
* @param s The server, can be our uplink server
|
||||||
*/
|
*/
|
||||||
virtual void OnServerSync(Server *s) { throw NotImplementedException(); }
|
virtual void OnServerSync(Server *s) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when we sync with our uplink
|
/** Called when we sync with our uplink
|
||||||
* @param s Our uplink
|
* @param s Our uplink
|
||||||
*/
|
*/
|
||||||
virtual void OnUplinkSync(Server *s) { throw NotImplementedException(); }
|
virtual void OnUplinkSync(Server *s) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when we receive a PRIVMSG for one of our clients
|
/** Called when we receive a PRIVMSG for one of our clients
|
||||||
* @param u The user sending the PRIVMSG
|
* @param u The user sending the PRIVMSG
|
||||||
@@ -952,7 +952,7 @@ public:
|
|||||||
* @param tags Message tags
|
* @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, const Anope::map<Anope::string> &tags) { throw NotImplementedException(); }
|
virtual EventReturn OnBotPrivmsg(User *u, BotInfo *bi, Anope::string &message, const Anope::map<Anope::string> &tags) ATTR_NOT_NULL(2, 3) { 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
|
||||||
@@ -960,7 +960,7 @@ public:
|
|||||||
* @param tags Message tags
|
* @param tags Message tags
|
||||||
* @param message The message
|
* @param message The message
|
||||||
*/
|
*/
|
||||||
virtual void OnBotNotice(User *u, BotInfo *bi, Anope::string &message, const Anope::map<Anope::string> &tags) { throw NotImplementedException(); }
|
virtual void OnBotNotice(User *u, BotInfo *bi, Anope::string &message, const Anope::map<Anope::string> &tags) ATTR_NOT_NULL(2, 3) { 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
|
||||||
@@ -968,12 +968,12 @@ public:
|
|||||||
* @param msg The message
|
* @param msg The message
|
||||||
* @param tags Message tags
|
* @param tags Message tags
|
||||||
*/
|
*/
|
||||||
virtual void OnPrivmsg(User *u, Channel *c, Anope::string &msg, const Anope::map<Anope::string> &tags) { throw NotImplementedException(); }
|
virtual void OnPrivmsg(User *u, Channel *c, Anope::string &msg, const Anope::map<Anope::string> &tags) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a message is logged
|
/** Called when a message is logged
|
||||||
* @param l The log message
|
* @param l The log message
|
||||||
*/
|
*/
|
||||||
virtual void OnLog(Log *l) { throw NotImplementedException(); }
|
virtual void OnLog(Log *l) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a log message is actually logged to a given log info
|
/** Called when a log message is actually logged to a given log info
|
||||||
* The message has already passed validation checks by the LogInfo
|
* The message has already passed validation checks by the LogInfo
|
||||||
@@ -981,13 +981,13 @@ public:
|
|||||||
* @param l The log message
|
* @param l The log message
|
||||||
* @param msg The final formatted message, derived from 'l'
|
* @param msg The final formatted message, derived from 'l'
|
||||||
*/
|
*/
|
||||||
virtual void OnLogMessage(LogInfo *li, const Log *l, const Anope::string &msg) { throw NotImplementedException(); }
|
virtual void OnLogMessage(LogInfo *li, const Log *l, const Anope::string &msg) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a DNS request (question) is received.
|
/** Called when a DNS request (question) is received.
|
||||||
* @param req The dns request
|
* @param req The dns request
|
||||||
* @param reply The reply that will be sent
|
* @param reply The reply that will be sent
|
||||||
*/
|
*/
|
||||||
virtual void OnDnsRequest(DNS::Query &req, DNS::Query *reply) { throw NotImplementedException(); }
|
virtual void OnDnsRequest(DNS::Query &req, DNS::Query *reply) ATTR_NOT_NULL(3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a channels modes are being checked to see if they are allowed,
|
/** Called when a channels modes are being checked to see if they are allowed,
|
||||||
* mostly to ensure mlock/+r are set.
|
* mostly to ensure mlock/+r are set.
|
||||||
@@ -1000,7 +1000,7 @@ public:
|
|||||||
* for a newly created channel to set the correct modes, topic,
|
* for a newly created channel to set the correct modes, topic,
|
||||||
* set.
|
* set.
|
||||||
*/
|
*/
|
||||||
virtual void OnChannelSync(Channel *c) { throw NotImplementedException(); }
|
virtual void OnChannelSync(Channel *c) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called to set the correct modes on the user on the given channel
|
/** Called to set the correct modes on the user on the given channel
|
||||||
* @param user The user
|
* @param user The user
|
||||||
@@ -1009,13 +1009,13 @@ public:
|
|||||||
* @param give_modes If giving modes is desired
|
* @param give_modes If giving modes is desired
|
||||||
* @param take_modes If taking modes is desired
|
* @param take_modes If taking modes is desired
|
||||||
*/
|
*/
|
||||||
virtual void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes) { throw NotImplementedException(); }
|
virtual void OnSetCorrectModes(User *user, Channel *chan, AccessGroup &access, bool &give_modes, bool &take_modes) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
virtual void OnSerializeCheck(Serialize::Type *) { throw NotImplementedException(); }
|
virtual void OnSerializeCheck(Serialize::Type *st) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
virtual void OnSerializableConstruct(Serializable *) { throw NotImplementedException(); }
|
virtual void OnSerializableConstruct(Serializable *st) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
virtual void OnSerializableDestruct(Serializable *) { throw NotImplementedException(); }
|
virtual void OnSerializableDestruct(Serializable *st) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
virtual void OnSerializableUpdate(Serializable *) { throw NotImplementedException(); }
|
virtual void OnSerializableUpdate(Serializable *st) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
virtual void OnSerializeTypeCreate(Serialize::Type *) { throw NotImplementedException(); }
|
virtual void OnSerializeTypeCreate(Serialize::Type *st) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a chanserv/set command is used
|
/** Called when a chanserv/set command is used
|
||||||
* @param source The source of the command
|
* @param source The source of the command
|
||||||
@@ -1024,7 +1024,7 @@ public:
|
|||||||
* @param setting The setting passed to the command. Probably ON/OFF.
|
* @param setting The setting passed to the command. Probably ON/OFF.
|
||||||
* @return EVENT_ALLOW to bypass access checks, EVENT_STOP to halt immediately.
|
* @return EVENT_ALLOW to bypass access checks, EVENT_STOP to halt immediately.
|
||||||
*/
|
*/
|
||||||
virtual EventReturn OnSetChannelOption(CommandSource &source, Command *cmd, ChannelInfo *ci, const Anope::string &setting) { throw NotImplementedException(); }
|
virtual EventReturn OnSetChannelOption(CommandSource &source, Command *cmd, ChannelInfo *ci, const Anope::string &setting) ATTR_NOT_NULL(3, 4) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called when a nickserv/set command is used.
|
/** Called when a nickserv/set command is used.
|
||||||
* @param source The source of the command
|
* @param source The source of the command
|
||||||
@@ -1033,7 +1033,7 @@ public:
|
|||||||
* @param setting The setting passed to the command. Probably ON/OFF.
|
* @param setting The setting passed to the command. Probably ON/OFF.
|
||||||
* @return EVENT_STOP to halt immediately
|
* @return EVENT_STOP to halt immediately
|
||||||
*/
|
*/
|
||||||
virtual EventReturn OnSetNickOption(CommandSource &source, Command *cmd, NickCore *nc, const Anope::string &setting) { throw NotImplementedException(); }
|
virtual EventReturn OnSetNickOption(CommandSource &source, Command *cmd, NickCore *nc, const Anope::string &setting) ATTR_NOT_NULL(3, 4) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called whenever a message is received from the uplink
|
/** Called whenever a message is received from the uplink
|
||||||
* @param source The source of the message
|
* @param source The source of the message
|
||||||
@@ -1048,9 +1048,9 @@ public:
|
|||||||
* @param u The user
|
* @param u The user
|
||||||
* @param cm The mode
|
* @param cm The mode
|
||||||
*/
|
*/
|
||||||
virtual EventReturn OnCanSet(User *u, const ChannelMode *cm) { throw NotImplementedException(); }
|
virtual EventReturn OnCanSet(User *u, const ChannelMode *cm) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||||
|
|
||||||
virtual EventReturn OnCheckDelete(Channel *) { throw NotImplementedException(); }
|
virtual EventReturn OnCheckDelete(Channel *c) ATTR_NOT_NULL(2) { throw NotImplementedException(); }
|
||||||
|
|
||||||
/** Called every options:expiretimeout seconds. Should be used to expire nicks,
|
/** Called every options:expiretimeout seconds. Should be used to expire nicks,
|
||||||
* channels, etc.
|
* channels, etc.
|
||||||
@@ -1063,7 +1063,7 @@ public:
|
|||||||
* @param na The nick they are on
|
* @param na The nick they are on
|
||||||
* @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) ATTR_NOT_NULL(2, 3) { throw NotImplementedException(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Implementation
|
enum Implementation
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* (C) 2011-2024 Anope Team
|
||||||
|
* Contact us at team@anope.org
|
||||||
|
*
|
||||||
|
* Please read COPYING and README for further details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
struct MyOper final
|
||||||
|
: Oper
|
||||||
|
, Serializable
|
||||||
|
{
|
||||||
|
MyOper(const Anope::string &n, OperType *o) : Oper(n, o), Serializable("Oper") { }
|
||||||
|
|
||||||
|
void Serialize(Serialize::Data &data) const override
|
||||||
|
{
|
||||||
|
data.Store("name", this->name);
|
||||||
|
data.Store("type", this->ot->GetName());
|
||||||
|
}
|
||||||
|
|
||||||
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
{
|
||||||
|
Anope::string stype, sname;
|
||||||
|
|
||||||
|
data["type"] >> stype;
|
||||||
|
data["name"] >> sname;
|
||||||
|
|
||||||
|
OperType *ot = OperType::Find(stype);
|
||||||
|
if (ot == NULL)
|
||||||
|
return NULL;
|
||||||
|
NickCore *nc = NickCore::Find(sname);
|
||||||
|
if (nc == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
MyOper *myo;
|
||||||
|
if (obj)
|
||||||
|
myo = anope_dynamic_static_cast<MyOper *>(obj);
|
||||||
|
else
|
||||||
|
myo = new MyOper(nc->display, ot);
|
||||||
|
nc->o = myo;
|
||||||
|
Log(LOG_NORMAL, "operserv/oper") << "Tied oper " << nc->display << " to type " << ot->GetName();
|
||||||
|
return myo;
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -62,12 +62,12 @@ static ServiceReference<SessionService> session_service("SessionService", "sessi
|
|||||||
|
|
||||||
void Exception::Serialize(Serialize::Data &data) const
|
void Exception::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["mask"] << this->mask;
|
data.Store("mask", this->mask);
|
||||||
data["limit"] << this->limit;
|
data.Store("limit", this->limit);
|
||||||
data["who"] << this->who;
|
data.Store("who", this->who);
|
||||||
data["reason"] << this->reason;
|
data.Store("reason", this->reason);
|
||||||
data["time"] << this->time;
|
data.Store("time", this->time);
|
||||||
data["expires"] << this->expires;
|
data.Store("expires", this->expires);
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable *Exception::Unserialize(Serializable *obj, Serialize::Data &data)
|
Serializable *Exception::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
+6
-14
@@ -19,7 +19,7 @@ namespace SQL
|
|||||||
public:
|
public:
|
||||||
typedef std::map<Anope::string, std::stringstream *> Map;
|
typedef std::map<Anope::string, std::stringstream *> Map;
|
||||||
Map data;
|
Map data;
|
||||||
std::map<Anope::string, Type> types;
|
std::map<Anope::string, Serialize::DataType> types;
|
||||||
|
|
||||||
~Data()
|
~Data()
|
||||||
{
|
{
|
||||||
@@ -34,14 +34,6 @@ namespace SQL
|
|||||||
return *ss;
|
return *ss;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::set<Anope::string> KeySet() const override
|
|
||||||
{
|
|
||||||
std::set<Anope::string> keys;
|
|
||||||
for (const auto &[key, _] : this->data)
|
|
||||||
keys.insert(key);
|
|
||||||
return keys;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t Hash() const override
|
size_t Hash() const override
|
||||||
{
|
{
|
||||||
size_t hash = 0;
|
size_t hash = 0;
|
||||||
@@ -68,17 +60,17 @@ namespace SQL
|
|||||||
this->data.clear();
|
this->data.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetType(const Anope::string &key, Type t) override
|
void SetType(const Anope::string &key, Serialize::DataType dt) override
|
||||||
{
|
{
|
||||||
this->types[key] = t;
|
this->types[key] = dt;
|
||||||
}
|
}
|
||||||
|
|
||||||
Type GetType(const Anope::string &key) const override
|
Serialize::DataType GetType(const Anope::string &key) const override
|
||||||
{
|
{
|
||||||
std::map<Anope::string, Type>::const_iterator it = this->types.find(key);
|
auto it = this->types.find(key);
|
||||||
if (it != this->types.end())
|
if (it != this->types.end())
|
||||||
return it->second;
|
return it->second;
|
||||||
return DT_TEXT;
|
return Serialize::DataType::TEXT;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+8
-10
@@ -41,9 +41,9 @@ public:
|
|||||||
|
|
||||||
virtual ~IRCDProto();
|
virtual ~IRCDProto();
|
||||||
|
|
||||||
virtual void SendNoticeInternal(const MessageSource &, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags = {});
|
virtual void SendNotice(const MessageSource &source, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags = {});
|
||||||
virtual void SendPrivmsgInternal(const MessageSource &, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags = {});
|
virtual void SendPrivmsg(const MessageSource &source, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags = {});
|
||||||
virtual void SendCTCPInternal(const MessageSource &, const Anope::string &dest, const Anope::string &buf);
|
virtual void SendTagmsg(const MessageSource &source, const Anope::string &dest, const Anope::map<Anope::string> &tags);
|
||||||
|
|
||||||
/** Parses an incoming message from the IRC server.
|
/** Parses an incoming message from the IRC server.
|
||||||
* @param message The message to parse.
|
* @param message The message to parse.
|
||||||
@@ -110,6 +110,9 @@ public:
|
|||||||
/** Can we ask the server to unban a user? */
|
/** Can we ask the server to unban a user? */
|
||||||
bool CanClearBans = false;
|
bool CanClearBans = false;
|
||||||
|
|
||||||
|
/** Can we send tag messages? */
|
||||||
|
bool CanTagMessage = false;
|
||||||
|
|
||||||
/* The maximum length of a channel name. */
|
/* The maximum length of a channel name. */
|
||||||
size_t MaxChannel = 0;
|
size_t MaxChannel = 0;
|
||||||
|
|
||||||
@@ -213,11 +216,6 @@ public:
|
|||||||
|
|
||||||
virtual void SendKick(const MessageSource &source, const Channel *chan, User *user, const Anope::string &msg);
|
virtual void SendKick(const MessageSource &source, const Channel *chan, User *user, const Anope::string &msg);
|
||||||
|
|
||||||
virtual void SendNotice(const MessageSource &source, const Anope::string &dest, const char *fmt, ...) ATTR_FORMAT(4, 5);
|
|
||||||
virtual void SendPrivmsg(const MessageSource &source, const Anope::string &dest, const char *fmt, ...) ATTR_FORMAT(4, 5);
|
|
||||||
virtual void SendAction(const MessageSource &source, const Anope::string &dest, const char *fmt, ...) ATTR_FORMAT(4, 5);
|
|
||||||
virtual void SendCTCP(const MessageSource &source, const Anope::string &dest, const char *fmt, ...) ATTR_FORMAT(4, 5);
|
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
@@ -242,9 +240,9 @@ public:
|
|||||||
* @param bi The source of the message
|
* @param bi The source of the message
|
||||||
* @param u The user to join
|
* @param u The user to join
|
||||||
* @param chan The channel to join the user to
|
* @param chan The channel to join the user to
|
||||||
* @param param Channel key?
|
* @param key Channel key
|
||||||
*/
|
*/
|
||||||
virtual void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) { }
|
virtual void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &key) { }
|
||||||
|
|
||||||
/** Force parts a user that isn't ours from a channel.
|
/** Force parts a user that isn't ours from a channel.
|
||||||
* @param source The source of the message
|
* @param source The source of the message
|
||||||
|
|||||||
+30
-9
@@ -18,23 +18,44 @@
|
|||||||
|
|
||||||
namespace Serialize
|
namespace Serialize
|
||||||
{
|
{
|
||||||
|
enum class DataType
|
||||||
|
: uint8_t
|
||||||
|
{
|
||||||
|
BOOL,
|
||||||
|
FLOAT,
|
||||||
|
INT,
|
||||||
|
TEXT,
|
||||||
|
UINT,
|
||||||
|
};
|
||||||
|
|
||||||
class Data
|
class Data
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Type
|
|
||||||
{
|
|
||||||
DT_TEXT,
|
|
||||||
DT_INT
|
|
||||||
};
|
|
||||||
|
|
||||||
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"); }
|
|
||||||
|
template <typename T>
|
||||||
|
void Store(const Anope::string &key, const T &value)
|
||||||
|
{
|
||||||
|
using Type = std::remove_cv_t<std::remove_reference_t<T>>;
|
||||||
|
|
||||||
|
if constexpr (std::is_same_v<Type, bool>)
|
||||||
|
SetType(key, DataType::BOOL);
|
||||||
|
else if constexpr (std::is_floating_point_v<Type>)
|
||||||
|
SetType(key, DataType::FLOAT);
|
||||||
|
else if constexpr (std::is_integral_v<Type> && std::is_signed_v<Type>)
|
||||||
|
SetType(key, DataType::INT);
|
||||||
|
else if constexpr (std::is_integral_v<Type> && std::is_unsigned_v<Type>)
|
||||||
|
SetType(key, DataType::UINT);
|
||||||
|
|
||||||
|
this->operator[](key) << value;
|
||||||
|
}
|
||||||
|
|
||||||
virtual size_t Hash() const { throw CoreException("Not supported"); }
|
virtual size_t Hash() const { throw CoreException("Not supported"); }
|
||||||
|
|
||||||
virtual void SetType(const Anope::string &key, Type t) { }
|
virtual void SetType(const Anope::string &key, DataType dt) { }
|
||||||
virtual Type GetType(const Anope::string &key) const { return DT_TEXT; }
|
virtual DataType GetType(const Anope::string &key) const { return DataType::TEXT; }
|
||||||
};
|
};
|
||||||
|
|
||||||
extern void RegisterTypes();
|
extern void RegisterTypes();
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
|
|||||||
@@ -51,6 +51,8 @@
|
|||||||
|
|
||||||
#if defined __GNUC__
|
#if defined __GNUC__
|
||||||
# define ATTR_FORMAT(STRINGPOS, FIRSTPOS) __attribute__((format(printf, STRINGPOS, FIRSTPOS)))
|
# define ATTR_FORMAT(STRINGPOS, FIRSTPOS) __attribute__((format(printf, STRINGPOS, FIRSTPOS)))
|
||||||
|
# define ATTR_NOT_NULL(...) __attribute__((nonnull(__VA_ARGS__)))
|
||||||
#else
|
#else
|
||||||
# define ATTR_FORMAT(STRINGPOS, FIRSTPOS)
|
# define ATTR_FORMAT(STRINGPOS, FIRSTPOS)
|
||||||
|
# define ATTR_NOT_NULL(...)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -215,6 +215,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
NickCore *Account() const;
|
NickCore *Account() const;
|
||||||
|
|
||||||
|
/** Get the account nick the user is logged in using
|
||||||
|
* @return The account nick or NULL
|
||||||
|
*/
|
||||||
|
NickAlias *AccountNick() const;
|
||||||
|
|
||||||
/** Check if the user is identified for their nick
|
/** Check if the user is identified for their nick
|
||||||
* @param check_nick True to check if the user is identified to the nickname they are on too
|
* @param check_nick True to check if the user is identified to the nickname they are on too
|
||||||
* @return true or false
|
* @return true or false
|
||||||
|
|||||||
-10057
File diff suppressed because it is too large
Load Diff
+21
-14
@@ -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-05-11 17:38+0100\n"
|
"POT-Creation-Date: 2024-08-18 03:16+0100\n"
|
||||||
"PO-Revision-Date: 2024-05-11 17:39+0100\n"
|
"PO-Revision-Date: 2024-08-18 03:17+0100\n"
|
||||||
"Last-Translator: Sadie Powell <sadie@witchery.services>\n"
|
"Last-Translator: Sadie Powell <sadie@witchery.services>\n"
|
||||||
"Language-Team: English\n"
|
"Language-Team: English\n"
|
||||||
"Language: en_US\n"
|
"Language: en_US\n"
|
||||||
@@ -866,9 +866,9 @@ msgid ""
|
|||||||
"fantasy commands on a channel when prefixed\n"
|
"fantasy commands on a channel when prefixed\n"
|
||||||
"with one of the following fantasy characters: %s\n"
|
"with one of the following fantasy characters: %s\n"
|
||||||
" \n"
|
" \n"
|
||||||
"Note that users wanting to use fantaisist\n"
|
"Note that users wanting to use fantasy commands\n"
|
||||||
"commands MUST have enough access for both\n"
|
"MUST have enough access for both the FANTASY\n"
|
||||||
"the FANTASIA and the command they are executing."
|
"privilege and the command they are executing."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
" \n"
|
" \n"
|
||||||
"Enables or disables fantasy mode on a channel.\n"
|
"Enables or disables fantasy mode on a channel.\n"
|
||||||
@@ -876,9 +876,9 @@ msgstr ""
|
|||||||
"fantasy commands on a channel when prefixed\n"
|
"fantasy commands on a channel when prefixed\n"
|
||||||
"with one of the following fantasy characters: %s\n"
|
"with one of the following fantasy characters: %s\n"
|
||||||
" \n"
|
" \n"
|
||||||
"Note that users wanting to use fantaisist\n"
|
"Note that users wanting to use fantasy commands\n"
|
||||||
"commands MUST have enough access for both\n"
|
"MUST have enough access for both the FANTASY\n"
|
||||||
"the FANTASIA and the command they are executing."
|
"privilege and the command they are executing."
|
||||||
|
|
||||||
msgid ""
|
msgid ""
|
||||||
" \n"
|
" \n"
|
||||||
@@ -1812,6 +1812,9 @@ msgstr "Account"
|
|||||||
msgid "Account %s has already reached the maximum number of simultaneous logins (%u)."
|
msgid "Account %s has already reached the maximum number of simultaneous logins (%u)."
|
||||||
msgstr "Account %s has already reached the maximum number of simultaneous logins (%u)."
|
msgstr "Account %s has already reached the maximum number of simultaneous logins (%u)."
|
||||||
|
|
||||||
|
msgid "Account id"
|
||||||
|
msgstr "Account id"
|
||||||
|
|
||||||
msgid "Account registered"
|
msgid "Account registered"
|
||||||
msgstr "Account registered"
|
msgstr "Account registered"
|
||||||
|
|
||||||
@@ -3669,8 +3672,8 @@ msgstr "Email for %s is invalid."
|
|||||||
msgid "Email matched: %s (%s) to %s."
|
msgid "Email matched: %s (%s) to %s."
|
||||||
msgstr "Email matched: %s (%s) to %s."
|
msgstr "Email matched: %s (%s) to %s."
|
||||||
|
|
||||||
msgid "Enable fantaisist commands"
|
msgid "Enable fantasy commands"
|
||||||
msgstr "Enable fantaisist commands"
|
msgstr "Enable fantasy commands"
|
||||||
|
|
||||||
msgid "Enable greet messages"
|
msgid "Enable greet messages"
|
||||||
msgstr "Enable greet messages"
|
msgstr "Enable greet messages"
|
||||||
@@ -4194,12 +4197,12 @@ msgid "Info about a loaded module"
|
|||||||
msgstr "Info about a loaded module"
|
msgstr "Info about a loaded module"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Information for bot %s:"
|
msgid "Information about bot %s:"
|
||||||
msgstr "Information for bot %s:"
|
msgstr "Information about bot %s:"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Information for channel %s:"
|
msgid "Information about channel %s:"
|
||||||
msgstr "Information for channel %s:"
|
msgstr "Information about channel %s:"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Invalid duration %s, using %d days."
|
msgid "Invalid duration %s, using %d days."
|
||||||
@@ -8092,6 +8095,10 @@ msgstr "Used to manage the list of privileged users"
|
|||||||
msgid "Used to modify the channel status of you or other users"
|
msgid "Used to modify the channel status of you or other users"
|
||||||
msgstr "Used to modify the channel status of you or other users"
|
msgstr "Used to modify the channel status of you or other users"
|
||||||
|
|
||||||
|
#, c-format
|
||||||
|
msgid "User %s isn't currently logged in to an account."
|
||||||
|
msgstr "User %s isn't currently logged in to an account."
|
||||||
|
|
||||||
msgid "User has been banned from the channel"
|
msgid "User has been banned from the channel"
|
||||||
msgstr "User has been banned from the channel"
|
msgstr "User has been banned from the channel"
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
-10224
File diff suppressed because it is too large
Load Diff
+41
-14
@@ -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-04-15 15:31+0100\n"
|
"POT-Creation-Date: 2024-06-23 18:32+0100\n"
|
||||||
"PO-Revision-Date: 2024-05-11 18:28+0100\n"
|
"PO-Revision-Date: 2024-06-23 16:07+0300\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.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."
|
||||||
@@ -1811,6 +1811,9 @@ msgstr "Hesap"
|
|||||||
msgid "Account %s has already reached the maximum number of simultaneous logins (%u)."
|
msgid "Account %s has already reached the maximum number of simultaneous logins (%u)."
|
||||||
msgstr "%s hesabı zaten maksimum eşzamanlı oturum açma sayısına (%u) ulaştı."
|
msgstr "%s hesabı zaten maksimum eşzamanlı oturum açma sayısına (%u) ulaştı."
|
||||||
|
|
||||||
|
msgid "Account registered"
|
||||||
|
msgstr "Hesap kaydedildi"
|
||||||
|
|
||||||
msgid "Accounts can not be registered right now. Please try again later."
|
msgid "Accounts can not be registered right now. Please try again later."
|
||||||
msgstr "Hesaplar şu anda kaydedilemiyor. Lütfen daha sonra tekrar deneyiniz."
|
msgstr "Hesaplar şu anda kaydedilemiyor. Lütfen daha sonra tekrar deneyiniz."
|
||||||
|
|
||||||
@@ -2282,6 +2285,13 @@ msgid ""
|
|||||||
"message number can be obtained from the output of the QUEUE LIST command.\n"
|
"message number can be obtained from the output of the QUEUE LIST command.\n"
|
||||||
"The QUEUE LIST command lists all messages that are currently in the message queue."
|
"The QUEUE LIST command lists all messages that are currently in the message queue."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Ağdaki kullanıcılara gönderilecek mesajların sıraya alınmasına izin verir.\n"
|
||||||
|
"\n"
|
||||||
|
"QUEUE ADD komutu verilen mesajı mesaj kuyruğuna ekler.\n"
|
||||||
|
"QUEUE CLEAR komutu mesaj kuyruğunu temizler.\n"
|
||||||
|
"QUEUE DEL komutu belirtilen mesajı mesaj kuyruğundan kaldırır.\n"
|
||||||
|
"mesaj numarası QUEUE LIST komutunun çıktısından alınabilir.\n"
|
||||||
|
"QUEUE LIST komutu, o anda mesaj kuyruğunda bulunan tüm mesajları listeler."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid ""
|
msgid ""
|
||||||
@@ -2291,6 +2301,11 @@ msgid ""
|
|||||||
"You can either send a message by specifying it as a parameter or provide no\n"
|
"You can either send a message by specifying it as a parameter or provide no\n"
|
||||||
"parameters to send a previously queued message.\n"
|
"parameters to send a previously queued message.\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Bir sunucudaki tüm kullanıcılara mesaj gönderilmesine izin verir. Mesaj\n"
|
||||||
|
"%s kullanıcısından gönderilecek.\n"
|
||||||
|
"\n"
|
||||||
|
"Bir mesajı parametre olarak belirterek gönderebilir veya önceden kuyruğa alınmış\n"
|
||||||
|
"bir mesajı göndermek için hiçbir parametre belirtmeyebilirsiniz.\n"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid ""
|
msgid ""
|
||||||
@@ -2300,6 +2315,11 @@ msgid ""
|
|||||||
"You can either send a message by specifying it as a parameter or provide no\n"
|
"You can either send a message by specifying it as a parameter or provide no\n"
|
||||||
"parameters to send a previously queued message.\n"
|
"parameters to send a previously queued message.\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Ağdaki tüm kullanıcılara mesaj gönderilmesine izin verir. Mesaj\n"
|
||||||
|
"%s kullanıcısından gidecek.\n"
|
||||||
|
"\n"
|
||||||
|
"Bir mesajı parametre olarak belirterek gönderebilir veya daha önce kuyruğa\n"
|
||||||
|
"alınmış bir mesajı göndermek için hiçbir parametre belirtmeyebilirsiniz.\n"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid ""
|
msgid ""
|
||||||
@@ -3066,7 +3086,7 @@ msgid ""
|
|||||||
"or changing nick on the network and tells you when and, depending\n"
|
"or changing nick on the network and tells you when and, depending\n"
|
||||||
"on channel or user settings, where it was."
|
"on channel or user settings, where it was."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Rumuz'un ağa katıldığı, ayrıldığı veya rumuz değiştirdiği\n"
|
"Bu ayar, rumuz'un ağa katıldığı, ayrıldığı veya rumuz değiştirdiği\n"
|
||||||
"son zamanı kontrol eder ve bunun ne zaman ve kanal veya kullanıcı\n"
|
"son zamanı kontrol eder ve bunun ne zaman ve kanal veya kullanıcı\n"
|
||||||
"ayarlarına bağlı olarak nerede olduğunu size bildirir."
|
"ayarlarına bağlı olarak nerede olduğunu size bildirir."
|
||||||
|
|
||||||
@@ -3077,7 +3097,7 @@ msgid ""
|
|||||||
"Checks whether the _last_ memo you sent to nick has been read\n"
|
"Checks whether the _last_ memo you sent to nick has been read\n"
|
||||||
"or not. Note that this only works with nicks, not with channels."
|
"or not. Note that this only works with nicks, not with channels."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Rumuz'a gönderdiğiniz _son_ memonun okunup okunmadığını kontrol eder\n"
|
"Bu ayar, rumuz'a gönderdiğiniz _son_ memonun okunup okunmadığını kontrol eder\n"
|
||||||
"Bunun kanallarla değil, yalnızca rumuzlarla işe yaradığını unutmayın."
|
"Bunun kanallarla değil, yalnızca rumuzlarla işe yaradığını unutmayın."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
@@ -4328,7 +4348,7 @@ msgid "Level must be between %d and %d inclusive."
|
|||||||
msgstr "Seviye %d ile %d dahil arasında olmalıdır."
|
msgstr "Seviye %d ile %d dahil arasında olmalıdır."
|
||||||
|
|
||||||
msgid "Limit"
|
msgid "Limit"
|
||||||
msgstr ""
|
msgstr "Limit"
|
||||||
|
|
||||||
msgid "List all registered nicknames that match a given pattern"
|
msgid "List all registered nicknames that match a given pattern"
|
||||||
msgstr "Belirtilen şablonla eşleşen tüm rumuzları listeler"
|
msgstr "Belirtilen şablonla eşleşen tüm rumuzları listeler"
|
||||||
@@ -4839,7 +4859,7 @@ msgid "Manage your auto join list"
|
|||||||
msgstr "Oto-gir listenizi yönetin"
|
msgstr "Oto-gir listenizi yönetin"
|
||||||
|
|
||||||
msgid "Manages your pending message queue."
|
msgid "Manages your pending message queue."
|
||||||
msgstr ""
|
msgstr "Bekleyen mesaj sıranızı yönetir."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Manipulate the %s list"
|
msgid "Manipulate the %s list"
|
||||||
@@ -4924,7 +4944,7 @@ msgstr "%c modu için eksik parametre."
|
|||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Missing passwords: %zu"
|
msgid "Missing passwords: %zu"
|
||||||
msgstr ""
|
msgstr "Eksik şifreler: %zu"
|
||||||
|
|
||||||
msgid "Mode"
|
msgid "Mode"
|
||||||
msgstr "Mod"
|
msgstr "Mod"
|
||||||
@@ -5123,6 +5143,9 @@ msgstr "%s rumuzu şuan serbest bırakıldı."
|
|||||||
msgid "Nick %s is now suspended."
|
msgid "Nick %s is now suspended."
|
||||||
msgstr "%s rumuzu askıya alınmış."
|
msgstr "%s rumuzu askıya alınmış."
|
||||||
|
|
||||||
|
msgid "Nick registered"
|
||||||
|
msgstr "Rumuz kaydedildi"
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Nick too long, max length is %zu characters."
|
msgid "Nick too long, max length is %zu characters."
|
||||||
msgstr "Rumuz çok uzun, maks uzunluk %zu karakterdir."
|
msgstr "Rumuz çok uzun, maks uzunluk %zu karakterdir."
|
||||||
@@ -5362,7 +5385,7 @@ msgstr "Şifreler şu anda değiştirilemez. Lütfen daha sonra tekrar deneyiniz
|
|||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Passwords encrypted with %s: %zu"
|
msgid "Passwords encrypted with %s: %zu"
|
||||||
msgstr ""
|
msgstr "%s ile şifrelenen şifreler: %zu"
|
||||||
|
|
||||||
msgid "Peace"
|
msgid "Peace"
|
||||||
msgstr "Barış"
|
msgstr "Barış"
|
||||||
@@ -5380,7 +5403,7 @@ msgstr "Kalıcı"
|
|||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Please confirm that you want to drop %s with %s%s DROP %s %s"
|
msgid "Please confirm that you want to drop %s with %s%s DROP %s %s"
|
||||||
msgstr ""
|
msgstr "Lütfen %s rumuzunu droplamak isteğinizi %s%s DROP %s %s ile onaylayın"
|
||||||
|
|
||||||
msgid "Please contact an Operator to get a vhost assigned to this nick."
|
msgid "Please contact an Operator to get a vhost assigned to this nick."
|
||||||
msgstr "Bu rumuza atanan bir vHost almak için lütfen bir operle iletişime geçin."
|
msgstr "Bu rumuza atanan bir vHost almak için lütfen bir operle iletişime geçin."
|
||||||
@@ -7196,7 +7219,7 @@ msgid ""
|
|||||||
"for your nick immediately. You may also wish to SET HIDE it\n"
|
"for your nick immediately. You may also wish to SET HIDE it\n"
|
||||||
"after registering if it isn't the default setting already."
|
"after registering if it isn't the default setting already."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"email parametresi isteğe bağlıdır ve rumuzunuzun e-postasını\n"
|
"Bu email parametresi isteğe bağlıdır ve rumuzunuzun e-postasını\n"
|
||||||
"hemen ayarlayacaktır. Zaten varsayılan ayar değilse, kayıttan sonra\n"
|
"hemen ayarlayacaktır. Zaten varsayılan ayar değilse, kayıttan sonra\n"
|
||||||
"bunu SET HIDE yapmak da isteyebilirsiniz."
|
"bunu SET HIDE yapmak da isteyebilirsiniz."
|
||||||
|
|
||||||
@@ -7922,7 +7945,7 @@ msgstr ""
|
|||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Type %s%s SET EMAIL email in order to set your email."
|
msgid "Type %s%s SET EMAIL email in order to set your email."
|
||||||
msgstr ""
|
msgstr "E-Postanızı ayarlamak için %s%s SET EMAIL e-posta yazın."
|
||||||
|
|
||||||
msgid "Un-Load a module"
|
msgid "Un-Load a module"
|
||||||
msgstr "Bir modülün yüklemesini kaldır"
|
msgstr "Bir modülün yüklemesini kaldır"
|
||||||
@@ -8067,6 +8090,10 @@ msgstr "Ayrıcalıklı kullanıcıların listesini yönetmek için kullanılır"
|
|||||||
msgid "Used to modify the channel status of you or other users"
|
msgid "Used to modify the channel status of you or other users"
|
||||||
msgstr "Sizin veya diğer kullanıcıların kanal durumunu değiştirmek için kullanılır"
|
msgstr "Sizin veya diğer kullanıcıların kanal durumunu değiştirmek için kullanılır"
|
||||||
|
|
||||||
|
#, c-format
|
||||||
|
msgid "User %s isn't currently logged in to an account."
|
||||||
|
msgstr "%s kullanıcısı şuan hesabına giriş yapmış değil."
|
||||||
|
|
||||||
msgid "User has been banned from the channel"
|
msgid "User has been banned from the channel"
|
||||||
msgstr "Kullanıcı kanaldan banlandı"
|
msgstr "Kullanıcı kanaldan banlandı"
|
||||||
|
|
||||||
@@ -8307,7 +8334,7 @@ msgid "You can not request a receipt when sending a memo to yourself."
|
|||||||
msgstr "Kendinize memo gönderirken makbuz talep edemezsiniz."
|
msgstr "Kendinize memo gönderirken makbuz talep edemezsiniz."
|
||||||
|
|
||||||
msgid "You can not send a single message while you have messages queued."
|
msgid "You can not send a single message while you have messages queued."
|
||||||
msgstr ""
|
msgstr "Sıraya alınmış mesajlarınız varken tek bir mesaj gönderemezsiniz."
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "You can't %s yourself!"
|
msgid "You can't %s yourself!"
|
||||||
@@ -8375,7 +8402,7 @@ msgid "You do not have access to set mode %c."
|
|||||||
msgstr "%c modunu ayarlama erişiminiz yok."
|
msgstr "%c modunu ayarlama erişiminiz yok."
|
||||||
|
|
||||||
msgid "You do not have any messages queued and did not specify a message to send."
|
msgid "You do not have any messages queued and did not specify a message to send."
|
||||||
msgstr ""
|
msgstr "Sıraya alınmış herhangi bir mesajınız yok ve gönderilecek mesajı belirtmediniz."
|
||||||
|
|
||||||
msgid "You do not have any queued messages."
|
msgid "You do not have any queued messages."
|
||||||
msgstr "Sıraya alınmış mesajınız yok."
|
msgstr "Sıraya alınmış mesajınız yok."
|
||||||
|
|||||||
@@ -57,12 +57,20 @@ public:
|
|||||||
BotInfo *bi = user->server == Me ? dynamic_cast<BotInfo *>(user) : NULL;
|
BotInfo *bi = user->server == Me ? dynamic_cast<BotInfo *>(user) : NULL;
|
||||||
if (bi && Config->GetModule(this)->Get<bool>("smartjoin"))
|
if (bi && Config->GetModule(this)->Get<bool>("smartjoin"))
|
||||||
{
|
{
|
||||||
/* We check for bans */
|
if (IRCD->CanClearBans)
|
||||||
for (const auto &entry : c->GetModeList("BAN"))
|
|
||||||
{
|
{
|
||||||
Entry ban("BAN", entry);
|
// We can ask the IRCd to clear bans.
|
||||||
if (ban.Matches(user))
|
IRCD->SendClearBans(bi, c, bi);
|
||||||
c->RemoveMode(NULL, "BAN", ban.GetMask());
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// We have to check for bans.
|
||||||
|
for (const auto &entry : c->GetModeList("BAN"))
|
||||||
|
{
|
||||||
|
Entry ban("BAN", entry);
|
||||||
|
if (ban.Matches(user))
|
||||||
|
c->RemoveMode(NULL, "BAN", ban.GetMask());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Anope::string Limit;
|
Anope::string Limit;
|
||||||
@@ -75,7 +83,8 @@ public:
|
|||||||
{
|
{
|
||||||
ChannelMode *cm = ModeManager::FindChannelModeByName("OP");
|
ChannelMode *cm = ModeManager::FindChannelModeByName("OP");
|
||||||
char symbol = cm ? anope_dynamic_static_cast<ChannelModeStatus *>(cm)->symbol : 0;
|
char symbol = cm ? anope_dynamic_static_cast<ChannelModeStatus *>(cm)->symbol : 0;
|
||||||
IRCD->SendNotice(bi, (symbol ? Anope::string(symbol) : "") + c->name, "%s invited %s into the channel.", user->nick.c_str(), user->nick.c_str());
|
const auto message = Anope::printf("%s invited %s into the channel.", user->nick.c_str(), user->nick.c_str());
|
||||||
|
IRCD->SendNotice(bi, (symbol ? Anope::string(symbol) : "") + c->name, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
ModeManager::ProcessModes();
|
ModeManager::ProcessModes();
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ struct BadWordImpl final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["ci"] << this->chan;
|
data.Store("ci", this->chan);
|
||||||
data["word"] << this->word;
|
data.Store("word", this->word);
|
||||||
data.SetType("type", Serialize::Data::DT_INT); data["type"] << this->type;
|
data.Store("type", this->type);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
IRCD->SendPrivmsg(*ci->bi, ci->name, "%s", text.c_str());
|
IRCD->SendPrivmsg(*ci->bi, ci->name, text);
|
||||||
ci->bi->lastmsg = Anope::CurTime;
|
ci->bi->lastmsg = Anope::CurTime;
|
||||||
|
|
||||||
bool override = !source.AccessFor(ci).HasPriv("SAY");
|
bool override = !source.AccessFor(ci).HasPriv("SAY");
|
||||||
@@ -111,11 +111,7 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
message = message.replace_all_cs("\1", "");
|
IRCD->SendPrivmsg(*ci->bi, ci->name, Anope::FormatCTCP("ACTION", message));
|
||||||
if (message.empty())
|
|
||||||
return;
|
|
||||||
|
|
||||||
IRCD->SendAction(*ci->bi, ci->name, "%s", message.c_str());
|
|
||||||
ci->bi->lastmsg = Anope::CurTime;
|
ci->bi->lastmsg = Anope::CurTime;
|
||||||
|
|
||||||
bool override = !source.AccessFor(ci).HasPriv("SAY");
|
bool override = !source.AccessFor(ci).HasPriv("SAY");
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public:
|
|||||||
|
|
||||||
if (bi)
|
if (bi)
|
||||||
{
|
{
|
||||||
source.Reply(_("Information for bot \002%s\002:"), bi->nick.c_str());
|
source.Reply(_("Information about bot \002%s\002:"), bi->nick.c_str());
|
||||||
info[_("Mask")] = bi->GetIdent() + "@" + bi->host;
|
info[_("Mask")] = bi->GetIdent() + "@" + bi->host;
|
||||||
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());
|
||||||
|
|||||||
+24
-23
@@ -53,25 +53,28 @@ struct KickerDataImpl final
|
|||||||
if (kd == NULL)
|
if (kd == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
data.SetType("kickerdata:amsgs", Serialize::Data::DT_INT); data["kickerdata:amsgs"] << kd->amsgs;
|
data.Store("kickerdata:amsgs", kd->amsgs);
|
||||||
data.SetType("kickerdata:badwords", Serialize::Data::DT_INT); data["kickerdata:badwords"] << kd->badwords;
|
data.Store("kickerdata:badwords", kd->badwords);
|
||||||
data.SetType("kickerdata:bolds", Serialize::Data::DT_INT); data["kickerdata:bolds"] << kd->bolds;
|
data.Store("kickerdata:bolds", kd->bolds);
|
||||||
data.SetType("kickerdata:caps", Serialize::Data::DT_INT); data["kickerdata:caps"] << kd->caps;
|
data.Store("kickerdata:caps", kd->caps);
|
||||||
data.SetType("kickerdata:colors", Serialize::Data::DT_INT); data["kickerdata:colors"] << kd->colors;
|
data.Store("kickerdata:colors", kd->colors);
|
||||||
data.SetType("kickerdata:flood", Serialize::Data::DT_INT); data["kickerdata:flood"] << kd->flood;
|
data.Store("kickerdata:flood", kd->flood);
|
||||||
data.SetType("kickerdata:italics", Serialize::Data::DT_INT); data["kickerdata:italics"] << kd->italics;
|
data.Store("kickerdata:italics", kd->italics);
|
||||||
data.SetType("kickerdata:repeat", Serialize::Data::DT_INT); data["kickerdata:repeat"] << kd->repeat;
|
data.Store("kickerdata:repeat", kd->repeat);
|
||||||
data.SetType("kickerdata:reverses", Serialize::Data::DT_INT); data["kickerdata:reverses"] << kd->reverses;
|
data.Store("kickerdata:reverses", kd->reverses);
|
||||||
data.SetType("kickerdata:underlines", Serialize::Data::DT_INT); data["kickerdata:underlines"] << kd->underlines;
|
data.Store("kickerdata:underlines", kd->underlines);
|
||||||
data.SetType("capsmin", Serialize::Data::DT_INT); data["capsmin"] << kd->capsmin;
|
data.Store("capsmin", kd->capsmin);
|
||||||
data.SetType("capspercent", Serialize::Data::DT_INT); data["capspercent"] << kd->capspercent;
|
data.Store("capspercent", kd->capspercent);
|
||||||
data.SetType("floodlines", Serialize::Data::DT_INT); data["floodlines"] << kd->floodlines;
|
data.Store("floodlines", kd->floodlines);
|
||||||
data.SetType("floodsecs", Serialize::Data::DT_INT); data["floodsecs"] << kd->floodsecs;
|
data.Store("floodsecs", kd->floodsecs);
|
||||||
data.SetType("repeattimes", Serialize::Data::DT_INT); data["repeattimes"] << kd->repeattimes;
|
data.Store("repeattimes", kd->repeattimes);
|
||||||
data.SetType("dontkickops", Serialize::Data::DT_INT); data["dontkickops"] << kd->dontkickops;
|
data.Store("dontkickops", kd->dontkickops);
|
||||||
data.SetType("dontkickvoices", Serialize::Data::DT_INT); data["dontkickvoices"] << kd->dontkickvoices;
|
data.Store("dontkickvoices", kd->dontkickvoices);
|
||||||
|
|
||||||
|
std::ostringstream oss;
|
||||||
for (auto ttbtype : kd->ttb)
|
for (auto ttbtype : kd->ttb)
|
||||||
data["ttb"] << ttbtype << " ";
|
oss << ttbtype << " ";
|
||||||
|
data.Store("ttb", oss.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
||||||
@@ -1215,11 +1218,9 @@ public:
|
|||||||
/* If it's a /me, cut the CTCP part because the ACTION will cause
|
/* If it's a /me, cut the CTCP part because the ACTION will cause
|
||||||
* problems with the caps or badwords kicker
|
* problems with the caps or badwords kicker
|
||||||
*/
|
*/
|
||||||
if (realbuf.substr(0, 8).equals_ci("\1ACTION ") && realbuf[realbuf.length() - 1] == '\1')
|
Anope::string ctcpname, ctcpbody;
|
||||||
{
|
if (Anope::ParseCTCP(msg, ctcpname, ctcpbody) && ctcpname.equals_ci("ACTION"))
|
||||||
realbuf.erase(0, 8);
|
realbuf = ctcpbody;
|
||||||
realbuf.erase(realbuf.length() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (realbuf.empty())
|
if (realbuf.empty())
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ struct EntryMsgImpl final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["ci"] << this->chan;
|
data.Store("ci", this->chan);
|
||||||
data["creator"] << this->creator;
|
data.Store("creator", this->creator);
|
||||||
data["message"] << this->message;
|
data.Store("message", this->message);
|
||||||
data.SetType("when", Serialize::Data::DT_INT); data["when"] << this->when;
|
data.Store("when", this->when);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data);
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data);
|
||||||
|
|||||||
+10
-10
@@ -37,14 +37,14 @@ struct LogSettingImpl final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["ci"] << chan;
|
data.Store("ci", chan);
|
||||||
data["service_name"] << service_name;
|
data.Store("service_name", service_name);
|
||||||
data["command_service"] << command_service;
|
data.Store("command_service", command_service);
|
||||||
data["command_name"] << command_name;
|
data.Store("command_name", command_name);
|
||||||
data["method"] << method;
|
data.Store("method", method);
|
||||||
data["extra"] << extra;
|
data.Store("extra", extra);
|
||||||
data["creator"] << creator;
|
data.Store("creator", creator);
|
||||||
data.SetType("created", Serialize::Data::DT_INT); data["created"] << created;
|
data.Store("created", created);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
@@ -391,11 +391,11 @@ public:
|
|||||||
/* Sending a channel message or notice in response to a fantasy command */;
|
/* Sending a channel message or notice in response to a fantasy command */;
|
||||||
else if (log->method.equals_ci("MESSAGE") && l->ci->c)
|
else if (log->method.equals_ci("MESSAGE") && l->ci->c)
|
||||||
{
|
{
|
||||||
IRCD->SendPrivmsg(l->ci->WhoSends(), log->extra + l->ci->c->name, "%s", buffer.c_str());
|
IRCD->SendPrivmsg(l->ci->WhoSends(), log->extra + l->ci->c->name, buffer);
|
||||||
l->ci->WhoSends()->lastmsg = Anope::CurTime;
|
l->ci->WhoSends()->lastmsg = Anope::CurTime;
|
||||||
}
|
}
|
||||||
else if (log->method.equals_ci("NOTICE") && l->ci->c)
|
else if (log->method.equals_ci("NOTICE") && l->ci->c)
|
||||||
IRCD->SendNotice(l->ci->WhoSends(), log->extra + l->ci->c->name, "%s", buffer.c_str());
|
IRCD->SendNotice(l->ci->WhoSends(), log->extra + l->ci->c->name, buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -205,12 +205,12 @@ struct ModeLocksImpl final
|
|||||||
|
|
||||||
void ModeLockImpl::Serialize(Serialize::Data &data) const
|
void ModeLockImpl::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["ci"] << this->ci;
|
data.Store("ci", this->ci);
|
||||||
data["set"] << this->set;
|
data.Store("set", this->set);
|
||||||
data["name"] << this->name;
|
data.Store("name", this->name);
|
||||||
data["param"] << this->param;
|
data.Store("param", this->param);
|
||||||
data["setter"] << this->setter;
|
data.Store("setter", this->setter);
|
||||||
data.SetType("created", Serialize::Data::DT_INT); data["created"] << this->created;
|
data.Store("created", this->created);
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable *ModeLockImpl::Unserialize(Serializable *obj, Serialize::Data &data)
|
Serializable *ModeLockImpl::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -46,13 +46,13 @@ struct SeenInfo final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["nick"] << nick;
|
data.Store("nick", nick);
|
||||||
data["vhost"] << vhost;
|
data.Store("vhost", vhost);
|
||||||
data["type"] << type;
|
data.Store("type", type);
|
||||||
data["nick2"] << nick2;
|
data.Store("nick2", nick2);
|
||||||
data["channel"] << channel;
|
data.Store("channel", channel);
|
||||||
data["message"] << message;
|
data.Store("message", message);
|
||||||
data.SetType("last", Serialize::Data::DT_INT); data["last"] << last;
|
data.Store("last", last);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -1068,7 +1068,7 @@ class CSSet final
|
|||||||
if (!last_value.empty())
|
if (!last_value.empty())
|
||||||
modes += "," + last_value;
|
modes += "," + last_value;
|
||||||
}
|
}
|
||||||
data["last_modes"] << modes;
|
data.Store("last_modes", modes);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ struct CSMiscData final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &sdata) const override
|
void Serialize(Serialize::Data &sdata) const override
|
||||||
{
|
{
|
||||||
sdata["ci"] << this->object;
|
sdata.Store("ci", this->object);
|
||||||
sdata["name"] << this->name;
|
sdata.Store("name", this->name);
|
||||||
sdata["data"] << this->data;
|
sdata.Store("data", this->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ struct CSSuspendInfo final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["chan"] << what;
|
data.Store("chan", what);
|
||||||
data["by"] << by;
|
data.Store("by", by);
|
||||||
data["reason"] << reason;
|
data.Store("reason", reason);
|
||||||
data["time"] << when;
|
data.Store("time", when);
|
||||||
data["expires"] << expires;
|
data.Store("expires", expires);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
@@ -67,7 +67,7 @@ public:
|
|||||||
const Anope::string &chan = params[0];
|
const Anope::string &chan = params[0];
|
||||||
Anope::string expiry = params[1];
|
Anope::string expiry = params[1];
|
||||||
Anope::string reason = params.size() > 2 ? params[2] : "";
|
Anope::string reason = params.size() > 2 ? params[2] : "";
|
||||||
time_t expiry_secs = Config->GetModule(this->owner)->Get<time_t>("expire");
|
time_t expiry_secs = Config->GetModule(this->owner)->Get<time_t>("suspendexpire");
|
||||||
|
|
||||||
if (!expiry.empty() && expiry[0] != '+')
|
if (!expiry.empty() && expiry[0] != '+')
|
||||||
{
|
{
|
||||||
|
|||||||
+260
-82
@@ -20,6 +20,8 @@
|
|||||||
#include "modules/info.h"
|
#include "modules/info.h"
|
||||||
#include "modules/ns_cert.h"
|
#include "modules/ns_cert.h"
|
||||||
#include "modules/os_forbid.h"
|
#include "modules/os_forbid.h"
|
||||||
|
#include "modules/os_oper.h"
|
||||||
|
#include "modules/os_session.h"
|
||||||
#include "modules/suspend.h"
|
#include "modules/suspend.h"
|
||||||
|
|
||||||
// Handles reading from an Atheme database row.
|
// Handles reading from an Atheme database row.
|
||||||
@@ -83,20 +85,39 @@ public:
|
|||||||
|
|
||||||
struct ModeData final
|
struct ModeData final
|
||||||
{
|
{
|
||||||
|
char letter;
|
||||||
Anope::string name;
|
Anope::string name;
|
||||||
Anope::string value;
|
Anope::string value;
|
||||||
bool set;
|
bool set;
|
||||||
|
|
||||||
ModeData(const Anope::string &n, bool s, const Anope::string &v = "")
|
ModeData(const Anope::string &n, bool s, const Anope::string &v = "")
|
||||||
: name(n)
|
: letter(0)
|
||||||
|
, name(n)
|
||||||
, value(v)
|
, value(v)
|
||||||
, set(s)
|
, set(s)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ModeData(char l, const Anope::string &v = "")
|
||||||
|
: letter(l)
|
||||||
|
, value(v)
|
||||||
|
, set(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Anope::string str() const
|
||||||
|
{
|
||||||
|
std::stringstream buf;
|
||||||
|
buf << '+' << (name.empty() ? letter : name);
|
||||||
|
if (value.empty())
|
||||||
|
buf << ' ' << value;
|
||||||
|
return buf.str();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ChannelData final
|
struct ChannelData final
|
||||||
{
|
{
|
||||||
|
Anope::unordered_map<AutoKick *> akicks;
|
||||||
Anope::string bot;
|
Anope::string bot;
|
||||||
Anope::string info_adder;
|
Anope::string info_adder;
|
||||||
Anope::string info_message;
|
Anope::string info_message;
|
||||||
@@ -126,6 +147,12 @@ struct UserData final
|
|||||||
time_t vhost_ts = 0;
|
time_t vhost_ts = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
// Whether we can safely import clones.
|
||||||
|
bool import_clones = true;
|
||||||
|
}
|
||||||
|
|
||||||
class DBAtheme final
|
class DBAtheme final
|
||||||
: public Module
|
: public Module
|
||||||
{
|
{
|
||||||
@@ -133,71 +160,70 @@ private:
|
|||||||
ServiceReference<AccessProvider> accessprov;
|
ServiceReference<AccessProvider> accessprov;
|
||||||
PrimitiveExtensibleItem<ChannelData> chandata;
|
PrimitiveExtensibleItem<ChannelData> chandata;
|
||||||
std::map<Anope::string, char> flags;
|
std::map<Anope::string, char> flags;
|
||||||
ServiceReference<ForbidService> forbidsvc;
|
|
||||||
PrimitiveExtensibleItem<UserData> userdata;
|
PrimitiveExtensibleItem<UserData> userdata;
|
||||||
ServiceReference<XLineManager> sglinemgr;
|
ServiceReference<XLineManager> sglinemgr;
|
||||||
ServiceReference<XLineManager> snlinemgr;
|
ServiceReference<XLineManager> snlinemgr;
|
||||||
ServiceReference<XLineManager> sqlinemgr;
|
ServiceReference<XLineManager> sqlinemgr;
|
||||||
|
|
||||||
Anope::map<std::function<bool(DBAtheme*,AthemeRow&)>> rowhandlers = {
|
Anope::map<std::function<bool(DBAtheme*,AthemeRow&)>> rowhandlers = {
|
||||||
{ "AC", &DBAtheme::HandleIgnore },
|
{ "AC", &DBAtheme::HandleIgnore },
|
||||||
{ "AR", &DBAtheme::HandleIgnore },
|
{ "AR", &DBAtheme::HandleIgnore },
|
||||||
{ "BE", &DBAtheme::HandleBE },
|
{ "BE", &DBAtheme::HandleBE },
|
||||||
{ "BLE", &DBAtheme::HandleIgnore },
|
{ "BLE", &DBAtheme::HandleIgnore },
|
||||||
{ "BOT", &DBAtheme::HandleBOT },
|
{ "BOT", &DBAtheme::HandleBOT },
|
||||||
{ "BOT-COUNT", &DBAtheme::HandleIgnore },
|
{ "BOT-COUNT", &DBAtheme::HandleIgnore },
|
||||||
{ "BW", &DBAtheme::HandleBW },
|
{ "BW", &DBAtheme::HandleBW },
|
||||||
{ "CA", &DBAtheme::HandleCA },
|
{ "CA", &DBAtheme::HandleCA },
|
||||||
{ "CF", &DBAtheme::HandleIgnore },
|
{ "CF", &DBAtheme::HandleIgnore },
|
||||||
{ "CFCHAN", &DBAtheme::HandleIgnore },
|
{ "CFCHAN", &DBAtheme::HandleIgnore },
|
||||||
{ "CFDBV", &DBAtheme::HandleIgnore },
|
{ "CFDBV", &DBAtheme::HandleIgnore },
|
||||||
{ "CFMD", &DBAtheme::HandleIgnore },
|
{ "CFMD", &DBAtheme::HandleIgnore },
|
||||||
{ "CFOP", &DBAtheme::HandleIgnore },
|
{ "CFOP", &DBAtheme::HandleIgnore },
|
||||||
{ "CLONES-CD", &DBAtheme::HandleIgnore },
|
{ "CLONES-CD", &DBAtheme::HandleIgnore },
|
||||||
{ "CLONES-CK", &DBAtheme::HandleIgnore },
|
{ "CLONES-CK", &DBAtheme::HandleIgnore },
|
||||||
{ "CLONES-DBV", &DBAtheme::HandleIgnore },
|
{ "CLONES-DBV", &DBAtheme::HandleCLONESDBV },
|
||||||
{ "CLONES-EX", &DBAtheme::HandleIgnore },
|
{ "CLONES-EX", &DBAtheme::HandleCLONESEX },
|
||||||
{ "CLONES-GR", &DBAtheme::HandleIgnore },
|
{ "CLONES-GR", &DBAtheme::HandleIgnore },
|
||||||
{ "CSREQ", &DBAtheme::HandleIgnore },
|
{ "CSREQ", &DBAtheme::HandleIgnore },
|
||||||
{ "CSREQ", &DBAtheme::HandleIgnore },
|
{ "CSREQ", &DBAtheme::HandleIgnore },
|
||||||
{ "DBV", &DBAtheme::HandleDBV },
|
{ "DBV", &DBAtheme::HandleDBV },
|
||||||
{ "GACL", &DBAtheme::HandleIgnore },
|
{ "GACL", &DBAtheme::HandleIgnore },
|
||||||
{ "GDBV", &DBAtheme::HandleIgnore },
|
{ "GDBV", &DBAtheme::HandleIgnore },
|
||||||
{ "GE", &DBAtheme::HandleIgnore },
|
{ "GE", &DBAtheme::HandleIgnore },
|
||||||
{ "GFA", &DBAtheme::HandleIgnore },
|
{ "GFA", &DBAtheme::HandleIgnore },
|
||||||
{ "GRP", &DBAtheme::HandleIgnore },
|
{ "GRP", &DBAtheme::HandleIgnore },
|
||||||
{ "GRVER", &DBAtheme::HandleGRVER },
|
{ "GRVER", &DBAtheme::HandleGRVER },
|
||||||
{ "HE", &DBAtheme::HandleIgnore },
|
{ "HE", &DBAtheme::HandleIgnore },
|
||||||
{ "HO", &DBAtheme::HandleIgnore },
|
{ "HO", &DBAtheme::HandleIgnore },
|
||||||
{ "HR", &DBAtheme::HandleHR },
|
{ "HR", &DBAtheme::HandleHR },
|
||||||
{ "JM", &DBAtheme::HandleIgnore },
|
{ "JM", &DBAtheme::HandleIgnore },
|
||||||
{ "KID", &DBAtheme::HandleIgnore },
|
{ "KID", &DBAtheme::HandleIgnore },
|
||||||
{ "KL", &DBAtheme::HandleKL },
|
{ "KL", &DBAtheme::HandleKL },
|
||||||
{ "LUID", &DBAtheme::HandleIgnore },
|
{ "LUID", &DBAtheme::HandleIgnore },
|
||||||
{ "MC", &DBAtheme::HandleMC },
|
{ "MC", &DBAtheme::HandleMC },
|
||||||
{ "MCFP", &DBAtheme::HandleMCFP },
|
{ "MCFP", &DBAtheme::HandleMCFP },
|
||||||
{ "MDA", &DBAtheme::HandleMDA },
|
{ "MDA", &DBAtheme::HandleMDA },
|
||||||
{ "MDC", &DBAtheme::HandleMDC },
|
{ "MDC", &DBAtheme::HandleMDC },
|
||||||
{ "MDEP", &DBAtheme::HandleIgnore },
|
{ "MDEP", &DBAtheme::HandleIgnore },
|
||||||
{ "MDG", &DBAtheme::HandleIgnore },
|
{ "MDG", &DBAtheme::HandleIgnore },
|
||||||
{ "MDN", &DBAtheme::HandleMDN },
|
{ "MDN", &DBAtheme::HandleMDN },
|
||||||
{ "MDU", &DBAtheme::HandleMDU },
|
{ "MDU", &DBAtheme::HandleMDU },
|
||||||
{ "ME", &DBAtheme::HandleME },
|
{ "ME", &DBAtheme::HandleME },
|
||||||
{ "MI", &DBAtheme::HandleMI },
|
{ "MI", &DBAtheme::HandleMI },
|
||||||
{ "MM", &DBAtheme::HandleMM },
|
{ "MM", &DBAtheme::HandleMM },
|
||||||
{ "MN", &DBAtheme::HandleMN },
|
{ "MN", &DBAtheme::HandleMN },
|
||||||
{ "MU", &DBAtheme::HandleMU },
|
{ "MU", &DBAtheme::HandleMU },
|
||||||
{ "NAM", &DBAtheme::HandleNAM },
|
{ "NAM", &DBAtheme::HandleNAM },
|
||||||
{ "QID", &DBAtheme::HandleIgnore },
|
{ "QID", &DBAtheme::HandleIgnore },
|
||||||
{ "QL", &DBAtheme::HandleQL },
|
{ "QL", &DBAtheme::HandleQL },
|
||||||
{ "RM", &DBAtheme::HandleIgnore },
|
{ "RM", &DBAtheme::HandleIgnore },
|
||||||
{ "RR", &DBAtheme::HandleIgnore },
|
{ "RR", &DBAtheme::HandleIgnore },
|
||||||
{ "RW", &DBAtheme::HandleIgnore },
|
{ "RW", &DBAtheme::HandleIgnore },
|
||||||
{ "SI", &DBAtheme::HandleIgnore },
|
{ "SI", &DBAtheme::HandleIgnore },
|
||||||
{ "SO", &DBAtheme::HandleIgnore },
|
{ "SO", &DBAtheme::HandleSO },
|
||||||
{ "TS", &DBAtheme::HandleIgnore },
|
{ "TS", &DBAtheme::HandleIgnore },
|
||||||
{ "XID", &DBAtheme::HandleIgnore },
|
{ "XID", &DBAtheme::HandleIgnore },
|
||||||
{ "XL", &DBAtheme::HandleXL },
|
{ "XL", &DBAtheme::HandleXL },
|
||||||
};
|
};
|
||||||
|
|
||||||
void ApplyAccess(Anope::string &in, char flag, Anope::string &out, std::initializer_list<const char*> privs)
|
void ApplyAccess(Anope::string &in, char flag, Anope::string &out, std::initializer_list<const char*> privs)
|
||||||
@@ -403,6 +429,9 @@ private:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We are processing an encrypted password.
|
||||||
|
flags.erase(pos, 1);
|
||||||
|
|
||||||
// Atheme supports several password hashing methods. We can only import
|
// Atheme supports several password hashing methods. We can only import
|
||||||
// some of them currently.
|
// some of them currently.
|
||||||
//
|
//
|
||||||
@@ -480,7 +509,7 @@ private:
|
|||||||
|
|
||||||
bool HandleBE(AthemeRow &row)
|
bool HandleBE(AthemeRow &row)
|
||||||
{
|
{
|
||||||
// BE <email <created> <creator> <reason>
|
// BE <email> <created> <creator> <reason>
|
||||||
auto email = row.Get();
|
auto email = row.Get();
|
||||||
auto created = row.GetNum<time_t>();
|
auto created = row.GetNum<time_t>();
|
||||||
auto creator = row.Get();
|
auto creator = row.Get();
|
||||||
@@ -489,19 +518,19 @@ private:
|
|||||||
if (!row)
|
if (!row)
|
||||||
return row.LogError(this);
|
return row.LogError(this);
|
||||||
|
|
||||||
if (!forbidsvc)
|
if (!forbid_service)
|
||||||
{
|
{
|
||||||
Log(this) << "Unable to convert forbidden email " << email << " as os_forbid is not loaded";
|
Log(this) << "Unable to convert forbidden email " << email << " as os_forbid is not loaded";
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto *forbid = forbidsvc->CreateForbid();
|
auto *forbid = forbid_service->CreateForbid();
|
||||||
forbid->created = created;
|
forbid->created = created;
|
||||||
forbid->creator = creator;
|
forbid->creator = creator;
|
||||||
forbid->mask = email;
|
forbid->mask = email;
|
||||||
forbid->reason = reason;
|
forbid->reason = reason;
|
||||||
forbid->type = FT_EMAIL;
|
forbid->type = FT_EMAIL;
|
||||||
forbidsvc->AddForbid(forbid);
|
forbid_service->AddForbid(forbid);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -583,10 +612,11 @@ private:
|
|||||||
auto *nc = NickCore::Find(mask);
|
auto *nc = NickCore::Find(mask);
|
||||||
if (flags.find('b') != Anope::string::npos)
|
if (flags.find('b') != Anope::string::npos)
|
||||||
{
|
{
|
||||||
|
auto *data = chandata.Require(ci);
|
||||||
if (nc)
|
if (nc)
|
||||||
ci->AddAkick(setter, nc, "", modifiedtime, modifiedtime);
|
data->akicks[mask] = ci->AddAkick(setter, nc, "", modifiedtime, modifiedtime);
|
||||||
else
|
else
|
||||||
ci->AddAkick(setter, mask, "", modifiedtime, modifiedtime);
|
data->akicks[mask] = ci->AddAkick(setter, mask, "", modifiedtime, modifiedtime);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -626,15 +656,59 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flags != "+")
|
if (flags != "+")
|
||||||
Log(this) << "Unable to convert channel access flags " << flags << " for " << ci->name;
|
Log(this) << "Unable to convert channel access flags " << flags << " for " << mask << " on " << ci->name;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HandleCLONESDBV(AthemeRow &row)
|
||||||
|
{
|
||||||
|
// CLONES-DBV <version>
|
||||||
|
auto version = row.GetNum<unsigned>();
|
||||||
|
if (version != 3)
|
||||||
|
{
|
||||||
|
Log(this) << "Clones database is version " << version << " which is not supported!";
|
||||||
|
import_clones = false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool HandleCLONESEX(AthemeRow &row)
|
||||||
|
{
|
||||||
|
if (!import_clones)
|
||||||
|
return HandleIgnore(row);
|
||||||
|
|
||||||
|
// CLONES-EX <ip> <allowed> <warn> <expires> <reason>
|
||||||
|
auto ip = row.Get();
|
||||||
|
auto allowed = row.GetNum<unsigned>();
|
||||||
|
/* auto warn = */ row.GetNum<unsigned>();
|
||||||
|
auto expires = row.GetNum<time_t>();
|
||||||
|
auto reason = row.GetRemaining();
|
||||||
|
|
||||||
|
if (!row)
|
||||||
|
return row.LogError(this);
|
||||||
|
|
||||||
|
if (!session_service)
|
||||||
|
{
|
||||||
|
Log(this) << "Unable to import session limit for " << ip << " as os_session is not loaded";
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto *exception = session_service->CreateException();
|
||||||
|
exception->mask = ip;
|
||||||
|
exception->limit = allowed;
|
||||||
|
exception->who = "Unknown";
|
||||||
|
exception->time = Anope::CurTime;
|
||||||
|
exception->expires = expires;
|
||||||
|
exception->reason = reason;
|
||||||
|
session_service->AddException(exception);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool HandleDBV(AthemeRow &row)
|
bool HandleDBV(AthemeRow &row)
|
||||||
{
|
{
|
||||||
// DBV <version>
|
// DBV <version>
|
||||||
unsigned version = row.GetNum<unsigned>();
|
auto version = row.GetNum<unsigned>();
|
||||||
if (version != 12)
|
if (version != 12)
|
||||||
{
|
{
|
||||||
Log(this) << "Database is version " << version << " which is not supported!";
|
Log(this) << "Database is version " << version << " which is not supported!";
|
||||||
@@ -646,7 +720,7 @@ private:
|
|||||||
bool HandleGRVER(AthemeRow &row)
|
bool HandleGRVER(AthemeRow &row)
|
||||||
{
|
{
|
||||||
// GRVER <version>
|
// GRVER <version>
|
||||||
unsigned version = row.GetNum<unsigned>();
|
auto version = row.GetNum<unsigned>();
|
||||||
if (version != 1)
|
if (version != 1)
|
||||||
{
|
{
|
||||||
Log(this) << "Database grammar is version " << version << " which is not supported!";
|
Log(this) << "Database grammar is version " << version << " which is not supported!";
|
||||||
@@ -718,6 +792,12 @@ private:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HandleIgnoreMetadata(const Anope::string &target, const Anope::string &key, const Anope::string &value)
|
||||||
|
{
|
||||||
|
Log(LOG_DEBUG_3) << "Intentionally ignoring Atheme database metadata for " << target << ": " << key << " = " << value;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool HandleMC(AthemeRow &row)
|
bool HandleMC(AthemeRow &row)
|
||||||
{
|
{
|
||||||
// MC <channel> <regtime> <used> <flags> <mlock-on> <mlock-off> <mlock-limit> [<mlock-key>]
|
// MC <channel> <regtime> <used> <flags> <mlock-on> <mlock-off> <mlock-limit> [<mlock-key>]
|
||||||
@@ -822,7 +902,7 @@ private:
|
|||||||
bool HandleMDA(AthemeRow &row)
|
bool HandleMDA(AthemeRow &row)
|
||||||
{
|
{
|
||||||
// MDA <channel> <account/mask> <key> <value>
|
// MDA <channel> <account/mask> <key> <value>
|
||||||
auto display = row.Get();
|
auto channel = row.Get();
|
||||||
auto mask = row.Get();
|
auto mask = row.Get();
|
||||||
auto key = row.Get();
|
auto key = row.Get();
|
||||||
auto value = row.GetRemaining();
|
auto value = row.GetRemaining();
|
||||||
@@ -830,7 +910,23 @@ private:
|
|||||||
if (!row)
|
if (!row)
|
||||||
return row.LogError(this);
|
return row.LogError(this);
|
||||||
|
|
||||||
Log(this) << "Unknown channel access metadata " << key << " = " << value;
|
auto *ci = ChannelInfo::Find(channel);
|
||||||
|
if (!ci)
|
||||||
|
{
|
||||||
|
Log(this) << "Missing ChannelInfo for MDA: " << channel;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (key == "reason")
|
||||||
|
{
|
||||||
|
auto *data = chandata.Require(ci);
|
||||||
|
auto akick = data->akicks.find(mask);
|
||||||
|
if (akick != data->akicks.end())
|
||||||
|
akick->second->reason = value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Log(this) << "Unknown channel access metadata for " << mask << " on " << ci->name << ": " << key << " = " << value;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -858,6 +954,8 @@ private:
|
|||||||
ci->Extend<bool>("BS_FANTASY");
|
ci->Extend<bool>("BS_FANTASY");
|
||||||
else if (key == "private:botserv:no-bot")
|
else if (key == "private:botserv:no-bot")
|
||||||
ci->Extend<bool>("BS_NOBOT");
|
ci->Extend<bool>("BS_NOBOT");
|
||||||
|
else if (key == "private:channelts")
|
||||||
|
return HandleIgnoreMetadata(ci->name, key, value);
|
||||||
else if (key == "private:close:closer")
|
else if (key == "private:close:closer")
|
||||||
data->suspend_by = value;
|
data->suspend_by = value;
|
||||||
else if (key == "private:close:reason")
|
else if (key == "private:close:reason")
|
||||||
@@ -892,29 +990,60 @@ private:
|
|||||||
data->info_adder = value;
|
data->info_adder = value;
|
||||||
else if (key == "private:mark:timestamp")
|
else if (key == "private:mark:timestamp")
|
||||||
data->info_ts = Anope::Convert<time_t>(value, 0);
|
data->info_ts = Anope::Convert<time_t>(value, 0);
|
||||||
|
else if (key == "private:mlockext")
|
||||||
|
{
|
||||||
|
spacesepstream mlocks(value);
|
||||||
|
for (Anope::string mlock; mlocks.GetToken(mlock); )
|
||||||
|
data->mlocks.emplace_back(mlock[0], mlock.substr(1));
|
||||||
|
}
|
||||||
|
else if (key == "private:templates")
|
||||||
|
return HandleIgnoreMetadata(ci->name, key, value);
|
||||||
else if (key == "private:topic:setter")
|
else if (key == "private:topic:setter")
|
||||||
ci->last_topic_setter = value;
|
ci->last_topic_setter = value;
|
||||||
else if (key == "private:topic:text")
|
else if (key == "private:topic:text")
|
||||||
ci->last_topic = value;
|
ci->last_topic = value;
|
||||||
else if (key == "private:topic:ts")
|
else if (key == "private:topic:ts")
|
||||||
ci->last_topic_time = Anope::Convert<time_t>(value, 0);
|
ci->last_topic_time = Anope::Convert<time_t>(value, 0);
|
||||||
|
else if (key.compare(0, 14, "private:stats:", 14) == 0)
|
||||||
|
return HandleIgnoreMetadata(ci->name, key, value);
|
||||||
else
|
else
|
||||||
Log(this) << "Unknown channel metadata " << key << " = " << value;
|
Log(this) << "Unknown channel metadata for " << ci->name << ": " << key << " = " << value;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HandleMDN(AthemeRow &row)
|
bool HandleMDN(AthemeRow &row)
|
||||||
{
|
{
|
||||||
// MDN <display> <key> <value>
|
// MDN <nick> <key> <value>
|
||||||
auto display = row.Get();
|
auto nick = row.Get();
|
||||||
auto key = row.Get();
|
auto key = row.Get();
|
||||||
auto value = row.GetRemaining();
|
auto value = row.GetRemaining();
|
||||||
|
|
||||||
if (!row)
|
if (!row)
|
||||||
return row.LogError(this);
|
return row.LogError(this);
|
||||||
|
|
||||||
Log(this) << "Unknown nick metadata " << key << " = " << value;
|
if (!forbid_service)
|
||||||
|
{
|
||||||
|
Log(this) << "Unable to convert forbidden nick " << nick << " metadata as os_forbid is not loaded";
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto *forbid = forbid_service->FindForbidExact(nick, FT_NICK);
|
||||||
|
if (!forbid)
|
||||||
|
{
|
||||||
|
Log(this) << "Missing forbid for MDN: " << nick;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (key == "private:mark:reason")
|
||||||
|
forbid->reason = value;
|
||||||
|
else if (key == "private:mark:setter")
|
||||||
|
forbid->creator = value;
|
||||||
|
else if (key == "private:mark:timestamp")
|
||||||
|
forbid->created = Anope::Convert<time_t>(value, 0);
|
||||||
|
else
|
||||||
|
Log(this) << "Unknown forbidden nick metadata for " << forbid->mask << ": " << key << " = " << value;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -967,12 +1096,20 @@ private:
|
|||||||
data->last_mask = value;
|
data->last_mask = value;
|
||||||
else if (key == "private:lastquit:message")
|
else if (key == "private:lastquit:message")
|
||||||
data->last_quit = value;
|
data->last_quit = value;
|
||||||
|
else if (key == "private:loginfail:failnum")
|
||||||
|
return HandleIgnoreMetadata(nc->display, key, value);
|
||||||
|
else if (key == "private:loginfail:lastfailaddr")
|
||||||
|
return HandleIgnoreMetadata(nc->display, key, value);
|
||||||
|
else if (key == "private:loginfail:lastfailtime")
|
||||||
|
return HandleIgnoreMetadata(nc->display, key, value);
|
||||||
else if (key == "private:mark:reason")
|
else if (key == "private:mark:reason")
|
||||||
data->info_message = value;
|
data->info_message = value;
|
||||||
else if (key == "private:mark:setter")
|
else if (key == "private:mark:setter")
|
||||||
data->info_adder = value;
|
data->info_adder = value;
|
||||||
else if (key == "private:mark:timestamp")
|
else if (key == "private:mark:timestamp")
|
||||||
data->info_ts = Anope::Convert<time_t>(value, 0);
|
data->info_ts = Anope::Convert<time_t>(value, 0);
|
||||||
|
else if (key == "private:swhois")
|
||||||
|
return HandleIgnoreMetadata(nc->display, key, value);
|
||||||
else if (key == "private:usercloak")
|
else if (key == "private:usercloak")
|
||||||
data->vhost = value;
|
data->vhost = value;
|
||||||
else if (key == "private:usercloak-assigner")
|
else if (key == "private:usercloak-assigner")
|
||||||
@@ -982,7 +1119,7 @@ private:
|
|||||||
else if (key.compare(0, 18, "private:usercloak:", 18) == 0)
|
else if (key.compare(0, 18, "private:usercloak:", 18) == 0)
|
||||||
data->vhost_nick[key.substr(18)] = value;
|
data->vhost_nick[key.substr(18)] = value;
|
||||||
else
|
else
|
||||||
Log(this) << "Unknown account metadata " << key << " = " << value;
|
Log(this) << "Unknown account metadata for " << nc->display << ": " << key << " = " << value;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1200,18 +1337,18 @@ private:
|
|||||||
if (!row)
|
if (!row)
|
||||||
return row.LogError(this);
|
return row.LogError(this);
|
||||||
|
|
||||||
if (!forbidsvc)
|
if (!forbid_service)
|
||||||
{
|
{
|
||||||
Log(this) << "Unable to convert forbidden nick " << nick << " as os_forbid is not loaded";
|
Log(this) << "Unable to convert forbidden nick " << nick << " as os_forbid is not loaded";
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto *forbid = forbidsvc->CreateForbid();
|
auto *forbid = forbid_service->CreateForbid();
|
||||||
forbid->creator = "Unknown";
|
forbid->creator = "Unknown";
|
||||||
forbid->mask = nick;
|
forbid->mask = nick;
|
||||||
forbid->reason = "Unknown";
|
forbid->reason = "Unknown";
|
||||||
forbid->type = FT_NICK;
|
forbid->type = FT_NICK;
|
||||||
forbidsvc->AddForbid(forbid);
|
forbid_service->AddForbid(forbid);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1239,6 +1376,43 @@ private:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HandleSO(AthemeRow &row)
|
||||||
|
{
|
||||||
|
// SO <display> <type> <flags>
|
||||||
|
auto display = row.Get();
|
||||||
|
auto type = row.Get();
|
||||||
|
auto flags = row.Get();
|
||||||
|
|
||||||
|
if (!row)
|
||||||
|
return row.LogError(this);
|
||||||
|
|
||||||
|
auto *nc = NickCore::Find(display);
|
||||||
|
if (!nc)
|
||||||
|
{
|
||||||
|
Log(this) << "Missing NickCore for SO: " << display;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto *ot = OperType::Find(type);
|
||||||
|
if (!ot)
|
||||||
|
{
|
||||||
|
// Attempt to convert oper types.
|
||||||
|
if (type == "sra")
|
||||||
|
ot = OperType::Find("Services Root");
|
||||||
|
else if (type == "ircop")
|
||||||
|
ot = OperType::Find("Services Operator");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ot)
|
||||||
|
{
|
||||||
|
Log(this) << "Unable to convert operator status for " << nc->display << " as there is no equivalent oper type: " << type;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
nc->o = new MyOper(nc->display, ot);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool HandleXL(AthemeRow &row)
|
bool HandleXL(AthemeRow &row)
|
||||||
{
|
{
|
||||||
// XL <id> <real> <duration> <settime> <setby> <reason>
|
// XL <id> <real> <duration> <settime> <setby> <reason>
|
||||||
@@ -1268,7 +1442,6 @@ public:
|
|||||||
: Module(modname, creator, DATABASE | VENDOR)
|
: Module(modname, creator, DATABASE | VENDOR)
|
||||||
, accessprov("AccessProvider", "access/flags")
|
, accessprov("AccessProvider", "access/flags")
|
||||||
, chandata(this, "ATHEME_CHANDATA")
|
, chandata(this, "ATHEME_CHANDATA")
|
||||||
, forbidsvc("ForbidService", "forbid")
|
|
||||||
, userdata(this, "ATHEME_USERDATA")
|
, userdata(this, "ATHEME_USERDATA")
|
||||||
, sglinemgr("XLineManager","xlinemanager/sgline")
|
, sglinemgr("XLineManager","xlinemanager/sgline")
|
||||||
, snlinemgr("XLineManager","xlinemanager/snline")
|
, snlinemgr("XLineManager","xlinemanager/snline")
|
||||||
@@ -1417,16 +1590,21 @@ public:
|
|||||||
|
|
||||||
for (const auto &mlock : data->mlocks)
|
for (const auto &mlock : data->mlocks)
|
||||||
{
|
{
|
||||||
auto mh = ModeManager::FindChannelModeByName(mlock.name);
|
ChannelMode *mh;
|
||||||
|
if (mlock.name.empty())
|
||||||
|
mh = ModeManager::FindChannelModeByChar(mlock.letter);
|
||||||
|
else
|
||||||
|
mh = ModeManager::FindChannelModeByName(mlock.name);
|
||||||
if (!mh)
|
if (!mh)
|
||||||
{
|
{
|
||||||
Log(this) << "Unable to find mode while importing mode lock: " << mlock.name;
|
Log(this) << "Unable to find mode while importing mode lock on " << ci->name << ": " << mlock.str();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ml->SetMLock(mh, mlock.set, mlock.value, "Unknown");
|
ml->SetMLock(mh, mlock.set, mlock.value, "Unknown");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Anope::SaveDatabases();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -71,14 +71,6 @@ public:
|
|||||||
return this->ss;
|
return this->ss;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::set<Anope::string> KeySet() const override
|
|
||||||
{
|
|
||||||
std::set<Anope::string> keys;
|
|
||||||
for (const auto &[key, _]: this->data)
|
|
||||||
keys.insert(key);
|
|
||||||
return keys;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t Hash() const override
|
size_t Hash() const override
|
||||||
{
|
{
|
||||||
size_t hash = 0;
|
size_t hash = 0;
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ static Anope::string GetLevelName(int level)
|
|||||||
case 15:
|
case 15:
|
||||||
return "NOKICK";
|
return "NOKICK";
|
||||||
case 16:
|
case 16:
|
||||||
return "FANTASIA";
|
return "FANTASY";
|
||||||
case 17:
|
case 17:
|
||||||
return "SAY";
|
return "SAY";
|
||||||
case 18:
|
case 18:
|
||||||
@@ -537,24 +537,18 @@ static void LoadNicks()
|
|||||||
case LANG_DE:
|
case LANG_DE:
|
||||||
nc->language = "de_DE.UTF-8";
|
nc->language = "de_DE.UTF-8";
|
||||||
break;
|
break;
|
||||||
case LANG_CAT:
|
|
||||||
nc->language = "ca_ES.UTF-8"; // yes, iso639 defines catalan as CA
|
|
||||||
break;
|
|
||||||
case LANG_GR:
|
case LANG_GR:
|
||||||
nc->language = "el_GR.UTF-8";
|
nc->language = "el_GR.UTF-8";
|
||||||
break;
|
break;
|
||||||
case LANG_NL:
|
case LANG_NL:
|
||||||
nc->language = "nl_NL.UTF-8";
|
nc->language = "nl_NL.UTF-8";
|
||||||
break;
|
break;
|
||||||
case LANG_RU:
|
|
||||||
nc->language = "ru_RU.UTF-8";
|
|
||||||
break;
|
|
||||||
case LANG_HUN:
|
|
||||||
nc->language = "hu_HU.UTF-8";
|
|
||||||
break;
|
|
||||||
case LANG_PL:
|
case LANG_PL:
|
||||||
nc->language = "pl_PL.UTF-8";
|
nc->language = "pl_PL.UTF-8";
|
||||||
break;
|
break;
|
||||||
|
case LANG_CAT:
|
||||||
|
case LANG_HUN:
|
||||||
|
case LANG_RU:
|
||||||
case LANG_EN_US:
|
case LANG_EN_US:
|
||||||
case LANG_JA_JIS:
|
case LANG_JA_JIS:
|
||||||
case LANG_JA_EUC:
|
case LANG_JA_EUC:
|
||||||
@@ -1348,6 +1342,7 @@ public:
|
|||||||
if (ci->c)
|
if (ci->c)
|
||||||
ci->c->CheckModes();
|
ci->c->CheckModes();
|
||||||
}
|
}
|
||||||
|
Anope::SaveDatabases();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -34,14 +34,6 @@ public:
|
|||||||
return *stream;
|
return *stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::set<Anope::string> KeySet() const override
|
|
||||||
{
|
|
||||||
std::set<Anope::string> keys;
|
|
||||||
for (const auto &[key, _] : this->data)
|
|
||||||
keys.insert(key);
|
|
||||||
return keys;
|
|
||||||
}
|
|
||||||
|
|
||||||
size_t Hash() const override
|
size_t Hash() const override
|
||||||
{
|
{
|
||||||
size_t hash = 0;
|
size_t hash = 0;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ private:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (Anope::CurTime - Config->GetBlock("options")->Get<time_t>("updatetimeout", "5m") > lastwarn)
|
if (Anope::CurTime - Config->GetBlock("options")->Get<time_t>("updatetimeout", "2m") > lastwarn)
|
||||||
{
|
{
|
||||||
Log() << "Unable to locate SQL reference, going to readonly...";
|
Log() << "Unable to locate SQL reference, going to readonly...";
|
||||||
Anope::ReadOnly = this->ro = true;
|
Anope::ReadOnly = this->ro = true;
|
||||||
|
|||||||
+60
-21
@@ -121,6 +121,7 @@ class MySQLService final
|
|||||||
Anope::string user;
|
Anope::string user;
|
||||||
Anope::string password;
|
Anope::string password;
|
||||||
unsigned int port;
|
unsigned int port;
|
||||||
|
Anope::string socket;
|
||||||
|
|
||||||
MYSQL *sql = nullptr;
|
MYSQL *sql = nullptr;
|
||||||
|
|
||||||
@@ -136,7 +137,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
std::mutex Lock;
|
std::mutex Lock;
|
||||||
|
|
||||||
MySQLService(Module *o, const Anope::string &n, const Anope::string &d, const Anope::string &s, const Anope::string &u, const Anope::string &p, unsigned int po);
|
MySQLService(Module *o, const Anope::string &n, const Anope::string &d, const Anope::string &s, const Anope::string &u, const Anope::string &p, unsigned int po, const Anope::string &so);
|
||||||
|
|
||||||
~MySQLService();
|
~MySQLService();
|
||||||
|
|
||||||
@@ -157,6 +158,29 @@ public:
|
|||||||
Anope::string BuildQuery(const Query &q);
|
Anope::string BuildQuery(const Query &q);
|
||||||
|
|
||||||
Anope::string FromUnixtime(time_t) override;
|
Anope::string FromUnixtime(time_t) override;
|
||||||
|
|
||||||
|
Anope::string GetColumnType(Serialize::DataType dt)
|
||||||
|
{
|
||||||
|
switch (dt)
|
||||||
|
{
|
||||||
|
case Serialize::DataType::BOOL:
|
||||||
|
return "TINYINT NOT NULL";
|
||||||
|
|
||||||
|
case Serialize::DataType::FLOAT:
|
||||||
|
return "DOUBLE PRECISION NOT NULL";
|
||||||
|
|
||||||
|
case Serialize::DataType::INT:
|
||||||
|
return "BIGINT NOT NULL";
|
||||||
|
|
||||||
|
case Serialize::DataType::TEXT:
|
||||||
|
return "TEXT";
|
||||||
|
|
||||||
|
case Serialize::DataType::UINT:
|
||||||
|
return "BIGINT UNSIGNED NOT NULL";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "TEXT"; // Should never be reached
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** The SQL thread used to execute queries
|
/** The SQL thread used to execute queries
|
||||||
@@ -248,13 +272,14 @@ public:
|
|||||||
const Anope::string &user = block->Get<const Anope::string>("username", "anope");
|
const Anope::string &user = block->Get<const Anope::string>("username", "anope");
|
||||||
const Anope::string &password = block->Get<const Anope::string>("password");
|
const Anope::string &password = block->Get<const Anope::string>("password");
|
||||||
unsigned int port = block->Get<unsigned int>("port", "3306");
|
unsigned int port = block->Get<unsigned int>("port", "3306");
|
||||||
|
const Anope::string &socket = block->Get<const Anope::string>("socket");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
auto *ss = new MySQLService(this, connname, database, server, user, password, port);
|
auto *ss = new MySQLService(this, connname, database, server, user, password, port, socket);
|
||||||
this->MySQLServices.emplace(connname, ss);
|
this->MySQLServices.emplace(connname, ss);
|
||||||
|
|
||||||
Log(LOG_NORMAL, "mysql") << "MySQL: Successfully connected to server " << connname << " (" << server << ")";
|
Log(LOG_NORMAL, "mysql") << "MySQL: Successfully connected to server " << connname << " (" << (socket.empty() ? server + ":" + port : socket) << ")";
|
||||||
}
|
}
|
||||||
catch (const SQL::Exception &ex)
|
catch (const SQL::Exception &ex)
|
||||||
{
|
{
|
||||||
@@ -309,13 +334,14 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
MySQLService::MySQLService(Module *o, const Anope::string &n, const Anope::string &d, const Anope::string &s, const Anope::string &u, const Anope::string &p, unsigned int po)
|
MySQLService::MySQLService(Module *o, const Anope::string &n, const Anope::string &d, const Anope::string &s, const Anope::string &u, const Anope::string &p, unsigned int po, const Anope::string &so)
|
||||||
: Provider(o, n)
|
: Provider(o, n)
|
||||||
, database(d)
|
, database(d)
|
||||||
, server(s)
|
, server(s)
|
||||||
, user(u)
|
, user(u)
|
||||||
, password(p)
|
, password(p)
|
||||||
, port(po)
|
, port(po)
|
||||||
|
, socket(so)
|
||||||
{
|
{
|
||||||
Connect();
|
Connect();
|
||||||
}
|
}
|
||||||
@@ -407,17 +433,13 @@ std::vector<Query> MySQLService::CreateTable(const Anope::string &table, const D
|
|||||||
|
|
||||||
if (known_cols.empty())
|
if (known_cols.empty())
|
||||||
{
|
{
|
||||||
Anope::string query_text = "CREATE TABLE `" + table + "` (`id` int(10) unsigned NOT NULL AUTO_INCREMENT,"
|
Anope::string query_text = "CREATE TABLE `" + table + "` (`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE,"
|
||||||
" `timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP";
|
" `timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP";
|
||||||
for (const auto &[column, _] : data.data)
|
for (const auto &[column, _] : data.data)
|
||||||
{
|
{
|
||||||
known_cols.insert(column);
|
known_cols.insert(column);
|
||||||
|
|
||||||
query_text += ", `" + column + "` ";
|
query_text += ", `" + column + "` " + GetColumnType(data.GetType(column));
|
||||||
if (data.GetType(column) == Serialize::Data::DT_INT)
|
|
||||||
query_text += "int";
|
|
||||||
else
|
|
||||||
query_text += "text";
|
|
||||||
}
|
}
|
||||||
query_text += ", PRIMARY KEY (`id`), KEY `timestamp_idx` (`timestamp`)) ROW_FORMAT=DYNAMIC";
|
query_text += ", PRIMARY KEY (`id`), KEY `timestamp_idx` (`timestamp`)) ROW_FORMAT=DYNAMIC";
|
||||||
queries.push_back(query_text);
|
queries.push_back(query_text);
|
||||||
@@ -431,11 +453,7 @@ std::vector<Query> MySQLService::CreateTable(const Anope::string &table, const D
|
|||||||
|
|
||||||
known_cols.insert(column);
|
known_cols.insert(column);
|
||||||
|
|
||||||
Anope::string query_text = "ALTER TABLE `" + table + "` ADD `" + column + "` ";
|
Anope::string query_text = "ALTER TABLE `" + table + "` ADD `" + column + "` " + GetColumnType(data.GetType(column));
|
||||||
if (data.GetType(column) == Serialize::Data::DT_INT)
|
|
||||||
query_text += "int";
|
|
||||||
else
|
|
||||||
query_text += "text";
|
|
||||||
|
|
||||||
queries.push_back(query_text);
|
queries.push_back(query_text);
|
||||||
}
|
}
|
||||||
@@ -471,11 +489,29 @@ Query MySQLService::BuildInsert(const Anope::string &table, unsigned int id, Dat
|
|||||||
Anope::string buf;
|
Anope::string buf;
|
||||||
*value >> buf;
|
*value >> buf;
|
||||||
|
|
||||||
bool escape = true;
|
auto escape = true;
|
||||||
if (buf.empty())
|
switch (data.GetType(field))
|
||||||
{
|
{
|
||||||
buf = "NULL";
|
case Serialize::DataType::BOOL:
|
||||||
escape = false;
|
case Serialize::DataType::FLOAT:
|
||||||
|
case Serialize::DataType::INT:
|
||||||
|
case Serialize::DataType::UINT:
|
||||||
|
{
|
||||||
|
if (buf.empty())
|
||||||
|
buf = "0";
|
||||||
|
escape = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case Serialize::DataType::TEXT:
|
||||||
|
{
|
||||||
|
if (buf.empty())
|
||||||
|
{
|
||||||
|
buf = "NULL";
|
||||||
|
escape = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query.SetValue(field, buf, escape);
|
query.SetValue(field, buf, escape);
|
||||||
@@ -496,12 +532,15 @@ void MySQLService::Connect()
|
|||||||
const unsigned int timeout = 1;
|
const unsigned int timeout = 1;
|
||||||
mysql_options(this->sql, MYSQL_OPT_CONNECT_TIMEOUT, reinterpret_cast<const char *>(&timeout));
|
mysql_options(this->sql, MYSQL_OPT_CONNECT_TIMEOUT, reinterpret_cast<const char *>(&timeout));
|
||||||
|
|
||||||
bool connect = mysql_real_connect(this->sql, this->server.c_str(), this->user.c_str(), this->password.c_str(), this->database.c_str(), this->port, NULL, CLIENT_MULTI_RESULTS);
|
bool connect = mysql_real_connect(this->sql, this->server.c_str(), this->user.c_str(), this->password.c_str(), this->database.c_str(), this->port, this->socket.empty() ? nullptr : this->socket.c_str(), CLIENT_MULTI_RESULTS);
|
||||||
|
|
||||||
if (!connect)
|
if (!connect)
|
||||||
throw SQL::Exception("Unable to connect to MySQL service " + this->name + ": " + mysql_error(this->sql));
|
throw SQL::Exception("Unable to connect to MySQL service " + this->name + ": " + mysql_error(this->sql));
|
||||||
|
|
||||||
Log(LOG_DEBUG) << "Successfully connected to MySQL service " << this->name << " at " << this->server << ":" << this->port;
|
if (this->socket.empty())
|
||||||
|
Log(LOG_DEBUG) << "Successfully connected to MySQL service " << this->name << " at " << this->server << ":" << this->port;
|
||||||
|
else
|
||||||
|
Log(LOG_DEBUG) << "Successfully connected to MySQL service " << this->name << " at " << this->socket;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+54
-11
@@ -68,6 +68,31 @@ public:
|
|||||||
Anope::string BuildQuery(const Query &q);
|
Anope::string BuildQuery(const Query &q);
|
||||||
|
|
||||||
Anope::string FromUnixtime(time_t) override;
|
Anope::string FromUnixtime(time_t) override;
|
||||||
|
|
||||||
|
Anope::string GetColumnType(Serialize::DataType dt)
|
||||||
|
{
|
||||||
|
switch (dt)
|
||||||
|
{
|
||||||
|
case Serialize::DataType::BOOL:
|
||||||
|
return "INTEGER";
|
||||||
|
|
||||||
|
case Serialize::DataType::FLOAT:
|
||||||
|
return "REAL";
|
||||||
|
|
||||||
|
case Serialize::DataType::INT:
|
||||||
|
return "INTEGER";
|
||||||
|
|
||||||
|
case Serialize::DataType::TEXT:
|
||||||
|
return "TEXT";
|
||||||
|
|
||||||
|
// SQLite lacks support for 64-bit unsigned integers so we have to
|
||||||
|
// store them as text columns instead.
|
||||||
|
case Serialize::DataType::UINT:
|
||||||
|
return "TEXT";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "TEXT"; // Should never be reached
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class ModuleSQLite final
|
class ModuleSQLite final
|
||||||
@@ -237,11 +262,7 @@ std::vector<Query> SQLiteService::CreateTable(const Anope::string &table, const
|
|||||||
{
|
{
|
||||||
known_cols.insert(column);
|
known_cols.insert(column);
|
||||||
|
|
||||||
query_text += ", `" + column + "` ";
|
query_text += ", `" + column + "` " + GetColumnType(data.GetType(column));
|
||||||
if (data.GetType(column) == Serialize::Data::DT_INT)
|
|
||||||
query_text += "int(11)";
|
|
||||||
else
|
|
||||||
query_text += "text";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
query_text += ")";
|
query_text += ")";
|
||||||
@@ -266,11 +287,7 @@ std::vector<Query> SQLiteService::CreateTable(const Anope::string &table, const
|
|||||||
|
|
||||||
known_cols.insert(column);
|
known_cols.insert(column);
|
||||||
|
|
||||||
Anope::string query_text = "ALTER TABLE `" + table + "` ADD `" + column + "` ";
|
Anope::string query_text = "ALTER TABLE `" + table + "` ADD `" + column + "` " + GetColumnType(data.GetType(column));;
|
||||||
if (data.GetType(column) == Serialize::Data::DT_INT)
|
|
||||||
query_text += "int(11)";
|
|
||||||
else
|
|
||||||
query_text += "text";
|
|
||||||
|
|
||||||
queries.push_back(query_text);
|
queries.push_back(query_text);
|
||||||
}
|
}
|
||||||
@@ -307,7 +324,33 @@ Query SQLiteService::BuildInsert(const Anope::string &table, unsigned int id, Da
|
|||||||
{
|
{
|
||||||
Anope::string buf;
|
Anope::string buf;
|
||||||
*value >> buf;
|
*value >> buf;
|
||||||
query.SetValue(field, buf);
|
|
||||||
|
auto escape = true;
|
||||||
|
switch (data.GetType(field))
|
||||||
|
{
|
||||||
|
case Serialize::DataType::BOOL:
|
||||||
|
case Serialize::DataType::FLOAT:
|
||||||
|
case Serialize::DataType::INT:
|
||||||
|
{
|
||||||
|
if (buf.empty())
|
||||||
|
buf = "0";
|
||||||
|
escape = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case Serialize::DataType::TEXT:
|
||||||
|
case Serialize::DataType::UINT:
|
||||||
|
{
|
||||||
|
if (buf.empty())
|
||||||
|
{
|
||||||
|
buf = "NULL";
|
||||||
|
escape = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query.SetValue(field, buf, escape);
|
||||||
}
|
}
|
||||||
|
|
||||||
return query;
|
return query;
|
||||||
|
|||||||
+7
-7
@@ -17,7 +17,7 @@ class CommandBSSetFantasy final
|
|||||||
public:
|
public:
|
||||||
CommandBSSetFantasy(Module *creator, const Anope::string &sname = "botserv/set/fantasy") : Command(creator, sname, 2, 2)
|
CommandBSSetFantasy(Module *creator, const Anope::string &sname = "botserv/set/fantasy") : Command(creator, sname, 2, 2)
|
||||||
{
|
{
|
||||||
this->SetDesc(_("Enable fantaisist commands"));
|
this->SetDesc(_("Enable fantasy commands"));
|
||||||
this->SetSyntax(_("\037channel\037 {\037ON|OFF\037}"));
|
this->SetSyntax(_("\037channel\037 {\037ON|OFF\037}"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,9 +73,9 @@ public:
|
|||||||
"fantasy commands on a channel when prefixed\n"
|
"fantasy commands on a channel when prefixed\n"
|
||||||
"with one of the following fantasy characters: \002%s\002\n"
|
"with one of the following fantasy characters: \002%s\002\n"
|
||||||
" \n"
|
" \n"
|
||||||
"Note that users wanting to use fantaisist\n"
|
"Note that users wanting to use fantasy commands\n"
|
||||||
"commands MUST have enough access for both\n"
|
"MUST have enough access for both the FANTASY\n"
|
||||||
"the FANTASIA and the command they are executing."),
|
"privilege and the command they are executing."),
|
||||||
Config->GetModule(this->owner)->Get<const Anope::string>("fantasycharacter", "!").c_str());
|
Config->GetModule(this->owner)->Get<const Anope::string>("fantasycharacter", "!").c_str());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -186,10 +186,10 @@ public:
|
|||||||
source.permission = info.permission;
|
source.permission = info.permission;
|
||||||
|
|
||||||
AccessGroup ag = c->ci->AccessFor(u);
|
AccessGroup ag = c->ci->AccessFor(u);
|
||||||
bool has_fantasia = ag.HasPriv("FANTASIA") || source.HasPriv("botserv/fantasy");
|
bool has_fantasy = ag.HasPriv("FANTASY") || source.HasPriv("botserv/fantasy");
|
||||||
|
|
||||||
EventReturn MOD_RESULT;
|
EventReturn MOD_RESULT;
|
||||||
if (has_fantasia)
|
if (has_fantasy)
|
||||||
{
|
{
|
||||||
FOREACH_RESULT(OnBotFantasy, MOD_RESULT, (source, cmd, c->ci, params));
|
FOREACH_RESULT(OnBotFantasy, MOD_RESULT, (source, cmd, c->ci, params));
|
||||||
}
|
}
|
||||||
@@ -198,7 +198,7 @@ public:
|
|||||||
FOREACH_RESULT(OnBotNoFantasyAccess, MOD_RESULT, (source, cmd, c->ci, params));
|
FOREACH_RESULT(OnBotNoFantasyAccess, MOD_RESULT, (source, cmd, c->ci, params));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MOD_RESULT == EVENT_STOP || !has_fantasia)
|
if (MOD_RESULT == EVENT_STOP || !has_fantasy)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (MOD_RESULT != EVENT_ALLOW && !info.permission.empty() && !source.HasCommand(info.permission))
|
if (MOD_RESULT != EVENT_ALLOW && !info.permission.empty() && !source.HasCommand(info.permission))
|
||||||
|
|||||||
@@ -137,9 +137,6 @@ public:
|
|||||||
if (!sender)
|
if (!sender)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!server)
|
|
||||||
server = Servers::GetUplink();
|
|
||||||
|
|
||||||
Anope::string line;
|
Anope::string line;
|
||||||
if (source && !Config->GetModule(this)->Get<bool>("anonymousglobal"))
|
if (source && !Config->GetModule(this)->Get<bool>("anonymousglobal"))
|
||||||
{
|
{
|
||||||
@@ -153,9 +150,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (server)
|
if (server)
|
||||||
this->ServerGlobal(sender, Servers::GetUplink(), true, line);
|
|
||||||
else
|
|
||||||
this->ServerGlobal(sender, server, false, line);
|
this->ServerGlobal(sender, server, false, line);
|
||||||
|
else
|
||||||
|
this->ServerGlobal(sender, Servers::GetUplink(), true, line);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -198,7 +198,8 @@ public:
|
|||||||
Anope::string *greet = ns_greet.Get(user->Account());
|
Anope::string *greet = ns_greet.Get(user->Account());
|
||||||
if (bs_greet.HasExt(c->ci) && greet != NULL && !greet->empty() && c->FindUser(c->ci->bi) && c->ci->AccessFor(user).HasPriv("GREET"))
|
if (bs_greet.HasExt(c->ci) && greet != NULL && !greet->empty() && c->FindUser(c->ci->bi) && c->ci->AccessFor(user).HasPriv("GREET"))
|
||||||
{
|
{
|
||||||
IRCD->SendPrivmsg(*c->ci->bi, c->name, "[%s] %s", user->Account()->display.c_str(), greet->c_str());
|
const auto message = Anope::printf("[%s] %s", user->Account()->display.c_str(), greet->c_str());
|
||||||
|
IRCD->SendPrivmsg(*c->ci->bi, c->name, message);
|
||||||
c->ci->bi->lastmsg = Anope::CurTime;
|
c->ci->bi->lastmsg = Anope::CurTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public:
|
|||||||
|
|
||||||
const NickAlias *na = NickAlias::Find(u->nick);
|
const NickAlias *na = NickAlias::Find(u->nick);
|
||||||
if (!na || na->nc != u->Account() || !na->HasVHost())
|
if (!na || na->nc != u->Account() || !na->HasVHost())
|
||||||
na = NickAlias::Find(u->Account()->display);
|
na = u->AccountNick();
|
||||||
if (!na || !na->HasVHost())
|
if (!na || !na->HasVHost())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public:
|
|||||||
|
|
||||||
const NickAlias *na = NickAlias::Find(u->nick);
|
const NickAlias *na = NickAlias::Find(u->nick);
|
||||||
if (!na || na->nc != u->Account() || !na->HasVHost())
|
if (!na || na->nc != u->Account() || !na->HasVHost())
|
||||||
na = NickAlias::Find(u->Account()->display);
|
na = u->AccountNick();
|
||||||
|
|
||||||
if (!na || !na->HasVHost())
|
if (!na || !na->HasVHost())
|
||||||
source.Reply(HOST_NOT_ASSIGNED);
|
source.Reply(HOST_NOT_ASSIGNED);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public:
|
|||||||
User *u = source.GetUser();
|
User *u = source.GetUser();
|
||||||
const NickAlias *na = NickAlias::Find(u->nick);
|
const NickAlias *na = NickAlias::Find(u->nick);
|
||||||
if (!na || na->nc != u->Account() || !na->HasVHost())
|
if (!na || na->nc != u->Account() || !na->HasVHost())
|
||||||
na = NickAlias::Find(u->Account()->display);
|
na = u->AccountNick();
|
||||||
if (na && u->Account() == na->nc && na->HasVHost())
|
if (na && u->Account() == na->nc && na->HasVHost())
|
||||||
{
|
{
|
||||||
source.Reply(_("Your vhost of \002%s\002 is now activated."), na->GetVHostMask().c_str());
|
source.Reply(_("Your vhost of \002%s\002 is now activated."), na->GetVHostMask().c_str());
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ struct HostRequestImpl final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["nick"] << this->nick;
|
data.Store("nick", this->nick);
|
||||||
data["ident"] << this->ident;
|
data.Store("ident", this->ident);
|
||||||
data["host"] << this->host;
|
data.Store("host", this->host);
|
||||||
data.SetType("time", Serialize::Data::DT_INT); data["time"] << this->time;
|
data.Store("time", this->time);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
+19
-20
@@ -117,7 +117,7 @@ void IRC2SQL::OnUserConnect(User *u, bool &exempt)
|
|||||||
this->RunQuery(query);
|
this->RunQuery(query);
|
||||||
|
|
||||||
if (ctcpuser && (Me->IsSynced() || ctcpeob) && u->server != Me)
|
if (ctcpuser && (Me->IsSynced() || ctcpeob) && u->server != Me)
|
||||||
IRCD->SendPrivmsg(StatServ, u->GetUID(), "\1VERSION\1");
|
IRCD->SendPrivmsg(StatServ, u->GetUID(), Anope::FormatCTCP("VERSION"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -299,28 +299,27 @@ void IRC2SQL::OnTopicUpdated(User *source, Channel *c, const Anope::string &user
|
|||||||
|
|
||||||
void IRC2SQL::OnBotNotice(User *u, BotInfo *bi, Anope::string &message, const Anope::map<Anope::string> &tags)
|
void IRC2SQL::OnBotNotice(User *u, BotInfo *bi, Anope::string &message, const Anope::map<Anope::string> &tags)
|
||||||
{
|
{
|
||||||
Anope::string versionstr;
|
|
||||||
if (bi != StatServ)
|
if (bi != StatServ)
|
||||||
return;
|
return;
|
||||||
if (message[0] == '\1' && message[message.length() - 1] == '\1')
|
|
||||||
{
|
|
||||||
if (message.substr(0, 9).equals_ci("\1VERSION "))
|
|
||||||
{
|
|
||||||
if (u->HasExt("CTCPVERSION"))
|
|
||||||
return;
|
|
||||||
u->Extend<bool>("CTCPVERSION");
|
|
||||||
|
|
||||||
versionstr = Anope::NormalizeBuffer(message.substr(9, message.length() - 10));
|
Anope::string ctcpname, ctcpbody;
|
||||||
if (versionstr.empty())
|
if (!Anope::ParseCTCP(message, ctcpname, ctcpbody) || ctcpname != "VERSION")
|
||||||
return;
|
return;
|
||||||
query = "UPDATE `" + prefix + "user` "
|
|
||||||
"SET version=@version@ "
|
if (u->HasExt("CTCPVERSION"))
|
||||||
"WHERE nick=@nick@";
|
return;
|
||||||
query.SetValue("version", versionstr);
|
|
||||||
query.SetValue("nick", u->nick);
|
u->Extend<bool>("CTCPVERSION");
|
||||||
this->RunQuery(query);
|
auto versionstr = Anope::NormalizeBuffer(message.substr(9, message.length() - 10));
|
||||||
}
|
if (versionstr.empty())
|
||||||
}
|
return;
|
||||||
|
|
||||||
|
query = "UPDATE `" + prefix + "user` "
|
||||||
|
"SET version=@version@ "
|
||||||
|
"WHERE nick=@nick@";
|
||||||
|
query.SetValue("version", versionstr);
|
||||||
|
query.SetValue("nick", u->nick);
|
||||||
|
this->RunQuery(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
MODULE_INIT(IRC2SQL)
|
MODULE_INIT(IRC2SQL)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class MemoServCore final
|
|||||||
static bool SendMemoMail(NickCore *nc, MemoInfo *mi, Memo *m)
|
static bool SendMemoMail(NickCore *nc, MemoInfo *mi, Memo *m)
|
||||||
{
|
{
|
||||||
Anope::string subject = Language::Translate(nc, Config->GetBlock("mail")->Get<const Anope::string>("memo_subject").c_str()),
|
Anope::string subject = Language::Translate(nc, Config->GetBlock("mail")->Get<const Anope::string>("memo_subject").c_str()),
|
||||||
message = Language::Translate(Config->GetBlock("mail")->Get<const Anope::string>("memo_message").c_str());
|
message = Language::Translate(nc, Config->GetBlock("mail")->Get<const Anope::string>("memo_message").c_str());
|
||||||
|
|
||||||
subject = subject.replace_all_cs("%n", nc->display);
|
subject = subject.replace_all_cs("%n", nc->display);
|
||||||
subject = subject.replace_all_cs("%s", m->sender);
|
subject = subject.replace_all_cs("%s", m->sender);
|
||||||
|
|||||||
@@ -536,6 +536,9 @@ public:
|
|||||||
if (nickserv_expire && Anope::CurTime - na->last_seen >= nickserv_expire)
|
if (nickserv_expire && Anope::CurTime - na->last_seen >= nickserv_expire)
|
||||||
expire = true;
|
expire = true;
|
||||||
|
|
||||||
|
if (na->nc->na == na && na->nc->aliases->size() > 1 && Config->GetModule("nickserv")->Get<bool>("preservedisplay"))
|
||||||
|
expire = false;
|
||||||
|
|
||||||
FOREACH_MOD(OnPreNickExpire, (na, expire));
|
FOREACH_MOD(OnPreNickExpire, (na, expire));
|
||||||
|
|
||||||
if (expire)
|
if (expire)
|
||||||
|
|||||||
@@ -40,14 +40,14 @@ struct AJoinEntry final
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Serialize(Serialize::Data &sd) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
if (!this->owner)
|
if (!this->owner)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
sd["owner"] << this->owner->display;
|
data.Store("owner", this->owner->display);
|
||||||
sd["channel"] << this->channel;
|
data.Store("channel", this->channel);
|
||||||
sd["key"] << this->key;
|
data.Store("key", this->key);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &sd)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &sd)
|
||||||
|
|||||||
@@ -168,8 +168,10 @@ public:
|
|||||||
if (c == NULL || !c->GetCertCount())
|
if (c == NULL || !c->GetCertCount())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
std::ostringstream oss;
|
||||||
for (unsigned i = 0; i < c->GetCertCount(); ++i)
|
for (unsigned i = 0; i < c->GetCertCount(); ++i)
|
||||||
data["cert"] << c->GetCert(i) << " ";
|
oss << c->GetCert(i) << " ";
|
||||||
|
data.Store("cert", oss.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
||||||
@@ -418,7 +420,7 @@ public:
|
|||||||
|
|
||||||
void OnNickRegister(User *u, NickAlias *na, const Anope::string &pass) override
|
void OnNickRegister(User *u, NickAlias *na, const Anope::string &pass) override
|
||||||
{
|
{
|
||||||
if (!Config->GetModule(this)->Get<bool>("automatic", "yes") || u->fingerprint.empty())
|
if (!Config->GetModule(this)->Get<bool>("automatic", "yes") || !u || u->fingerprint.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto *cl = certs.Require(na->nc);
|
auto *cl = certs.Require(na->nc);
|
||||||
|
|||||||
@@ -57,6 +57,12 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (na->nc->na == na && na->nc->aliases->size() > 1 && Config->GetModule("nickserv")->Get<bool>("preservedisplay") && !source.HasPriv("nickserv/drop/display"))
|
||||||
|
{
|
||||||
|
source.Reply(_("You may not drop \002%s\002 as it is the display nick for the account."), na->nick.c_str());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto *code = dropcode.Get(na);
|
auto *code = dropcode.Get(na);
|
||||||
if (params.size() < 2 || ((!code || !code->equals_ci(params[1])) && (!source.HasPriv("nickserv/drop/override") || params[1] != "OVERRIDE")))
|
if (params.size() < 2 || ((!code || !code->equals_ci(params[1])) && (!source.HasPriv("nickserv/drop/override") || params[1] != "OVERRIDE")))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,11 +15,12 @@
|
|||||||
|
|
||||||
#include "module.h"
|
#include "module.h"
|
||||||
|
|
||||||
class CommandNSGetEMail final
|
class CommandNSGetEmail final
|
||||||
: public Command
|
: public Command
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CommandNSGetEMail(Module *creator) : Command(creator, "nickserv/getemail", 1, 1)
|
CommandNSGetEmail(Module *creator)
|
||||||
|
: Command(creator, "nickserv/getemail", 1, 1)
|
||||||
{
|
{
|
||||||
this->SetDesc(_("Matches and returns all users that registered using given email"));
|
this->SetDesc(_("Matches and returns all users that registered using given email"));
|
||||||
this->SetSyntax(_("\037email\037"));
|
this->SetSyntax(_("\037email\037"));
|
||||||
@@ -59,16 +60,19 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class NSGetEMail final
|
class NSGetEmail final
|
||||||
: public Module
|
: public Module
|
||||||
{
|
{
|
||||||
CommandNSGetEMail commandnsgetemail;
|
private:
|
||||||
|
CommandNSGetEmail commandnsgetemail;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
NSGetEMail(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
|
NSGetEmail(const Anope::string &modname, const Anope::string &creator)
|
||||||
commandnsgetemail(this)
|
: Module(modname, creator, VENDOR)
|
||||||
|
, commandnsgetemail(this)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
MODULE_INIT(NSGetEMail)
|
MODULE_INIT(NSGetEmail)
|
||||||
|
|||||||
@@ -24,8 +24,35 @@ public:
|
|||||||
|
|
||||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override
|
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override
|
||||||
{
|
{
|
||||||
|
Anope::string nick;
|
||||||
|
if (params.empty())
|
||||||
|
{
|
||||||
|
// Use the display of the source if logged in; otherwise, use their nick.
|
||||||
|
nick = source.nc ? source.nc->na->nick : source.GetNick();
|
||||||
|
}
|
||||||
|
else if (params[0][0] == '=' && params[0].length() > 1)
|
||||||
|
{
|
||||||
|
// Look up the account of the specified user.
|
||||||
|
nick = params[0].substr(1);
|
||||||
|
auto *u = User::Find(nick);
|
||||||
|
if (!u)
|
||||||
|
{
|
||||||
|
source.Reply(NICK_X_NOT_IN_USE, nick.c_str());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!u->AccountNick())
|
||||||
|
{
|
||||||
|
source.Reply(_("User \002%s\002 isn't currently logged in to an account."), nick.c_str());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
nick = u->AccountNick()->nick;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Just use the nick the user specified.
|
||||||
|
nick = params[0];
|
||||||
|
}
|
||||||
|
|
||||||
const Anope::string &nick = params.size() ? params[0] : (source.nc ? source.nc->display : source.GetNick());
|
|
||||||
NickAlias *na = NickAlias::Find(nick);
|
NickAlias *na = NickAlias::Find(nick);
|
||||||
bool has_auspex = source.HasPriv("nickserv/auspex");
|
bool has_auspex = source.HasPriv("nickserv/auspex");
|
||||||
|
|
||||||
@@ -62,6 +89,7 @@ public:
|
|||||||
InfoFormatter info(source.nc);
|
InfoFormatter info(source.nc);
|
||||||
|
|
||||||
info[_("Account")] = na->nc->display;
|
info[_("Account")] = na->nc->display;
|
||||||
|
info[_("Account id")] = Anope::ToString(na->nc->GetId());
|
||||||
if (nick_online)
|
if (nick_online)
|
||||||
{
|
{
|
||||||
bool shown = false;
|
bool shown = false;
|
||||||
|
|||||||
@@ -401,7 +401,7 @@ public:
|
|||||||
u->SendMessage(NickServ, _("All new accounts must be validated by an administrator. Please wait for your registration to be confirmed."));
|
u->SendMessage(NickServ, _("All new accounts must be validated by an administrator. Please wait for your registration to be confirmed."));
|
||||||
else
|
else
|
||||||
u->SendMessage(NickServ, _("Your email address is not confirmed. To confirm it, follow the instructions that were emailed to you."));
|
u->SendMessage(NickServ, _("Your email address is not confirmed. To confirm it, follow the instructions that were emailed to you."));
|
||||||
const NickAlias *this_na = NickAlias::Find(u->Account()->display);
|
const NickAlias *this_na = u->AccountNick();
|
||||||
time_t time_registered = Anope::CurTime - this_na->time_registered;
|
time_t time_registered = Anope::CurTime - this_na->time_registered;
|
||||||
time_t unconfirmed_expire = Config->GetModule(this)->Get<time_t>("unconfirmedexpire", "1d");
|
time_t unconfirmed_expire = Config->GetModule(this)->Get<time_t>("unconfirmedexpire", "1d");
|
||||||
if (unconfirmed_expire > time_registered)
|
if (unconfirmed_expire > time_registered)
|
||||||
|
|||||||
+1
-119
@@ -892,120 +892,6 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class CommandNSSetLanguage
|
|
||||||
: public Command
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
CommandNSSetLanguage(Module *creator, const Anope::string &sname = "nickserv/set/language", size_t min = 1) : Command(creator, sname, min, min + 1)
|
|
||||||
{
|
|
||||||
this->SetDesc(_("Set the language services will use when messaging you"));
|
|
||||||
this->SetSyntax(_("\037language\037"));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Run(CommandSource &source, const Anope::string &user, const Anope::string ¶m)
|
|
||||||
{
|
|
||||||
if (Anope::ReadOnly)
|
|
||||||
{
|
|
||||||
source.Reply(READ_ONLY_MODE);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const NickAlias *na = NickAlias::Find(user);
|
|
||||||
if (!na)
|
|
||||||
{
|
|
||||||
source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
NickCore *nc = na->nc;
|
|
||||||
|
|
||||||
EventReturn MOD_RESULT;
|
|
||||||
FOREACH_RESULT(OnSetNickOption, MOD_RESULT, (source, this, nc, param));
|
|
||||||
if (MOD_RESULT == EVENT_STOP)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (param != "en_US")
|
|
||||||
for (unsigned j = 0; j < Language::Languages.size(); ++j)
|
|
||||||
{
|
|
||||||
if (Language::Languages[j] == param)
|
|
||||||
break;
|
|
||||||
else if (j + 1 == Language::Languages.size())
|
|
||||||
{
|
|
||||||
this->OnSyntaxError(source, "");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to change the language of " << nc->display << " to " << param;
|
|
||||||
|
|
||||||
nc->language = param;
|
|
||||||
if (source.GetAccount() == nc)
|
|
||||||
source.Reply(_("Language changed to \002English\002."));
|
|
||||||
else
|
|
||||||
source.Reply(_("Language for \002%s\002 changed to \002%s\002."), nc->display.c_str(), Language::Translate(param.c_str(), _("English")));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶m) override
|
|
||||||
{
|
|
||||||
this->Run(source, source.nc->display, param[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OnHelp(CommandSource &source, const Anope::string &) override
|
|
||||||
{
|
|
||||||
this->SendSyntax(source);
|
|
||||||
source.Reply(" ");
|
|
||||||
source.Reply(_("Changes the language services uses when sending messages to\n"
|
|
||||||
"you (for example, when responding to a command you send).\n"
|
|
||||||
"\037language\037 should be chosen from the following list of\n"
|
|
||||||
"supported languages:"));
|
|
||||||
|
|
||||||
source.Reply(" en_US (English)");
|
|
||||||
for (const auto &language : Language::Languages)
|
|
||||||
{
|
|
||||||
const Anope::string &langname = Language::Translate(language.c_str(), _("English"));
|
|
||||||
if (langname == "English")
|
|
||||||
continue;
|
|
||||||
source.Reply(" %s (%s)", language.c_str(), langname.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class CommandNSSASetLanguage final
|
|
||||||
: public CommandNSSetLanguage
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
CommandNSSASetLanguage(Module *creator) : CommandNSSetLanguage(creator, "nickserv/saset/language", 2)
|
|
||||||
{
|
|
||||||
this->ClearSyntax();
|
|
||||||
this->SetSyntax(_("\037nickname\037 \037language\037"));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override
|
|
||||||
{
|
|
||||||
this->Run(source, params[0], params[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OnHelp(CommandSource &source, const Anope::string &) override
|
|
||||||
{
|
|
||||||
this->SendSyntax(source);
|
|
||||||
source.Reply(" ");
|
|
||||||
source.Reply(_("Changes the language services uses when sending messages to\n"
|
|
||||||
"the given user (for example, when responding to a command they send).\n"
|
|
||||||
"\037language\037 should be chosen from the following list of\n"
|
|
||||||
"supported languages:"));
|
|
||||||
source.Reply(" en (English)");
|
|
||||||
for (const auto &language : Language::Languages)
|
|
||||||
{
|
|
||||||
const Anope::string &langname = Language::Translate(language.c_str(), _("English"));
|
|
||||||
if (langname == "English")
|
|
||||||
continue;
|
|
||||||
source.Reply(" %s (%s)", language.c_str(), langname.c_str());
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class CommandNSSetMessage
|
class CommandNSSetMessage
|
||||||
: public Command
|
: public Command
|
||||||
{
|
{
|
||||||
@@ -1189,9 +1075,6 @@ class NSSet final
|
|||||||
CommandNSSetKill commandnssetkill;
|
CommandNSSetKill commandnssetkill;
|
||||||
CommandNSSASetKill commandnssasetkill;
|
CommandNSSASetKill commandnssasetkill;
|
||||||
|
|
||||||
CommandNSSetLanguage commandnssetlanguage;
|
|
||||||
CommandNSSASetLanguage commandnssasetlanguage;
|
|
||||||
|
|
||||||
CommandNSSetMessage commandnssetmessage;
|
CommandNSSetMessage commandnssetmessage;
|
||||||
CommandNSSASetMessage commandnssasetmessage;
|
CommandNSSASetMessage commandnssasetmessage;
|
||||||
|
|
||||||
@@ -1225,7 +1108,7 @@ class NSSet final
|
|||||||
if (!last_value.empty())
|
if (!last_value.empty())
|
||||||
modes += "," + last_value;
|
modes += "," + last_value;
|
||||||
}
|
}
|
||||||
data["last_modes"] << modes;
|
data.Store("last_modes", modes);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
void ExtensibleUnserialize(Extensible *e, Serializable *s, Serialize::Data &data) override
|
||||||
@@ -1262,7 +1145,6 @@ public:
|
|||||||
commandnssetemail(this), commandnssasetemail(this),
|
commandnssetemail(this), commandnssasetemail(this),
|
||||||
commandnssetkeepmodes(this), commandnssasetkeepmodes(this),
|
commandnssetkeepmodes(this), commandnssasetkeepmodes(this),
|
||||||
commandnssetkill(this), commandnssasetkill(this),
|
commandnssetkill(this), commandnssasetkill(this),
|
||||||
commandnssetlanguage(this), commandnssasetlanguage(this),
|
|
||||||
commandnssetmessage(this), commandnssasetmessage(this),
|
commandnssetmessage(this), commandnssasetmessage(this),
|
||||||
commandnssetpassword(this), commandnssasetpassword(this),
|
commandnssetpassword(this), commandnssasetpassword(this),
|
||||||
commandnssasetnoexpire(this),
|
commandnssasetnoexpire(this),
|
||||||
|
|||||||
@@ -0,0 +1,149 @@
|
|||||||
|
/* NickServ core functions
|
||||||
|
*
|
||||||
|
* (C) 2003-2024 Anope Team
|
||||||
|
* Contact us at team@anope.org
|
||||||
|
*
|
||||||
|
* Please read COPYING and README for further details.
|
||||||
|
*
|
||||||
|
* Based on the original code of Epona by Lara.
|
||||||
|
* Based on the original code of Services by Andy Church.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "module.h"
|
||||||
|
|
||||||
|
class CommandNSSetLanguage
|
||||||
|
: public Command
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CommandNSSetLanguage(Module *creator, const Anope::string &sname = "nickserv/set/language", size_t min = 1)
|
||||||
|
: Command(creator, sname, min, min + 1)
|
||||||
|
{
|
||||||
|
this->SetDesc(_("Set the language services will use when messaging you"));
|
||||||
|
this->SetSyntax(_("\037language\037"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Run(CommandSource &source, const Anope::string &user, const Anope::string ¶m)
|
||||||
|
{
|
||||||
|
if (Anope::ReadOnly)
|
||||||
|
{
|
||||||
|
source.Reply(READ_ONLY_MODE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const NickAlias *na = NickAlias::Find(user);
|
||||||
|
if (!na)
|
||||||
|
{
|
||||||
|
source.Reply(NICK_X_NOT_REGISTERED, user.c_str());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
NickCore *nc = na->nc;
|
||||||
|
|
||||||
|
EventReturn MOD_RESULT;
|
||||||
|
FOREACH_RESULT(OnSetNickOption, MOD_RESULT, (source, this, nc, param));
|
||||||
|
if (MOD_RESULT == EVENT_STOP)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (param != "en_US")
|
||||||
|
{
|
||||||
|
for (unsigned j = 0; j < Language::Languages.size(); ++j)
|
||||||
|
{
|
||||||
|
if (Language::Languages[j] == param)
|
||||||
|
break;
|
||||||
|
else if (j + 1 == Language::Languages.size())
|
||||||
|
{
|
||||||
|
this->OnSyntaxError(source, "");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to change the language of " << nc->display << " to " << param;
|
||||||
|
|
||||||
|
nc->language = param;
|
||||||
|
if (source.GetAccount() == nc)
|
||||||
|
source.Reply(_("Language changed to \002English\002."));
|
||||||
|
else
|
||||||
|
source.Reply(_("Language for \002%s\002 changed to \002%s\002."), nc->display.c_str(), Language::Translate(param.c_str(), _("English")));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Execute(CommandSource &source, const std::vector<Anope::string> ¶m) override
|
||||||
|
{
|
||||||
|
this->Run(source, source.nc->display, param[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool OnHelp(CommandSource &source, const Anope::string &) override
|
||||||
|
{
|
||||||
|
this->SendSyntax(source);
|
||||||
|
source.Reply(" ");
|
||||||
|
source.Reply(_("Changes the language services uses when sending messages to\n"
|
||||||
|
"you (for example, when responding to a command you send).\n"
|
||||||
|
"\037language\037 should be chosen from the following list of\n"
|
||||||
|
"supported languages:"));
|
||||||
|
|
||||||
|
source.Reply(" en_US (English)");
|
||||||
|
for (const auto &language : Language::Languages)
|
||||||
|
{
|
||||||
|
const Anope::string &langname = Language::Translate(language.c_str(), _("English"));
|
||||||
|
if (langname != "English")
|
||||||
|
source.Reply(" %s (%s)", language.c_str(), langname.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class CommandNSSASetLanguage final
|
||||||
|
: public CommandNSSetLanguage
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CommandNSSASetLanguage(Module *creator)
|
||||||
|
: CommandNSSetLanguage(creator, "nickserv/saset/language", 2)
|
||||||
|
{
|
||||||
|
this->ClearSyntax();
|
||||||
|
this->SetSyntax(_("\037nickname\037 \037language\037"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override
|
||||||
|
{
|
||||||
|
this->Run(source, params[0], params[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool OnHelp(CommandSource &source, const Anope::string &) override
|
||||||
|
{
|
||||||
|
this->SendSyntax(source);
|
||||||
|
source.Reply(" ");
|
||||||
|
source.Reply(_("Changes the language services uses when sending messages to\n"
|
||||||
|
"the given user (for example, when responding to a command they send).\n"
|
||||||
|
"\037language\037 should be chosen from the following list of\n"
|
||||||
|
"supported languages:"));
|
||||||
|
source.Reply(" en_US (English)");
|
||||||
|
for (const auto &language : Language::Languages)
|
||||||
|
{
|
||||||
|
const Anope::string &langname = Language::Translate(language.c_str(), _("English"));
|
||||||
|
if (langname != "English")
|
||||||
|
source.Reply(" %s (%s)", language.c_str(), langname.c_str());
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class NSSetLanguage final
|
||||||
|
: public Module
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
CommandNSSetLanguage commandnssetlanguage;
|
||||||
|
CommandNSSASetLanguage commandnssasetlanguage;
|
||||||
|
|
||||||
|
public:
|
||||||
|
NSSetLanguage(const Anope::string &modname, const Anope::string &creator)
|
||||||
|
: Module(modname, creator, VENDOR)
|
||||||
|
, commandnssetlanguage(this)
|
||||||
|
, commandnssasetlanguage(this)
|
||||||
|
{
|
||||||
|
#ifndef HAVE_LOCALIZATION
|
||||||
|
throw ModuleException("Anope was not built with localization support");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
MODULE_INIT(NSSetLanguage)
|
||||||
@@ -46,9 +46,9 @@ struct NSMiscData final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &sdata) const override
|
void Serialize(Serialize::Data &sdata) const override
|
||||||
{
|
{
|
||||||
sdata["nc"] << this->object;
|
sdata.Store("nc", this->object);
|
||||||
sdata["name"] << this->name;
|
sdata.Store("name", this->name);
|
||||||
sdata["data"] << this->data;
|
sdata.Store("data", this->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ struct NSSuspendInfo final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["nick"] << what;
|
data.Store("nick", what);
|
||||||
data["by"] << by;
|
data.Store("by", by);
|
||||||
data["reason"] << reason;
|
data.Store("reason", reason);
|
||||||
data["time"] << when;
|
data.Store("time", when);
|
||||||
data["expires"] << expires;
|
data.Store("expires", expires);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
@@ -128,6 +128,8 @@ public:
|
|||||||
User *u2 = User::Find(na2->nick, true);
|
User *u2 = User::Find(na2->nick, true);
|
||||||
if (u2)
|
if (u2)
|
||||||
{
|
{
|
||||||
|
IRCD->SendLogout(u2);
|
||||||
|
u2->RemoveMode(source.service, "REGISTERED");
|
||||||
u2->Logout();
|
u2->Logout();
|
||||||
if (nickserv)
|
if (nickserv)
|
||||||
nickserv->Collide(u2, na2);
|
nickserv->Collide(u2, na2);
|
||||||
|
|||||||
@@ -188,7 +188,10 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!akills->CanAdd(source, mask, expires, reason))
|
if (!akills->CanAdd(source, mask, expires, reason))
|
||||||
|
{
|
||||||
|
delete x;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
EventReturn MOD_RESULT;
|
EventReturn MOD_RESULT;
|
||||||
FOREACH_RESULT(OnAddXLine, MOD_RESULT, (source, x, akills));
|
FOREACH_RESULT(OnAddXLine, MOD_RESULT, (source, x, akills));
|
||||||
|
|||||||
@@ -39,10 +39,10 @@ struct DNSZone final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["name"] << name;
|
data.Store("name", name);
|
||||||
unsigned count = 0;
|
unsigned count = 0;
|
||||||
for (const auto &server : servers)
|
for (const auto &server : servers)
|
||||||
data["server" + Anope::ToString(count++)] << server;
|
data.Store("server" + Anope::ToString(count++), server);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
@@ -144,14 +144,14 @@ public:
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["server_name"] << server_name;
|
data.Store("server_name", server_name);
|
||||||
for (unsigned i = 0; i < ips.size(); ++i)
|
for (unsigned i = 0; i < ips.size(); ++i)
|
||||||
data["ip" + Anope::ToString(i)] << ips[i];
|
data.Store("ip" + Anope::ToString(i), ips[i]);
|
||||||
data["limit"] << limit;
|
data.Store("limit", limit);
|
||||||
data["pooled"] << pooled;
|
data.Store("pooled", pooled);
|
||||||
unsigned count = 0;
|
unsigned count = 0;
|
||||||
for (const auto &zone : zones)
|
for (const auto &zone : zones)
|
||||||
data["zone" + Anope::ToString(count++)] << zone;
|
data.Store("zone" + Anope::ToString(count++), zone);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -25,12 +25,12 @@ struct ForbidDataImpl final
|
|||||||
|
|
||||||
void ForbidDataImpl::Serialize(Serialize::Data &data) const
|
void ForbidDataImpl::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["mask"] << this->mask;
|
data.Store("mask", this->mask);
|
||||||
data["creator"] << this->creator;
|
data.Store("creator", this->creator);
|
||||||
data["reason"] << this->reason;
|
data.Store("reason", this->reason);
|
||||||
data["created"] << this->created;
|
data.Store("created", this->created);
|
||||||
data["expires"] << this->expires;
|
data.Store("expires", this->expires);
|
||||||
data["type"] << this->type;
|
data.Store("type", this->type);
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable *ForbidDataImpl::Unserialize(Serializable *obj, Serialize::Data &data)
|
Serializable *ForbidDataImpl::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
@@ -532,7 +532,7 @@ public:
|
|||||||
|
|
||||||
EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) override
|
EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) override
|
||||||
{
|
{
|
||||||
if (command->name == "nickserv/info" && params.size() > 0)
|
if (command->name == "nickserv/info" && !params.empty() && params[0][0] != '=')
|
||||||
{
|
{
|
||||||
ForbidData *d = this->forbidService.FindForbid(params[0], FT_NICK);
|
ForbidData *d = this->forbidService.FindForbid(params[0], FT_NICK);
|
||||||
if (d != NULL)
|
if (d != NULL)
|
||||||
|
|||||||
@@ -30,10 +30,10 @@ IgnoreDataImpl::~IgnoreDataImpl()
|
|||||||
|
|
||||||
void IgnoreDataImpl::Serialize(Serialize::Data &data) const
|
void IgnoreDataImpl::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["mask"] << this->mask;
|
data.Store("mask", this->mask);
|
||||||
data["creator"] << this->creator;
|
data.Store("creator", this->creator);
|
||||||
data["reason"] << this->reason;
|
data.Store("reason", this->reason);
|
||||||
data["time"] << this->time;
|
data.Store("time", this->time);
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable *IgnoreDataImpl::Unserialize(Serializable *obj, Serialize::Data &data)
|
Serializable *IgnoreDataImpl::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -28,10 +28,10 @@ struct OperInfoImpl final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["target"] << target;
|
data.Store("target", target);
|
||||||
data["info"] << info;
|
data.Store("info", info);
|
||||||
data["adder"] << adder;
|
data.Store("adder", adder);
|
||||||
data["created"] << created;
|
data.Store("created", created);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data);
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data);
|
||||||
|
|||||||
@@ -69,10 +69,10 @@ struct MyNewsItem final
|
|||||||
{
|
{
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["type"] << this->type;
|
data.Store("type", this->type);
|
||||||
data["text"] << this->text;
|
data.Store("text", this->text);
|
||||||
data["who"] << this->who;
|
data.Store("who", this->who);
|
||||||
data["time"] << this->time;
|
data.Store("time", this->time);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -10,43 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "module.h"
|
#include "module.h"
|
||||||
|
#include "modules/os_oper.h"
|
||||||
struct MyOper final
|
|
||||||
: Oper
|
|
||||||
, Serializable
|
|
||||||
{
|
|
||||||
MyOper(const Anope::string &n, OperType *o) : Oper(n, o), Serializable("Oper") { }
|
|
||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
|
||||||
{
|
|
||||||
data["name"] << this->name;
|
|
||||||
data["type"] << this->ot->GetName();
|
|
||||||
}
|
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
|
||||||
{
|
|
||||||
Anope::string stype, sname;
|
|
||||||
|
|
||||||
data["type"] >> stype;
|
|
||||||
data["name"] >> sname;
|
|
||||||
|
|
||||||
OperType *ot = OperType::Find(stype);
|
|
||||||
if (ot == NULL)
|
|
||||||
return NULL;
|
|
||||||
NickCore *nc = NickCore::Find(sname);
|
|
||||||
if (nc == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
MyOper *myo;
|
|
||||||
if (obj)
|
|
||||||
myo = anope_dynamic_static_cast<MyOper *>(obj);
|
|
||||||
else
|
|
||||||
myo = new MyOper(nc->display, ot);
|
|
||||||
nc->o = myo;
|
|
||||||
Log(LOG_NORMAL, "operserv/oper") << "Tied oper " << nc->display << " to type " << ot->GetName();
|
|
||||||
return myo;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class CommandOSOper final
|
class CommandOSOper final
|
||||||
: public Command
|
: public Command
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ struct Stats final
|
|||||||
|
|
||||||
void Serialize(Serialize::Data &data) const override
|
void Serialize(Serialize::Data &data) const override
|
||||||
{
|
{
|
||||||
data["maxusercnt"] << MaxUserCount;
|
data.Store("maxusercnt", MaxUserCount);
|
||||||
data["maxusertime"] << MaxUserTime;
|
data.Store("maxusertime", MaxUserTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
static Serializable *Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
@@ -389,7 +389,10 @@ class CommandOSSNLine final
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this->xlm()->CanAdd(source, mask, expires, reason))
|
if (!this->xlm()->CanAdd(source, mask, expires, reason))
|
||||||
|
{
|
||||||
|
delete x;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
EventReturn MOD_RESULT;
|
EventReturn MOD_RESULT;
|
||||||
FOREACH_RESULT(OnAddXLine, MOD_RESULT, (source, x, this->xlm()));
|
FOREACH_RESULT(OnAddXLine, MOD_RESULT, (source, x, this->xlm()));
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ public:
|
|||||||
Uplink::Send("SVSNICK", u->GetUID(), u->timestamp, newnick, when);
|
Uplink::Send("SVSNICK", u->GetUID(), u->timestamp, newnick, when);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &) override
|
void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &key) override
|
||||||
{
|
{
|
||||||
Uplink::Send(source, "SVSJOIN", u->GetUID(), chan);
|
Uplink::Send(source, "SVSJOIN", u->GetUID(), chan);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,22 @@ namespace
|
|||||||
// The version of the InspIRCd protocol that we are using.
|
// The version of the InspIRCd protocol that we are using.
|
||||||
size_t spanningtree_proto_ver = 1205;
|
size_t spanningtree_proto_ver = 1205;
|
||||||
|
|
||||||
|
bool IsExtBan(const Anope::string &str, bool &inverted, Anope::string &name, Anope::string &value)
|
||||||
|
{
|
||||||
|
auto startpos = 0;
|
||||||
|
if (!str.empty() && str[0] == '!')
|
||||||
|
startpos++;
|
||||||
|
|
||||||
|
auto endpos = str.find_first_not_of("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", startpos);
|
||||||
|
if (endpos == Anope::string::npos || str[endpos] != ':' || endpos+1 == str.length())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
inverted = !!startpos;
|
||||||
|
name = str.substr(startpos, endpos - startpos);
|
||||||
|
value = str.substr(endpos + 1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Parses a module name in the format "m_foo.so=bar" to {foo, bar}.
|
// Parses a module name in the format "m_foo.so=bar" to {foo, bar}.
|
||||||
void ParseModule(const Anope::string &module, Anope::string &modname, Anope::string &moddata)
|
void ParseModule(const Anope::string &module, Anope::string &modname, Anope::string &moddata)
|
||||||
{
|
{
|
||||||
@@ -207,7 +223,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (spanningtree_proto_ver >= 1206)
|
if (spanningtree_proto_ver >= 1206)
|
||||||
{
|
{
|
||||||
IRCD->SendNoticeInternal(bi, target->GetUID(), msg, {
|
IRCD->SendNotice(bi, target->GetUID(), msg, {
|
||||||
{ "~context", context->name },
|
{ "~context", context->name },
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@@ -219,7 +235,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (spanningtree_proto_ver >= 1206)
|
if (spanningtree_proto_ver >= 1206)
|
||||||
{
|
{
|
||||||
IRCD->SendPrivmsgInternal(bi, target->GetUID(), msg, {
|
IRCD->SendPrivmsg(bi, target->GetUID(), msg, {
|
||||||
{ "~context", context->name },
|
{ "~context", context->name },
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@@ -509,9 +525,12 @@ public:
|
|||||||
SendAddLine("Z", x->GetHost(), timeleft, x->by, x->GetReason());
|
SendAddLine("Z", x->GetHost(), timeleft, x->by, x->GetReason());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &other) override
|
void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &key) override
|
||||||
{
|
{
|
||||||
Uplink::Send(source, "SVSJOIN", u->GetUID(), chan);
|
if (key.empty())
|
||||||
|
Uplink::Send(source, "SVSJOIN", u->GetUID(), chan);
|
||||||
|
else
|
||||||
|
Uplink::Send(source, "SVSJOIN", u->GetUID(), chan, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) override
|
void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string ¶m) override
|
||||||
@@ -562,8 +581,11 @@ public:
|
|||||||
void SendLogin(User *u, NickAlias *na) override
|
void SendLogin(User *u, NickAlias *na) override
|
||||||
{
|
{
|
||||||
/* InspIRCd uses an account to bypass chmode +R, not umode +r, so we can't send this here */
|
/* InspIRCd uses an account to bypass chmode +R, not umode +r, so we can't send this here */
|
||||||
if (!na->nc->HasExt("UNCONFIRMED"))
|
if (na->nc->HasExt("UNCONFIRMED"))
|
||||||
SendAccount(u->GetUID(), na);
|
return;
|
||||||
|
|
||||||
|
IRCD->SendVHost(u, na->GetVHostIdent(), na->GetVHostHost());
|
||||||
|
SendAccount(u->GetUID(), na);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendLogout(User *u) override
|
void SendLogout(User *u) override
|
||||||
@@ -617,7 +639,9 @@ public:
|
|||||||
|
|
||||||
bool IsExtbanValid(const Anope::string &mask) override
|
bool IsExtbanValid(const Anope::string &mask) override
|
||||||
{
|
{
|
||||||
return mask.length() >= 3 && mask[1] == ':';
|
bool inverted;
|
||||||
|
Anope::string name, value;
|
||||||
|
return IsExtBan(mask, inverted, name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsIdentValid(const Anope::string &ident) override
|
bool IsIdentValid(const Anope::string &ident) override
|
||||||
@@ -698,19 +722,15 @@ namespace InspIRCdExtBan
|
|||||||
if (cm->type != MODE_LIST)
|
if (cm->type != MODE_LIST)
|
||||||
return cm;
|
return cm;
|
||||||
|
|
||||||
auto startpos = 0;
|
bool inverted;
|
||||||
if (param[0] == '!')
|
Anope::string name, value;
|
||||||
startpos++;
|
if (!IsExtBan(param, inverted, name, value))
|
||||||
|
|
||||||
auto endpos = param.find_first_not_of("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", startpos);
|
|
||||||
if (endpos == Anope::string::npos || param[endpos] != ':')
|
|
||||||
return cm;
|
return cm;
|
||||||
|
|
||||||
auto name = param.substr(startpos, endpos - startpos);
|
if (name.length() == 1 ? name[0] != xbchar : name != xbname)
|
||||||
if (param.length() >= endpos || (name.length() == 1 ? name[0] != xbchar : name != xbname))
|
|
||||||
return cm;
|
return cm;
|
||||||
|
|
||||||
param.erase(0, endpos);
|
param = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1147,6 +1167,7 @@ struct IRCDMessageCapab final
|
|||||||
IRCD->CanClearBans = false;
|
IRCD->CanClearBans = false;
|
||||||
IRCD->CanSQLineChannel = false;
|
IRCD->CanSQLineChannel = false;
|
||||||
IRCD->CanSVSHold = false;
|
IRCD->CanSVSHold = false;
|
||||||
|
IRCD->CanTagMessage = false;
|
||||||
IRCD->DefaultPseudoclientModes = "+oI";
|
IRCD->DefaultPseudoclientModes = "+oI";
|
||||||
}
|
}
|
||||||
else if (params[0].equals_cs("CHANMODES") && params.size() > 1)
|
else if (params[0].equals_cs("CHANMODES") && params.size() > 1)
|
||||||
@@ -1523,6 +1544,9 @@ struct IRCDMessageCapab final
|
|||||||
|
|
||||||
else if (modname.equals_cs("chgident"))
|
else if (modname.equals_cs("chgident"))
|
||||||
Servers::Capab.insert("CHGIDENT");
|
Servers::Capab.insert("CHGIDENT");
|
||||||
|
|
||||||
|
else if (modname.equals_cs("ircv3_ctctags"))
|
||||||
|
IRCD->CanTagMessage = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto &anoperegex = Config->GetBlock("options")->Get<const Anope::string>("regexengine");
|
const auto &anoperegex = Config->GetBlock("options")->Get<const Anope::string>("regexengine");
|
||||||
@@ -1583,6 +1607,9 @@ struct IRCDMessageCapab final
|
|||||||
if (!IRCD->CanSQLineChannel)
|
if (!IRCD->CanSQLineChannel)
|
||||||
Log() << "The remote server does not have the cban module; services will manually enforce forbidden channels until the module is loaded.";
|
Log() << "The remote server does not have the cban module; services will manually enforce forbidden channels until the module is loaded.";
|
||||||
|
|
||||||
|
if (!IRCD->CanTagMessage)
|
||||||
|
Log() << "The remote server does not have the ircv3_ctctags module; sending tag messages is disabled until the module is loaded.";
|
||||||
|
|
||||||
if (!Servers::Capab.count("CHGHOST"))
|
if (!Servers::Capab.count("CHGHOST"))
|
||||||
Log() << "The remote server does not have the chghost module; vhosts are disabled until the module is loaded.";
|
Log() << "The remote server does not have the chghost module; vhosts are disabled until the module is loaded.";
|
||||||
|
|
||||||
@@ -1954,6 +1981,9 @@ public:
|
|||||||
else if (modname.equals_cs("hidechans"))
|
else if (modname.equals_cs("hidechans"))
|
||||||
required = true;
|
required = true;
|
||||||
|
|
||||||
|
else if (modname.equals_cs("ircv3_ctctags"))
|
||||||
|
IRCD->CanTagMessage = plus;
|
||||||
|
|
||||||
else if (modname.equals_cs("rline"))
|
else if (modname.equals_cs("rline"))
|
||||||
capab = "RLINE";
|
capab = "RLINE";
|
||||||
|
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ public:
|
|||||||
Uplink::Send(source, "ENCAP", '*', "TOPIC", c->name, c->topic_setter, c->topic_ts, c->topic);
|
Uplink::Send(source, "ENCAP", '*', "TOPIC", c->name, c->topic_setter, c->topic_ts, c->topic);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSVSJoin(const MessageSource &source, User *user, const Anope::string &chan, const Anope::string ¶m) override
|
void SendSVSJoin(const MessageSource &source, User *user, const Anope::string &chan, const Anope::string &key) override
|
||||||
{
|
{
|
||||||
Uplink::Send(source, "ENCAP", '*', "SVSJOIN", user->GetUID(), chan);
|
Uplink::Send(source, "ENCAP", '*', "SVSJOIN", user->GetUID(), chan);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ public:
|
|||||||
CanSVSHold = true;
|
CanSVSHold = true;
|
||||||
CanClearBans = true;
|
CanClearBans = true;
|
||||||
CanCertFP = true;
|
CanCertFP = true;
|
||||||
|
CanTagMessage = true;
|
||||||
RequiresID = true;
|
RequiresID = true;
|
||||||
MaxModes = 12;
|
MaxModes = 12;
|
||||||
}
|
}
|
||||||
@@ -298,12 +299,12 @@ private:
|
|||||||
/* In older Unreal SVSJOIN and SVSNLINE tokens were mixed so SVSJOIN and SVSNLINE are broken
|
/* In older Unreal SVSJOIN and SVSNLINE tokens were mixed so SVSJOIN and SVSNLINE are broken
|
||||||
when coming from a none TOKEN'd server
|
when coming from a none TOKEN'd server
|
||||||
*/
|
*/
|
||||||
void SendSVSJoin(const MessageSource &source, User *user, const Anope::string &chan, const Anope::string ¶m) override
|
void SendSVSJoin(const MessageSource &source, User *user, const Anope::string &chan, const Anope::string &key) override
|
||||||
{
|
{
|
||||||
if (!param.empty())
|
if (key.empty())
|
||||||
Uplink::Send("SVSJOIN", user->GetUID(), chan, param);
|
|
||||||
else
|
|
||||||
Uplink::Send("SVSJOIN", user->GetUID(), chan);
|
Uplink::Send("SVSJOIN", user->GetUID(), chan);
|
||||||
|
else
|
||||||
|
Uplink::Send("SVSJOIN", user->GetUID(), chan, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendSVSPart(const MessageSource &source, User *user, const Anope::string &chan, const Anope::string ¶m) override
|
void SendSVSPart(const MessageSource &source, User *user, const Anope::string &chan, const Anope::string ¶m) override
|
||||||
@@ -1142,19 +1143,27 @@ struct IRCDMessageMD final
|
|||||||
struct IRCDMessageMode final
|
struct IRCDMessageMode final
|
||||||
: IRCDMessage
|
: IRCDMessage
|
||||||
{
|
{
|
||||||
IRCDMessageMode(Module *creator, const Anope::string &mname) : IRCDMessage(creator, mname, 2) { SetFlag(FLAG_SOFT_LIMIT); }
|
bool server_ts;
|
||||||
|
|
||||||
|
IRCDMessageMode(Module *creator, const Anope::string &mname, bool sts)
|
||||||
|
: IRCDMessage(creator, mname, 2)
|
||||||
|
, server_ts(sts)
|
||||||
|
{
|
||||||
|
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
|
||||||
{
|
{
|
||||||
bool server_source = source.GetServer() != NULL;
|
auto final_is_ts = server_ts && source.GetServer() != NULL;
|
||||||
|
|
||||||
Anope::string modes = params[1];
|
Anope::string modes = params[1];
|
||||||
for (unsigned i = 2; i < params.size() - (server_source ? 1 : 0); ++i)
|
for (unsigned i = 2; i < params.size() - (final_is_ts ? 1 : 0); ++i)
|
||||||
modes += " " + params[i];
|
modes += " " + params[i];
|
||||||
|
|
||||||
if (IRCD->IsChannelValid(params[0]))
|
if (IRCD->IsChannelValid(params[0]))
|
||||||
{
|
{
|
||||||
Channel *c = Channel::Find(params[0]);
|
Channel *c = Channel::Find(params[0]);
|
||||||
auto ts = server_source ? IRCD->ExtractTimestamp(params.back()) : 0;
|
auto ts = final_is_ts ? IRCD->ExtractTimestamp(params.back()) : 0;
|
||||||
|
|
||||||
if (c)
|
if (c)
|
||||||
c->SetModesInternal(source, modes, ts);
|
c->SetModesInternal(source, modes, ts);
|
||||||
@@ -1689,20 +1698,51 @@ class ProtoUnreal final
|
|||||||
IRCDMessageUmode2 message_umode2;
|
IRCDMessageUmode2 message_umode2;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ProtoUnreal(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR),
|
ProtoUnreal(const Anope::string &modname, const Anope::string &creator)
|
||||||
ircd_proto(this),
|
: Module(modname, creator, PROTOCOL | VENDOR)
|
||||||
message_away(this), message_error(this), message_invite(this), message_join(this), message_kick(this),
|
, ircd_proto(this)
|
||||||
message_kill(this), message_svskill(this, "SVSKILL"), message_motd(this), message_notice(this), message_part(this), message_ping(this),
|
, message_away(this)
|
||||||
message_privmsg(this), message_quit(this), message_squit(this), message_stats(this), message_time(this),
|
, message_error(this)
|
||||||
message_version(this), message_whois(this),
|
, message_invite(this)
|
||||||
|
, message_join(this)
|
||||||
message_capab(this), message_chghost(this), message_chgident(this), message_chgname(this),
|
, message_kick(this)
|
||||||
message_md(this, ircd_proto.ClientModData, ircd_proto.ChannelModData),message_mode(this, "MODE"),
|
, message_kill(this)
|
||||||
message_svsmode(this, "SVSMODE"), message_svs2mode(this, "SVS2MODE"), message_netinfo(this), message_nick(this), message_pong(this),
|
, message_svskill(this, "SVSKILL")
|
||||||
message_sasl(this), message_sdesc(this), message_sethost(this), message_setident(this), message_setname(this), message_server(this),
|
, message_motd(this)
|
||||||
message_sid(this), message_sjoin(this), message_svslogin(this), message_topic(this), message_uid(this), message_umode2(this)
|
, message_notice(this)
|
||||||
|
, message_part(this)
|
||||||
|
, message_ping(this)
|
||||||
|
, message_privmsg(this)
|
||||||
|
, message_quit(this)
|
||||||
|
, message_squit(this)
|
||||||
|
, message_stats(this)
|
||||||
|
, message_time(this)
|
||||||
|
, message_version(this)
|
||||||
|
, message_whois(this)
|
||||||
|
, message_capab(this)
|
||||||
|
, message_chghost(this)
|
||||||
|
, message_chgident(this)
|
||||||
|
, message_chgname(this)
|
||||||
|
, message_md(this, ircd_proto.ClientModData, ircd_proto.ChannelModData)
|
||||||
|
, message_mode(this, "MODE", true)
|
||||||
|
, message_svsmode(this, "SVSMODE", false)
|
||||||
|
, message_svs2mode(this, "SVS2MODE", false)
|
||||||
|
, message_netinfo(this)
|
||||||
|
, message_nick(this)
|
||||||
|
, message_pong(this)
|
||||||
|
, message_sasl(this)
|
||||||
|
, message_sdesc(this)
|
||||||
|
, message_sethost(this)
|
||||||
|
, message_setident(this)
|
||||||
|
, message_setname(this)
|
||||||
|
, message_server(this)
|
||||||
|
, message_sid(this)
|
||||||
|
, message_sjoin(this)
|
||||||
|
, message_svslogin(this)
|
||||||
|
, message_topic(this)
|
||||||
|
, message_uid(this)
|
||||||
|
, message_umode2(this)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Prioritize() override
|
void Prioritize() override
|
||||||
|
|||||||
+1
-1
@@ -302,7 +302,7 @@ public:
|
|||||||
// If the user is already introduced then we log them in now.
|
// If the user is already introduced then we log them in now.
|
||||||
// Otherwise, we send an SVSLOGIN to log them in later.
|
// Otherwise, we send an SVSLOGIN to log them in later.
|
||||||
User *user = User::Find(session->uid);
|
User *user = User::Find(session->uid);
|
||||||
NickAlias *na = NickAlias::Find(nc->display);
|
NickAlias *na = nc ? nc->na : nullptr;
|
||||||
if (user)
|
if (user)
|
||||||
{
|
{
|
||||||
if (na)
|
if (na)
|
||||||
|
|||||||
+2
-12
@@ -30,18 +30,8 @@ if(WIN32)
|
|||||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc LANGUAGE RC)
|
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc LANGUAGE RC)
|
||||||
# Add the resource file to the list of sources
|
# Add the resource file to the list of sources
|
||||||
list(APPEND SRC_SRCS ${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc)
|
list(APPEND SRC_SRCS ${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc)
|
||||||
# For MinGW, we have to change the compile flags
|
|
||||||
if(MINGW)
|
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc COMPILE_FLAGS "/i\"${Anope_SOURCE_DIR}/include\"")
|
||||||
set(RC_CFLAGS "-DMINGW -Ocoff -I${Anope_SOURCE_DIR}/include")
|
|
||||||
# If any sort of debugging is being enabled, add a _DEBUG define to the flags for the resource compiler
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
|
|
||||||
set(RC_CFLAGS "${RC_CFLAGS} -D_DEBUG")
|
|
||||||
endif()
|
|
||||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc COMPILE_FLAGS "${RC_CFLAGS}")
|
|
||||||
# For anything else, assumingly Visual Studio at this point, use a different set of compile flags
|
|
||||||
else()
|
|
||||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32/win32.rc COMPILE_FLAGS "/i\"${Anope_SOURCE_DIR}/include\"")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# If compiling with Visual Studio, create a static library out of win32/win32_memory.cpp to be included with everything else, needed to override its override of new/delete operators
|
# If compiling with Visual Studio, create a static library out of win32/win32_memory.cpp to be included with everything else, needed to override its override of new/delete operators
|
||||||
|
|||||||
+8
-8
@@ -160,14 +160,14 @@ NickCore *ChanAccess::GetAccount() const
|
|||||||
|
|
||||||
void ChanAccess::Serialize(Serialize::Data &data) const
|
void ChanAccess::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["provider"] << this->provider->name;
|
data.Store("provider", this->provider->name);
|
||||||
data["ci"] << this->ci->name;
|
data.Store("ci", this->ci->name);
|
||||||
data["mask"] << this->Mask();
|
data.Store("mask", this->Mask());
|
||||||
data["creator"] << this->creator;
|
data.Store("creator", this->creator);
|
||||||
data["description"] << this->description;
|
data.Store("description", this->description);
|
||||||
data.SetType("last_seen", Serialize::Data::DT_INT); data["last_seen"] << this->last_seen;
|
data.Store("last_seen", this->last_seen);
|
||||||
data.SetType("created", Serialize::Data::DT_INT); data["created"] << this->created;
|
data.Store("created", this->created);
|
||||||
data["data"] << this->AccessSerialize();
|
data.Store("data", this->AccessSerialize());
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable *ChanAccess::Unserialize(Serializable *obj, Serialize::Data &data)
|
Serializable *ChanAccess::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
+6
-6
@@ -75,12 +75,12 @@ BotInfo::~BotInfo()
|
|||||||
|
|
||||||
void BotInfo::Serialize(Serialize::Data &data) const
|
void BotInfo::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["nick"] << this->nick;
|
data.Store("nick", this->nick);
|
||||||
data["user"] << this->ident;
|
data.Store("user", this->ident);
|
||||||
data["host"] << this->host;
|
data.Store("host", this->host);
|
||||||
data["realname"] << this->realname;
|
data.Store("realname", this->realname);
|
||||||
data["created"] << this->created;
|
data.Store("created", this->created);
|
||||||
data["oper_only"] << this->oper_only;
|
data.Store("oper_only", this->oper_only);
|
||||||
|
|
||||||
Extensible::ExtensibleSerialize(this, this, data);
|
Extensible::ExtensibleSerialize(this, this, data);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -364,7 +364,7 @@ void LogInfo::ProcessMessage(const Log *l)
|
|||||||
if (!bi)
|
if (!bi)
|
||||||
bi = c->WhoSends();
|
bi = c->WhoSends();
|
||||||
if (bi)
|
if (bi)
|
||||||
IRCD->SendPrivmsg(bi, c->name, "%s", buffer.c_str());
|
IRCD->SendPrivmsg(bi, c->name, buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (target == "globops")
|
else if (target == "globops")
|
||||||
|
|||||||
+1
-1
@@ -167,7 +167,7 @@ int main(int ac, char **av, char **envp)
|
|||||||
|
|
||||||
/* Set up timers */
|
/* Set up timers */
|
||||||
time_t last_check = Anope::CurTime;
|
time_t last_check = Anope::CurTime;
|
||||||
UpdateTimer updateTimer(Config->GetBlock("options")->Get<time_t>("updatetimeout", "5m"));
|
UpdateTimer updateTimer(Config->GetBlock("options")->Get<time_t>("updatetimeout", "2m"));
|
||||||
ExpireTimer expireTimer(Config->GetBlock("options")->Get<time_t>("expiretimeout", "30m"));
|
ExpireTimer expireTimer(Config->GetBlock("options")->Get<time_t>("expiretimeout", "30m"));
|
||||||
|
|
||||||
/*** Main loop. ***/
|
/*** Main loop. ***/
|
||||||
|
|||||||
+6
-6
@@ -36,12 +36,12 @@ Memo::~Memo()
|
|||||||
|
|
||||||
void Memo::Serialize(Serialize::Data &data) const
|
void Memo::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["owner"] << this->owner;
|
data.Store("owner", this->owner);
|
||||||
data.SetType("time", Serialize::Data::DT_INT); data["time"] << this->time;
|
data.Store("time", this->time);
|
||||||
data["sender"] << this->sender;
|
data.Store("sender", this->sender);
|
||||||
data["text"] << this->text;
|
data.Store("text", this->text);
|
||||||
data["unread"] << this->unread;
|
data.Store("unread", this->unread);
|
||||||
data["receipt"] << this->receipt;
|
data.Store("receipt", this->receipt);
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable *Memo::Unserialize(Serializable *obj, Serialize::Data &data)
|
Serializable *Memo::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
+7
-8
@@ -342,19 +342,18 @@ void Privmsg::Run(MessageSource &source, const std::vector<Anope::string> ¶m
|
|||||||
|
|
||||||
if (bi)
|
if (bi)
|
||||||
{
|
{
|
||||||
if (message[0] == '\1' && message[message.length() - 1] == '\1')
|
Anope::string ctcpname, ctcpbody;
|
||||||
|
if (Anope::ParseCTCP(message, ctcpname, ctcpbody))
|
||||||
{
|
{
|
||||||
if (message.substr(0, 6).equals_ci("\1PING "))
|
if (ctcpname.equals_ci("PING"))
|
||||||
{
|
{
|
||||||
Anope::string buf = message;
|
IRCD->SendNotice(bi, u->nick, Anope::FormatCTCP("PING", ctcpbody));
|
||||||
buf.erase(buf.begin());
|
|
||||||
buf.erase(buf.end() - 1);
|
|
||||||
IRCD->SendCTCP(bi, u->nick, "%s", buf.c_str());
|
|
||||||
}
|
}
|
||||||
else if (message.substr(0, 9).equals_ci("\1VERSION\1"))
|
else if (ctcpname.equals_ci("VERSION"))
|
||||||
{
|
{
|
||||||
Module *enc = ModuleManager::FindFirstOf(ENCRYPTION);
|
Module *enc = ModuleManager::FindFirstOf(ENCRYPTION);
|
||||||
IRCD->SendCTCP(bi, u->nick, "VERSION Anope-%s %s :%s - (%s) -- %s", Anope::Version().c_str(), Me->GetName().c_str(), IRCD->GetProtocolName().c_str(), enc ? enc->name.c_str() : "(none)", Anope::VersionBuildString().c_str());
|
IRCD->SendNotice(bi, u->nick, Anope::FormatCTCP("VERSION", Anope::printf("Anope-%s %s -- %s -- %s", Anope::Version().c_str(),
|
||||||
|
Anope::VersionBuildString().c_str(), IRCD->GetProtocolName().c_str(), enc ? enc->name.c_str() : "(none)")));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -835,3 +835,50 @@ Anope::string Anope::Expand(const Anope::string &base, const Anope::string &frag
|
|||||||
|
|
||||||
return Anope::printf("%s%c%s", base.c_str(), separator, fragment.c_str());
|
return Anope::printf("%s%c%s", base.c_str(), separator, fragment.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Anope::string Anope::FormatCTCP(const Anope::string &name, const Anope::string &value)
|
||||||
|
{
|
||||||
|
if (value.empty())
|
||||||
|
return Anope::printf("\1%s\1", name.c_str());
|
||||||
|
|
||||||
|
return Anope::printf("\1%s %s\1", name.c_str(), value.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Anope::ParseCTCP(const Anope::string &text, Anope::string &name, Anope::string &body)
|
||||||
|
{
|
||||||
|
// According to draft-oakley-irc-ctcp-02 a valid CTCP must begin with SOH and
|
||||||
|
// contain at least one octet which is not NUL, SOH, CR, LF, or SPACE. As most
|
||||||
|
// of these are restricted at the protocol level we only need to check for SOH
|
||||||
|
// and SPACE.
|
||||||
|
if (text.length() < 2 || text[0] != '\x1' || text[1] == '\x1' || text[1] == ' ')
|
||||||
|
{
|
||||||
|
name.clear();
|
||||||
|
body.clear();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto end_of_name = text.find(' ', 2);
|
||||||
|
auto end_of_ctcp = *text.rbegin() == '\x1' ? 1 : 0;
|
||||||
|
if (end_of_name == std::string::npos)
|
||||||
|
{
|
||||||
|
// The CTCP only contains a name.
|
||||||
|
name = text.substr(1, text.length() - 1 - end_of_ctcp);
|
||||||
|
body.clear();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The CTCP contains a name and a body.
|
||||||
|
name = text.substr(1, end_of_name - 1);
|
||||||
|
|
||||||
|
auto start_of_body = text.find_first_not_of(' ', end_of_name + 1);
|
||||||
|
if (start_of_body == std::string::npos)
|
||||||
|
{
|
||||||
|
// The CTCP body is provided but empty.
|
||||||
|
body.clear();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The CTCP body provided was non-empty.
|
||||||
|
body = text.substr(start_of_body, text.length() - start_of_body - end_of_ctcp);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|||||||
+14
-12
@@ -31,6 +31,8 @@ NickAlias::NickAlias(const Anope::string &nickname, NickCore *nickcore)
|
|||||||
throw CoreException("Empty nickcore passed to NickAlias constructor");
|
throw CoreException("Empty nickcore passed to NickAlias constructor");
|
||||||
|
|
||||||
nickcore->aliases->push_back(this);
|
nickcore->aliases->push_back(this);
|
||||||
|
if (this->nick.equals_ci(nickcore->display))
|
||||||
|
nickcore->na = this;
|
||||||
|
|
||||||
if (!NickAliasList->insert_or_assign(this->nick, this).second)
|
if (!NickAliasList->insert_or_assign(this->nick, this).second)
|
||||||
Log(LOG_DEBUG) << "Duplicate nick " << this->nick << " in NickAlias table";
|
Log(LOG_DEBUG) << "Duplicate nick " << this->nick << " in NickAlias table";
|
||||||
@@ -139,21 +141,21 @@ NickAlias *NickAlias::Find(const Anope::string &nick)
|
|||||||
|
|
||||||
void NickAlias::Serialize(Serialize::Data &data) const
|
void NickAlias::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["nick"] << this->nick;
|
data.Store("nick", this->nick);
|
||||||
data["last_quit"] << this->last_quit;
|
data.Store("last_quit", this->last_quit);
|
||||||
data["last_realname"] << this->last_realname;
|
data.Store("last_realname", this->last_realname);
|
||||||
data["last_usermask"] << this->last_usermask;
|
data.Store("last_usermask", this->last_usermask);
|
||||||
data["last_realhost"] << this->last_realhost;
|
data.Store("last_realhost", this->last_realhost);
|
||||||
data.SetType("time_registered", Serialize::Data::DT_INT); data["time_registered"] << this->time_registered;
|
data.Store("time_registered", this->time_registered);
|
||||||
data.SetType("last_seen", Serialize::Data::DT_INT); data["last_seen"] << this->last_seen;
|
data.Store("last_seen", this->last_seen);
|
||||||
data["nc"] << this->nc->display;
|
data.Store("nc", this->nc->display);
|
||||||
|
|
||||||
if (this->HasVHost())
|
if (this->HasVHost())
|
||||||
{
|
{
|
||||||
data["vhost_ident"] << this->GetVHostIdent();
|
data.Store("vhost_ident", this->GetVHostIdent());
|
||||||
data["vhost_host"] << this->GetVHostHost();
|
data.Store("vhost_host", this->GetVHostHost());
|
||||||
data["vhost_creator"] << this->GetVHostCreator();
|
data.Store("vhost_creator", this->GetVHostCreator());
|
||||||
data["vhost_time"] << this->GetVHostCreated();
|
data.Store("vhost_time", this->GetVHostCreated());
|
||||||
}
|
}
|
||||||
|
|
||||||
Extensible::ExtensibleSerialize(this, this, data);
|
Extensible::ExtensibleSerialize(this, this, data);
|
||||||
|
|||||||
+14
-10
@@ -68,17 +68,20 @@ NickCore::~NickCore()
|
|||||||
|
|
||||||
void NickCore::Serialize(Serialize::Data &data) const
|
void NickCore::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["display"] << this->display;
|
data.Store("display", this->display);
|
||||||
data["uniqueid"] << this->id;
|
data.Store("uniqueid", this->id);
|
||||||
data["pass"] << this->pass;
|
data.Store("pass", this->pass);
|
||||||
data["email"] << this->email;
|
data.Store("email", this->email);
|
||||||
data["language"] << this->language;
|
data.Store("language", this->language);
|
||||||
data.SetType("lastmail", Serialize::Data::DT_INT); data["lastmail"] << this->lastmail;
|
data.Store("lastmail", this->lastmail);
|
||||||
data.SetType("time_registered", Serialize::Data::DT_INT); data["time_registered"] << this->time_registered;
|
data.Store("time_registered", this->time_registered);
|
||||||
|
data.Store("memomax", this->memos.memomax);
|
||||||
|
|
||||||
data["memomax"] << this->memos.memomax;
|
std::ostringstream oss;
|
||||||
for (const auto &ignore : this->memos.ignores)
|
for (const auto &ignore : this->memos.ignores)
|
||||||
data["memoignores"] << ignore << " ";
|
oss << ignore << " ";
|
||||||
|
data.Store("memoignores", oss.str());
|
||||||
|
|
||||||
Extensible::ExtensibleSerialize(this, this, data);
|
Extensible::ExtensibleSerialize(this, this, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,7 +152,7 @@ Serializable *NickCore::Unserialize(Serializable *obj, Serialize::Data &data)
|
|||||||
return nc;
|
return nc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NickCore::SetDisplay(const NickAlias *na)
|
void NickCore::SetDisplay(NickAlias *na)
|
||||||
{
|
{
|
||||||
if (na->nc != this || na->nick == this->display)
|
if (na->nc != this || na->nick == this->display)
|
||||||
return;
|
return;
|
||||||
@@ -164,6 +167,7 @@ void NickCore::SetDisplay(const NickAlias *na)
|
|||||||
NickCoreList->erase(this->display);
|
NickCoreList->erase(this->display);
|
||||||
|
|
||||||
this->display = na->nick;
|
this->display = na->nick;
|
||||||
|
this->na = na;
|
||||||
|
|
||||||
(*NickCoreList)[this->display] = this;
|
(*NickCoreList)[this->display] = this;
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-51
@@ -135,16 +135,22 @@ void IRCDProto::SendKick(const MessageSource &source, const Channel *c, User *u,
|
|||||||
Uplink::Send(source, "KICK", c->name, u->GetUID());
|
Uplink::Send(source, "KICK", c->name, u->GetUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
void IRCDProto::SendNoticeInternal(const MessageSource &source, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags)
|
void IRCDProto::SendNotice(const MessageSource &source, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags)
|
||||||
{
|
{
|
||||||
Uplink::Send(tags, source, "NOTICE", dest, msg.empty() ? " " : msg);
|
Uplink::Send(tags, source, "NOTICE", dest, msg.empty() ? " " : msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IRCDProto::SendPrivmsgInternal(const MessageSource &source, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags)
|
void IRCDProto::SendPrivmsg(const MessageSource &source, const Anope::string &dest, const Anope::string &msg, const Anope::map<Anope::string> &tags)
|
||||||
{
|
{
|
||||||
Uplink::Send(tags, source, "PRIVMSG", dest, msg.empty() ? " " : msg);
|
Uplink::Send(tags, source, "PRIVMSG", dest, msg.empty() ? " " : msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IRCDProto::SendTagmsg(const MessageSource &source, const Anope::string &dest, const Anope::map<Anope::string> &tags)
|
||||||
|
{
|
||||||
|
if (CanTagMessage)
|
||||||
|
Uplink::Send(tags, source, "TAGMSG", dest);
|
||||||
|
}
|
||||||
|
|
||||||
void IRCDProto::SendQuit(User *u, const Anope::string &buf)
|
void IRCDProto::SendQuit(User *u, const Anope::string &buf)
|
||||||
{
|
{
|
||||||
if (!buf.empty())
|
if (!buf.empty())
|
||||||
@@ -166,12 +172,6 @@ void IRCDProto::SendGlobops(const MessageSource &source, const Anope::string &me
|
|||||||
Uplink::Send(source, "GLOBOPS", message);
|
Uplink::Send(source, "GLOBOPS", message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IRCDProto::SendCTCPInternal(const MessageSource &source, const Anope::string &dest, const Anope::string &buf)
|
|
||||||
{
|
|
||||||
Anope::string s = Anope::NormalizeBuffer(buf);
|
|
||||||
this->SendNoticeInternal(source, dest, "\1" + s + "\1");
|
|
||||||
}
|
|
||||||
|
|
||||||
void IRCDProto::SendNumericInternal(int numeric, const Anope::string &dest, const std::vector<Anope::string> ¶ms)
|
void IRCDProto::SendNumericInternal(int numeric, const Anope::string &dest, const std::vector<Anope::string> ¶ms)
|
||||||
{
|
{
|
||||||
Anope::string n = Anope::ToString(numeric);
|
Anope::string n = Anope::ToString(numeric);
|
||||||
@@ -190,37 +190,6 @@ void IRCDProto::SendTopic(const MessageSource &source, Channel *c)
|
|||||||
Uplink::Send(source, "TOPIC", c->name, c->topic);
|
Uplink::Send(source, "TOPIC", c->name, c->topic);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IRCDProto::SendNotice(const MessageSource &source, const Anope::string &dest, const char *fmt, ...)
|
|
||||||
{
|
|
||||||
va_list args;
|
|
||||||
char buf[BUFSIZE] = "";
|
|
||||||
va_start(args, fmt);
|
|
||||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
|
||||||
va_end(args);
|
|
||||||
SendNoticeInternal(source, dest, buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
void IRCDProto::SendAction(const MessageSource &source, const Anope::string &dest, const char *fmt, ...)
|
|
||||||
{
|
|
||||||
va_list args;
|
|
||||||
char buf[BUFSIZE] = "";
|
|
||||||
va_start(args, fmt);
|
|
||||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
|
||||||
va_end(args);
|
|
||||||
Anope::string actionbuf = Anope::string("\1ACTION ") + buf + '\1';
|
|
||||||
SendPrivmsgInternal(source, dest, actionbuf);
|
|
||||||
}
|
|
||||||
|
|
||||||
void IRCDProto::SendPrivmsg(const MessageSource &source, const Anope::string &dest, const char *fmt, ...)
|
|
||||||
{
|
|
||||||
va_list args;
|
|
||||||
char buf[BUFSIZE] = "";
|
|
||||||
va_start(args, fmt);
|
|
||||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
|
||||||
va_end(args);
|
|
||||||
SendPrivmsgInternal(source, dest, buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
void IRCDProto::SendPing(const Anope::string &servname, const Anope::string &who)
|
void IRCDProto::SendPing(const Anope::string &servname, const Anope::string &who)
|
||||||
{
|
{
|
||||||
if (servname.empty())
|
if (servname.empty())
|
||||||
@@ -263,16 +232,6 @@ void IRCDProto::SendForceNickChange(User *u, const Anope::string &newnick, time_
|
|||||||
Uplink::Send("SVSNICK", u->GetUID(), newnick, when);
|
Uplink::Send("SVSNICK", u->GetUID(), newnick, when);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IRCDProto::SendCTCP(const MessageSource &source, const Anope::string &dest, const char *fmt, ...)
|
|
||||||
{
|
|
||||||
va_list args;
|
|
||||||
char buf[BUFSIZE] = "";
|
|
||||||
va_start(args, fmt);
|
|
||||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
|
||||||
va_end(args);
|
|
||||||
SendCTCPInternal(source, dest, buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IRCDProto::IsNickValid(const Anope::string &nick)
|
bool IRCDProto::IsNickValid(const Anope::string &nick)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -370,14 +329,14 @@ Anope::string IRCDProto::NormalizeMask(const Anope::string &mask)
|
|||||||
|
|
||||||
void IRCDProto::SendContextNotice(BotInfo *bi, User *target, Channel *context, const Anope::string &msg)
|
void IRCDProto::SendContextNotice(BotInfo *bi, User *target, Channel *context, const Anope::string &msg)
|
||||||
{
|
{
|
||||||
IRCD->SendNoticeInternal(bi, target->GetUID(), Anope::printf("[%s] %s", context->name.c_str(), msg.c_str()), {
|
IRCD->SendNotice(bi, target->GetUID(), Anope::printf("[%s] %s", context->name.c_str(), msg.c_str()), {
|
||||||
{ "+draft/channel-context", context->name },
|
{ "+draft/channel-context", context->name },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void IRCDProto::SendContextPrivmsg(BotInfo *bi, User *target, Channel *context, const Anope::string &msg)
|
void IRCDProto::SendContextPrivmsg(BotInfo *bi, User *target, Channel *context, const Anope::string &msg)
|
||||||
{
|
{
|
||||||
IRCD->SendPrivmsgInternal(bi, target->GetUID(), Anope::printf("[%s] %s", context->name.c_str(), msg.c_str()), {
|
IRCD->SendPrivmsg(bi, target->GetUID(), Anope::printf("[%s] %s", context->name.c_str(), msg.c_str()), {
|
||||||
{ "+draft/channel-context", context->name },
|
{ "+draft/channel-context", context->name },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
+29
-22
@@ -40,15 +40,15 @@ AutoKick::~AutoKick()
|
|||||||
|
|
||||||
void AutoKick::Serialize(Serialize::Data &data) const
|
void AutoKick::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["ci"] << this->ci->name;
|
data.Store("ci", this->ci->name);
|
||||||
if (this->nc)
|
if (this->nc)
|
||||||
data["nc"] << this->nc->display;
|
data.Store("nc", this->nc->display);
|
||||||
else
|
else
|
||||||
data["mask"] << this->mask;
|
data.Store("mask", this->mask);
|
||||||
data["reason"] << this->reason;
|
data.Store("reason", this->reason);
|
||||||
data["creator"] << this->creator;
|
data.Store("creator", this->creator);
|
||||||
data.SetType("addtime", Serialize::Data::DT_INT); data["addtime"] << this->addtime;
|
data.Store("addtime", this->addtime);
|
||||||
data.SetType("last_used", Serialize::Data::DT_INT); data["last_used"] << this->last_used;
|
data.Store("last_used", this->last_used);
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable *AutoKick::Unserialize(Serializable *obj, Serialize::Data &data)
|
Serializable *AutoKick::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
@@ -180,30 +180,33 @@ ChannelInfo::~ChannelInfo()
|
|||||||
|
|
||||||
void ChannelInfo::Serialize(Serialize::Data &data) const
|
void ChannelInfo::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["name"] << this->name;
|
data.Store("name", this->name);
|
||||||
if (this->founder)
|
if (this->founder)
|
||||||
data["founder"] << this->founder->display;
|
data.Store("founder", this->founder->display);
|
||||||
if (this->successor)
|
if (this->successor)
|
||||||
data["successor"] << this->successor->display;
|
data.Store("successor", this->successor->display);
|
||||||
data["description"] << this->desc;
|
data.Store("description", this->desc);
|
||||||
data.SetType("time_registered", Serialize::Data::DT_INT); data["time_registered"] << this->time_registered;
|
data.Store("time_registered", this->time_registered);
|
||||||
data.SetType("last_used", Serialize::Data::DT_INT); data["last_used"] << this->last_used;
|
data.Store("last_used", this->last_used);
|
||||||
data["last_topic"] << this->last_topic;
|
data.Store("last_topic", this->last_topic);
|
||||||
data["last_topic_setter"] << this->last_topic_setter;
|
data.Store("last_topic_setter", this->last_topic_setter);
|
||||||
data.SetType("last_topic_time", Serialize::Data::DT_INT); data["last_topic_time"] << this->last_topic_time;
|
data.Store("last_topic_time", this->last_topic_time);
|
||||||
data.SetType("bantype", Serialize::Data::DT_INT); data["bantype"] << this->bantype;
|
data.Store("bantype", this->bantype);
|
||||||
{
|
{
|
||||||
Anope::string levels_buffer;
|
Anope::string levels_buffer;
|
||||||
for (const auto &[name, level] : this->levels)
|
for (const auto &[name, level] : this->levels)
|
||||||
levels_buffer += name + " " + Anope::ToString(level) + " ";
|
levels_buffer += name + " " + Anope::ToString(level) + " ";
|
||||||
data["levels"] << levels_buffer;
|
data.Store("levels", levels_buffer);
|
||||||
}
|
}
|
||||||
if (this->bi)
|
if (this->bi)
|
||||||
data["bi"] << this->bi->nick;
|
data.Store("bi", this->bi->nick);
|
||||||
data.SetType("banexpire", Serialize::Data::DT_INT); data["banexpire"] << this->banexpire;
|
data.Store("banexpire", this->banexpire);
|
||||||
data["memomax"] << this->memos.memomax;
|
data.Store("memomax", this->memos.memomax);
|
||||||
|
|
||||||
|
std::ostringstream oss;
|
||||||
for (const auto &ignore : this->memos.ignores)
|
for (const auto &ignore : this->memos.ignores)
|
||||||
data["memoignores"] << ignore << " ";
|
oss << ignore << " ";
|
||||||
|
data.Store("memoignores", oss.str());
|
||||||
|
|
||||||
Extensible::ExtensibleSerialize(this, this, data);
|
Extensible::ExtensibleSerialize(this, this, data);
|
||||||
}
|
}
|
||||||
@@ -239,6 +242,10 @@ Serializable *ChannelInfo::Unserialize(Serializable *obj, Serialize::Data &data)
|
|||||||
spacesepstream(slevels).GetTokens(v);
|
spacesepstream(slevels).GetTokens(v);
|
||||||
for (unsigned i = 0; i + 1 < v.size(); i += 2)
|
for (unsigned i = 0; i + 1 < v.size(); i += 2)
|
||||||
{
|
{
|
||||||
|
// Begin 2.0 database compatibility.
|
||||||
|
if (v[i] == "FANTASIA")
|
||||||
|
v[i] = "FANTASY";
|
||||||
|
// End 2.0 database compatibility.
|
||||||
if (auto level = Anope::TryConvert<int16_t>(v[i + 1]))
|
if (auto level = Anope::TryConvert<int16_t>(v[i + 1]))
|
||||||
ci->levels[v[i]] = level.value();
|
ci->levels[v[i]] = level.value();
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-2
@@ -337,9 +337,9 @@ namespace
|
|||||||
for (Anope::string tok; sep.GetToken(tok);)
|
for (Anope::string tok; sep.GetToken(tok);)
|
||||||
{
|
{
|
||||||
if (target->ShouldPrivmsg())
|
if (target->ShouldPrivmsg())
|
||||||
IRCD->SendPrivmsgInternal(source, target->GetUID(), tok, tags);
|
IRCD->SendPrivmsg(source, target->GetUID(), tok, tags);
|
||||||
else
|
else
|
||||||
IRCD->SendNoticeInternal(source, target->GetUID(), tok, tags);
|
IRCD->SendNotice(source, target->GetUID(), tok, tags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -430,6 +430,11 @@ NickCore *User::Account() const
|
|||||||
return this->nc;
|
return this->nc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NickAlias *User::AccountNick() const
|
||||||
|
{
|
||||||
|
return this->nc ? this->nc->na : nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
bool User::IsIdentified(bool check_nick) const
|
bool User::IsIdentified(bool check_nick) const
|
||||||
{
|
{
|
||||||
if (check_nick && this->nc)
|
if (check_nick && this->nc)
|
||||||
|
|||||||
+1
-1
@@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
VERSION_MAJOR=2
|
VERSION_MAJOR=2
|
||||||
VERSION_MINOR=1
|
VERSION_MINOR=1
|
||||||
VERSION_PATCH=6
|
VERSION_PATCH=8
|
||||||
VERSION_EXTRA=""
|
VERSION_EXTRA=""
|
||||||
|
|||||||
@@ -34,9 +34,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
|||||||
VER_ANOPE VERSIONINFO
|
VER_ANOPE VERSIONINFO
|
||||||
FILEVERSION @VERSION_COMMA@
|
FILEVERSION @VERSION_COMMA@
|
||||||
PRODUCTVERSION @VERSION_COMMA@
|
PRODUCTVERSION @VERSION_COMMA@
|
||||||
#ifndef MINGW
|
|
||||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||||
#endif
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS VS_FF_DEBUG
|
FILEFLAGS VS_FF_DEBUG
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -23,18 +23,15 @@ static struct WindowsLanguage final
|
|||||||
Anope::string languageName;
|
Anope::string languageName;
|
||||||
USHORT windowsLanguageName;
|
USHORT windowsLanguageName;
|
||||||
} WindowsLanguages[] = {
|
} WindowsLanguages[] = {
|
||||||
{"ca_ES", LANG_CATALAN},
|
|
||||||
{"de_DE", LANG_GERMAN},
|
{"de_DE", LANG_GERMAN},
|
||||||
{"el_GR", LANG_GREEK},
|
{"el_GR", LANG_GREEK},
|
||||||
{"en_US", LANG_ENGLISH},
|
{"en_US", LANG_ENGLISH},
|
||||||
{"es_ES", LANG_SPANISH},
|
{"es_ES", LANG_SPANISH},
|
||||||
{"fr_FR", LANG_FRENCH},
|
{"fr_FR", LANG_FRENCH},
|
||||||
{"hu_HU", LANG_HUNGARIAN},
|
|
||||||
{"it_IT", LANG_ITALIAN},
|
{"it_IT", LANG_ITALIAN},
|
||||||
{"nl_NL", LANG_DUTCH},
|
{"nl_NL", LANG_DUTCH},
|
||||||
{"pl_PL", LANG_POLISH},
|
{"pl_PL", LANG_POLISH},
|
||||||
{"pt_PT", LANG_PORTUGUESE},
|
{"pt_PT", LANG_PORTUGUESE},
|
||||||
{"ru_RU", LANG_RUSSIAN},
|
|
||||||
{"tr_TR", LANG_TURKISH},
|
{"tr_TR", LANG_TURKISH},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -153,14 +153,14 @@ bool XLine::IsRegex() const
|
|||||||
|
|
||||||
void XLine::Serialize(Serialize::Data &data) const
|
void XLine::Serialize(Serialize::Data &data) const
|
||||||
{
|
{
|
||||||
data["mask"] << this->mask;
|
data.Store("mask", this->mask);
|
||||||
data["by"] << this->by;
|
data.Store("by", this->by);
|
||||||
data["created"] << this->created;
|
data.Store("created", this->created);
|
||||||
data["expires"] << this->expires;
|
data.Store("expires", this->expires);
|
||||||
data["reason"] << this->reason;
|
data.Store("reason", this->reason);
|
||||||
data["uid"] << this->id;
|
data.Store("uid", this->id);
|
||||||
if (this->manager)
|
if (this->manager)
|
||||||
data["manager"] << this->manager->name;
|
data.Store("manager", this->manager->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
Serializable *XLine::Unserialize(Serializable *obj, Serialize::Data &data)
|
Serializable *XLine::Unserialize(Serializable *obj, Serialize::Data &data)
|
||||||
|
|||||||
Reference in New Issue
Block a user