mirror of
https://github.com/anope/anope.git
synced 2026-06-18 22:44:47 +02:00
Compare commits
382 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ce094f4d01 | |||
| 178056096f | |||
| a32c897bf9 | |||
| 367b662c83 | |||
| 75999e05b9 | |||
| 45c02f8e4e | |||
| ae4421b8a2 | |||
| 2d309da0f6 | |||
| b9bbb3747b | |||
| 0b05eaa020 | |||
| 91ad9d22ca | |||
| 6aa9ad938a | |||
| 6808498ead | |||
| 8561941e22 | |||
| 5d4db2b854 | |||
| 501503b7a5 | |||
| a980e32581 | |||
| da2fea338a | |||
| 7cb70f5fa1 | |||
| d04db3d38b | |||
| 35c260877f | |||
| 8cf7ec9cfe | |||
| c67087d750 | |||
| 2336b4723c | |||
| da61734860 | |||
| a911354f24 | |||
| ae902443db | |||
| 5547c3ed24 | |||
| e844cdf4f6 | |||
| 2fa5cfa508 | |||
| 59792173e7 | |||
| ed68482b4e | |||
| 32592987c8 | |||
| a1f92638e3 | |||
| 7d50818ee1 | |||
| d0e1f3b66a | |||
| cb91f991a3 | |||
| a49d7b12cb | |||
| eda7b55bac | |||
| bcf99d5998 | |||
| 3ab6706993 | |||
| c40e9c3996 | |||
| 7be23b7e37 | |||
| d9c18a6072 | |||
| 73099b82e8 | |||
| fc1d7ea89b | |||
| 391f2822c8 | |||
| f0875c5d85 | |||
| f6ef706909 | |||
| 7656c25e38 | |||
| 5cf1edeb6e | |||
| 9e544a6443 | |||
| 225b7c38c1 | |||
| 994866461c | |||
| fc4b884d0e | |||
| 9b3ecfe777 | |||
| 20794981b3 | |||
| 01413dd3cc | |||
| 9d1fe6102c | |||
| 2472a41561 | |||
| 65fbdcfa87 | |||
| 25cec015e8 | |||
| 62e3c8c4f8 | |||
| 8902c1f038 | |||
| 6c43bcc3e0 | |||
| 15b37c1e38 | |||
| 29fcdc5f40 | |||
| 1075bb1dbc | |||
| dccb0ee313 | |||
| aea86906f4 | |||
| a62698a14a | |||
| 47af43c281 | |||
| ae2c82adbc | |||
| 594b1a136d | |||
| ae46cc7f73 | |||
| 6b2aad734e | |||
| 98ccbe2b06 | |||
| 5ae100fea2 | |||
| 0052dd29a7 | |||
| 50a42d2cbf | |||
| 49cb6a07a2 | |||
| ed7c4dc2e1 | |||
| c376fb0a2b | |||
| 76d9e58ae5 | |||
| 3769cc1a35 | |||
| 74ace7d4b9 | |||
| 647245a71f | |||
| a634c7be65 | |||
| f656e3195f | |||
| 8811545472 | |||
| cad3850f3d | |||
| 7de058ba35 | |||
| ddaa001daf | |||
| 51c049e1a7 | |||
| 93472f84bd | |||
| 678d27fdb7 | |||
| 369ca89c2e | |||
| 421db75528 | |||
| 846b56c724 | |||
| e62d2fe56e | |||
| bb3abab784 | |||
| da6543d17b | |||
| 29a018088e | |||
| 7e7fc757d5 | |||
| d3a6bdc68b | |||
| 402e42fd15 | |||
| 5007b72b28 | |||
| 9931ec2994 | |||
| 5f3dfc2960 | |||
| dc9e81a6fc | |||
| ed719c80e7 | |||
| 77dc2e4746 | |||
| c5f4c8d174 | |||
| 6ba49642d0 | |||
| 9a2ef9dc00 | |||
| 6ccf0a3428 | |||
| 23e303aaa2 | |||
| 098157dca8 | |||
| 827469600e | |||
| bf718e8698 | |||
| 326f1a9c8b | |||
| 793c438286 | |||
| 6b1f323bb5 | |||
| 761849083d | |||
| ae6ddf295a | |||
| b591e8cdc8 | |||
| 379b2ccf92 | |||
| 3fb4cf56b6 | |||
| fdc62daa8b | |||
| 05094b0da5 | |||
| 4ab8a70b21 | |||
| c88a3fffd5 | |||
| 7b1ae9602d | |||
| c7a22dff87 | |||
| 45ee7c12d0 | |||
| 392b591d09 | |||
| 556a4375e2 | |||
| eab583310d | |||
| 077ae27369 | |||
| d4e1c958e2 | |||
| 33ae442aa1 | |||
| 1285c7f0ca | |||
| 8c72892de1 | |||
| dc751bd2f1 | |||
| 0cde0aee34 | |||
| 503bda5b28 | |||
| a4d5c40d63 | |||
| 8e219bdd77 | |||
| 5acc93dd34 | |||
| 276247b463 | |||
| d277f49423 | |||
| 67bd2c6b2d | |||
| 784683a68d | |||
| 3b2094301d | |||
| 6572754c10 | |||
| f157ea3fdb | |||
| ddd7fe6f05 | |||
| 47a351acb2 | |||
| ff9f670871 | |||
| f33f7d98c4 | |||
| c49f03f985 | |||
| 6b5f583ff3 | |||
| 8e3ab0d10b | |||
| a049092526 | |||
| b6407afa06 | |||
| fbd3cda320 | |||
| 05341828b5 | |||
| 280ba89b26 | |||
| fe7fcc2dc3 | |||
| dcd34d3728 | |||
| dced01fc24 | |||
| cdec0a3f96 | |||
| 1075f3b457 | |||
| c1077faa28 | |||
| 76ba147c22 | |||
| 1c1a216df1 | |||
| 04f96a54b8 | |||
| 5f72d1fda5 | |||
| dfff54425b | |||
| 0edd26467e | |||
| e71c890cf5 | |||
| eada35df36 | |||
| 8d4a08ccc1 | |||
| 9dec093676 | |||
| f711dd3460 | |||
| 7a865b6b28 | |||
| faaaae365a | |||
| 705d1efeab | |||
| c0f60d56a1 | |||
| a4468dd56e | |||
| 337f361526 | |||
| 26a048e5c4 | |||
| ccd41e7efe | |||
| a1a5ba0723 | |||
| 8a6962fc36 | |||
| f23bad140b | |||
| 1bfafd9eb6 | |||
| 1bdb756b25 | |||
| 80c573eed7 | |||
| 78607ea60c | |||
| 0110214abc | |||
| 54d8695e70 | |||
| a2441fd326 | |||
| 831a1d15d5 | |||
| 6b5df8e62f | |||
| 0210cf2b17 | |||
| f0708340ef | |||
| a44bf31d27 | |||
| 002f00d7eb | |||
| ded89b0d49 | |||
| 36b1166cf6 | |||
| 0e7bd9f3ba | |||
| 7963534940 | |||
| d33a0f75a5 | |||
| 368d469631 | |||
| efd3c04f37 | |||
| 5fe6f0b2ec | |||
| 5d6fb2427e | |||
| ad3d1d381a | |||
| b51f60cc1e | |||
| 504232b388 | |||
| 8f36f65f39 | |||
| ff3e396e92 | |||
| 2fe387b4f0 | |||
| 9ec482b7c2 | |||
| 53e8cd18dc | |||
| ac57f41c87 | |||
| 8b78b6bb10 | |||
| 52fa66820c | |||
| 72eb2ccf50 | |||
| 4cfd468863 | |||
| 0cf8d73395 | |||
| 53b2bdfe5e | |||
| 27ab6a686c | |||
| 22c8297a03 | |||
| d22e86376b | |||
| fb56b3a53f | |||
| 0c47017046 | |||
| 792091b23c | |||
| b917361de8 | |||
| a0a54fdfe0 | |||
| d90d5d538b | |||
| c2ae76248e | |||
| 9aa71af1e5 | |||
| b64abebd24 | |||
| 90930619bc | |||
| 5b1c823019 | |||
| b2b4f21e39 | |||
| 22e55165c9 | |||
| 35c2256849 | |||
| 3a10fca75f | |||
| a39947cd3c | |||
| 1730bfb2bc | |||
| 26a4a13cdf | |||
| 36f357c354 | |||
| b07928eea9 | |||
| 1ef7480380 | |||
| e4c2dcc0c7 | |||
| 7bdad857e4 | |||
| c2a8ad26af | |||
| fedf235c83 | |||
| e88d2c2031 | |||
| 20e4685057 | |||
| ca55e15d44 | |||
| bb5e4127d7 | |||
| 30028a2404 | |||
| 6883309927 | |||
| 9c8570ac68 | |||
| 4dfc0f952f | |||
| d6e1b92059 | |||
| bb5f4555dc | |||
| 32d33ca8e5 | |||
| e1dcf24c98 | |||
| 3b24311db6 | |||
| 8fd3fc7c13 | |||
| 8d27b25bf8 | |||
| 727b35536f | |||
| bbe667dc74 | |||
| 3608d42ae9 | |||
| 8f33933dd8 | |||
| e5efe42ecb | |||
| 10e21bfeda | |||
| 00256fdba8 | |||
| 3b8fb7bb88 | |||
| 1057fa8421 | |||
| fca9ec085e | |||
| ef5c6684c7 | |||
| e0438e3a7e | |||
| 04632bd381 | |||
| 0b9db15efc | |||
| d5b2f9cfa7 | |||
| 727c3d5b75 | |||
| eddb7684c1 | |||
| 484baba6ad | |||
| 88f10a2c3c | |||
| ffa1c976f5 | |||
| 4fdc157f68 | |||
| 0a950669cb | |||
| 1232018332 | |||
| 6237613439 | |||
| 4424abd15d | |||
| 76a0471c29 | |||
| e08422a4ea | |||
| 757ff06011 | |||
| 06defe014b | |||
| 63bf134321 | |||
| 2113494274 | |||
| 912f068fe4 | |||
| 8f5d786f0e | |||
| 1dacc648a0 | |||
| 3af786d4c9 | |||
| e57b470e83 | |||
| b8b63ff115 | |||
| 959a3f3cca | |||
| 0a111c1976 | |||
| 4b68f0447c | |||
| 31914b200b | |||
| ebb3fca698 | |||
| 7f72b466ac | |||
| 4751c735ec | |||
| bda3b1fa3a | |||
| 4ec10d798b | |||
| 3dd21e4dcd | |||
| 682d76835e | |||
| 42aa367f16 | |||
| ec8a1bcc82 | |||
| 2d9541c4c8 | |||
| e747ba6c26 | |||
| 4431a34987 | |||
| 14d7de0cf3 | |||
| cd28fdc192 | |||
| 25fe9c7084 | |||
| 94fc2ba9c9 | |||
| 2f87b8e430 | |||
| eff61c7a97 | |||
| 7c96227cd3 | |||
| dcfae6332e | |||
| 69437bb324 | |||
| 7551245f57 | |||
| 47bc551485 | |||
| 87478187af | |||
| 7042223f2e | |||
| 93698f0d61 | |||
| f7aa837696 | |||
| e1d1d18288 | |||
| 20a6f82753 | |||
| aec6cac8ca | |||
| ffca6a762d | |||
| 2d2ab4fec4 | |||
| a434baed91 | |||
| f14a3dfb8a | |||
| b19a3af4db | |||
| 89428a9d10 | |||
| b937d6310d | |||
| ad37bc9639 | |||
| 56df1abdd8 | |||
| 0ea5e57298 | |||
| 3838eb1f05 | |||
| 9ba7196881 | |||
| 1e71303ffa | |||
| 74117a1e1e | |||
| 38ad523f91 | |||
| a71e2fb64e | |||
| 1b20ec8747 | |||
| d30e53ee2c | |||
| aa57ad6082 | |||
| 097893bfbf | |||
| 16019c9827 | |||
| f391100586 | |||
| c4a1e1bb0c | |||
| 7e3b5bed50 | |||
| c9c477ff9d | |||
| 4eb7db80a6 | |||
| 9d6626f70c | |||
| 5c07863ad5 | |||
| 3060375251 | |||
| 3c63e44d32 | |||
| 02d943bfb0 | |||
| 4c8fef264e | |||
| 082cf8ace8 | |||
| 1fd193840d | |||
| b1f8e910eb |
@@ -0,0 +1,37 @@
|
||||
Adam <adam@anope.org> <adam-@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Adam <adam@anope.org> <adam@adam-laptop.(none)>
|
||||
Adam <adam@anope.org> <Adam@anope.org>
|
||||
Adam <adam@anope.org> <Adam@drink-coca-cola.info>
|
||||
Adam <adam@anope.org> <Adam@sigterm.info>
|
||||
Adam Kramer <ribosome@anope.org> <ribosome ribosome@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Alvaro Toledo <atoledo@keldon.org> <atoledo atoledo@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Björn Stiddien <keeper@anope.org> <keeper keeper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Charles Kingsley <chaz@anope.org>
|
||||
Charles Kingsley <chaz@anope.org> <sjaz@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Daniel Engel <dane@zero.org> <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
David Robson <rob@anope.org> <robbeh@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
David Robson <rob@anope.org> <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Dennis Friis <peavey@inspircd.org> <peavey peavey@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Fabio Scotoni <cculex@gmail.com>
|
||||
Florian Schulze <certus@anope.org> <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Gabriel Acevedo H. <drstein@anope.org> <drstein drstein@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Jan Milants <viper@anope.org>
|
||||
Jan Milants <viper@anope.org> <jantje_85@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Jan Milants <viper@anope.org> <viper viper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Jens Voss <dukepyrolator@anope.org> <anope@s15355730.onlinehome-server.info>
|
||||
Jens Voss <dukepyrolator@anope.org> <DukePyrolator@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Jens Voss <dukepyrolator@anope.org> <DukePyrolator@anope.org>
|
||||
Jens Voss <dukepyrolator@anope.org> Jens Voß <jens@pyrobook.(none)>
|
||||
Lee Holmes <lethality@anope.org>
|
||||
Mark Summers <mark@goopler.net> <mark mark@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Naram Qashat <cyberbotx@anope.org> <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Naram Qashat <cyberbotx@anope.org> <cyberbotx@cyberbotx.com>
|
||||
Naram Qashat <cyberbotx@anope.org> <Naram Qashat cyberbotx@cyberbotx.com@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Pieter Bootsma <geniusdex@anope.org> <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Robby <robby@chat.be>
|
||||
Robin Burchell <w00t@inspircd.org> <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Robin Burchell <w00t@inspircd.org> <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Sebastian V. <hal9000@denorastats.org>
|
||||
Sebastian V. <hal9000@denorastats.org> <pimpmylinux@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
(svnadmin) <svn@localhost> <svn svn@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
Trystan S. Lee <trystan@nomadirc.net> <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>
|
||||
+23
-19
@@ -80,7 +80,7 @@ set(DEFAULT_LIBRARY_DIRS)
|
||||
set(DEFAULT_INCLUDE_DIRS)
|
||||
|
||||
# If we are using a GNU compiler (have to use CXX because it seems to fail on C), we will be able to determine it's default paths for libraries and includes
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
# First look for the compiler's default library directories
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs OUTPUT_VARIABLE LINES OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
# Find only the part after "libraries: "
|
||||
@@ -132,6 +132,8 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
string(LENGTH ${LINE} LINE_LENGTH)
|
||||
math(EXPR LINE_LENGTH "${LINE_LENGTH} - 1")
|
||||
string(SUBSTRING ${LINE} 1 ${LINE_LENGTH} INCLUDE)
|
||||
# For systems like Mac OS X, look for include paths that say " (framework directory)" at the end of them and strip that off
|
||||
string(REGEX REPLACE " \\(framework directory\\)$" "" INCLUDE ${INCLUDE})
|
||||
# Convert the path to an absolute one, just in case it wasn't
|
||||
get_filename_component(INCLUDE ${INCLUDE} ABSOLUTE)
|
||||
# Add that directory to the list of default include directories
|
||||
@@ -144,7 +146,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(DEFAULT_INCLUDE_DIRS)
|
||||
remove_list_duplicates(DEFAULT_INCLUDE_DIRS)
|
||||
endif(DEFAULT_INCLUDE_DIRS)
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
|
||||
# If we are using Visual Studio, locate the path of the Windows Server 2008 SDK or Windows Server 2003 Platform SDK, depending on which is installed
|
||||
if(MSVC)
|
||||
@@ -207,12 +209,16 @@ else(CMAKE244_OR_BETTER)
|
||||
include(TestCXXAcceptsFlag)
|
||||
endif(CMAKE244_OR_BETTER)
|
||||
|
||||
# If extra directories were specified, tell cmake about them.
|
||||
# If extra include directories were specified, tell cmake about them.
|
||||
if(EXTRA_INCLUDE)
|
||||
include_directories(${EXTRA_INCLUDE})
|
||||
link_directories(${EXTRA_INCLUDE})
|
||||
endif(EXTRA_INCLUDE)
|
||||
|
||||
# If extra library directories were specified, tell cmake about them.
|
||||
if(EXTRA_LIBS)
|
||||
link_directories(${EXTRA_LIBS})
|
||||
endif(EXTRA_LIBS)
|
||||
|
||||
# Find gettext
|
||||
find_package(Gettext)
|
||||
|
||||
@@ -308,7 +314,9 @@ if(NOT MSVC)
|
||||
# Check if pthread_create is within the pthread library (if the library exists), and add it to the linker flags if needed
|
||||
check_library_exists(pthread pthread_create "" HAVE_PTHREAD)
|
||||
if(HAVE_PTHREAD)
|
||||
set(LDFLAGS "${LDFLAGS} -pthread")
|
||||
if(NOT APPLE)
|
||||
set(LDFLAGS "${LDFLAGS} -pthread")
|
||||
endif(NOT APPLE)
|
||||
else(HAVE_PTHREAD)
|
||||
message(FATAL_ERROR "The pthread library is required to build Anope")
|
||||
endif(HAVE_PTHREAD)
|
||||
@@ -335,7 +343,6 @@ check_include_file(stdint.h HAVE_STDINT_H)
|
||||
check_include_file(strings.h HAVE_STRINGS_H)
|
||||
|
||||
# Check for the existance of the following functions
|
||||
check_function_exists(setgrent HAVE_SETGRENT)
|
||||
check_function_exists(strcasecmp HAVE_STRCASECMP)
|
||||
check_function_exists(stricmp HAVE_STRICMP)
|
||||
check_function_exists(umask HAVE_UMASK)
|
||||
@@ -343,13 +350,6 @@ check_function_exists(epoll_wait HAVE_EPOLL)
|
||||
check_function_exists(poll HAVE_POLL)
|
||||
check_function_exists(kqueue HAVE_KQUEUE)
|
||||
|
||||
# Check if eventfd works
|
||||
try_run(EVENTFD_TEST_RUN_RESULT EVENTFD_TEST_COMPILE_RESULT ${CMAKE_CURRENT_BINARY_DIR} ${Anope_SOURCE_DIR}/cmake/eventfd_test.cpp)
|
||||
set(HAVE_EVENTFD FALSE)
|
||||
if (EVENTFD_TEST_COMPILE_RESULT AND EVENTFD_TEST_RUN_RESULT EQUAL 1)
|
||||
set(HAVE_EVENTFD TRUE)
|
||||
endif(EVENTFD_TEST_COMPILE_RESULT AND EVENTFD_TEST_RUN_RESULT EQUAL 1)
|
||||
|
||||
# Strip the leading and trailing spaces from the compile flags
|
||||
if(CXXFLAGS)
|
||||
strip_string(${CXXFLAGS} CXXFLAGS)
|
||||
@@ -481,14 +481,14 @@ get_target_property(SERVICES_BINARY ${PROGRAM_NAME} LOCATION)
|
||||
get_filename_component(SERVICES_BINARY ${SERVICES_BINARY} NAME)
|
||||
|
||||
# At install time, create the following additional directories
|
||||
install(CODE "file(MAKE_DIRECTORY \"${DB_DIR}/backups\")")
|
||||
install(CODE "file(MAKE_DIRECTORY \"${LOGS_DIR}\")")
|
||||
install(CODE "file(MAKE_DIRECTORY \"${LIB_DIR}/modules/runtime\")")
|
||||
install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/backups\")")
|
||||
install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${LOGS_DIR}\")")
|
||||
install(CODE "file(MAKE_DIRECTORY \"\${CMAKE_INSTALL_PREFIX}/${DB_DIR}/runtime\")")
|
||||
# On non-Windows platforms, if RUNGROUP is set, change the permissions of the below directories, as well as the group of the data directory
|
||||
if(NOT WIN32 AND RUNGROUP)
|
||||
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${DB_DIR}/backups\")")
|
||||
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${LOGS_DIR}\")")
|
||||
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${LIB_DIR}/modules/runtime\")")
|
||||
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/\${DB_DIR}/backups\")")
|
||||
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/\${LOGS_DIR}\")")
|
||||
install(CODE "execute_process(COMMAND ${CHMOD} 2775 \"\${CMAKE_INSTALL_PREFIX}/\${DB_DIR}/runtime\")")
|
||||
install(CODE "execute_process(COMMAND ${CHGRP} -R ${RUNGROUP} \"\${CMAKE_INSTALL_PREFIX}\")")
|
||||
endif(NOT WIN32 AND RUNGROUP)
|
||||
# On Windows platforms, install extra files
|
||||
@@ -512,6 +512,10 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||
#set(CPACK_RESOURCE_FILE_README "${Anope_SOURCE_DIR}/docs/README")
|
||||
# The following is primarily for NSIS
|
||||
if(WIN32)
|
||||
# By default, do not warn when built on machines using only VS Express:
|
||||
IF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
|
||||
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
|
||||
ENDIF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
|
||||
# Also for Windows, include installing the MSVCRT library
|
||||
include(InstallRequiredSystemLibraries)
|
||||
set(CPACK_GENERATOR "NSIS")
|
||||
|
||||
@@ -40,7 +40,8 @@ Run_Build_System () {
|
||||
WITH_INST=""
|
||||
WITH_RUN=""
|
||||
WITH_PERM=""
|
||||
RUN_CC_PL=""
|
||||
EXTRA_INCLUDE=""
|
||||
EXTRA_LIBS=""
|
||||
GEN_TYPE=""
|
||||
|
||||
if [ "$INSTDIR" != "" ] ; then
|
||||
@@ -73,6 +74,14 @@ Run_Build_System () {
|
||||
PCH="-DUSE_PCH:BOOLEAN=OFF"
|
||||
fi
|
||||
|
||||
if [ "$EXTRA_INCLUDE_DIRS" != "" ] ; then
|
||||
EXTRA_INCLUDE="-DEXTRA_INCLUDE:STRING=$EXTRA_INCLUDE_DIRS"
|
||||
fi
|
||||
|
||||
if [ "$EXTRA_LIB_DIRS" != "" ] ; then
|
||||
EXTRA_LIBS="-DEXTRA_LIBS:STRING=$EXTRA_LIB_DIRS"
|
||||
fi
|
||||
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
GEN_TYPE="-G\"MSYS Makefiles\""
|
||||
@@ -88,9 +97,9 @@ Run_Build_System () {
|
||||
REAL_SOURCE_DIR="$SOURCE_DIR"
|
||||
fi
|
||||
|
||||
echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $PCH $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR"
|
||||
echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $PCH $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR"
|
||||
|
||||
cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $PCH $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR
|
||||
cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $PCH $EXTRA_INCLUDE $EXTRA_LIBS $EXTRA_CONFIG_ARGS $REAL_SOURCE_DIR
|
||||
|
||||
echo ""
|
||||
if [ "$SOURCE_DIR" = "." ] ; then
|
||||
@@ -124,6 +133,8 @@ UMASK=
|
||||
DEBUG="yes"
|
||||
USE_RUN_CC_PL="no"
|
||||
USE_PCH="no"
|
||||
EXTRA_INCLUDE_DIRS=
|
||||
EXTRA_LIB_DIRS=
|
||||
EXTRA_CONFIG_ARGS=
|
||||
CAN_QUICK="no"
|
||||
SOURCE_DIR=`dirname $0`
|
||||
@@ -240,7 +251,7 @@ export ok INPUT
|
||||
####
|
||||
|
||||
ok=0
|
||||
echo "In what directory do you want the binaries to be installed?"
|
||||
echo "In what directory should Anope be installed?"
|
||||
while [ $ok -eq 0 ] ; do
|
||||
echo2 "[$INSTDIR] "
|
||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||
@@ -386,14 +397,52 @@ echo ""
|
||||
|
||||
####
|
||||
|
||||
echo "Are there any extra arguments you wish to pass to cmake?"
|
||||
echo "You may only need to do this if cmake is unable to locate"
|
||||
echo "Are there any extra include directories you wish to use?"
|
||||
echo "You may only need to do this if CMake is unable to locate"
|
||||
echo "missing dependencies without hints."
|
||||
echo "You can do this by: -DEXTRA_INCLUDE:STRING=/path/to/files;/path/to/more/files"
|
||||
echo "Separate directories with semicolons."
|
||||
echo "If you need no extra include directories, enter NONE in all caps."
|
||||
echo2 "[$EXTRA_INCLUDE_DIRS] "
|
||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||
if [ "$INPUT" ] ; then
|
||||
if [ "$INPUT" = "NONE" ] ; then
|
||||
EXTRA_INCLUDE_DIRS=""
|
||||
else
|
||||
EXTRA_INCLUDE_DIRS=$INPUT
|
||||
fi
|
||||
fi
|
||||
echo ""
|
||||
|
||||
####
|
||||
|
||||
echo "Are there any extra library directories you wish to use?"
|
||||
echo "You may only need to do this if CMake is unable to locate"
|
||||
echo "missing dependencies without hints."
|
||||
echo "Separate directories with semicolons."
|
||||
echo "If you need no extra library directories, enter NONE in all caps."
|
||||
echo2 "[$EXTRA_LIB_DIRS] "
|
||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||
if [ "$INPUT" ] ; then
|
||||
if [ "$INPUT" = "NONE" ] ; then
|
||||
EXTRA_LIB_DIRS=""
|
||||
else
|
||||
EXTRA_LIB_DIRS=$INPUT
|
||||
fi
|
||||
fi
|
||||
echo ""
|
||||
|
||||
####
|
||||
|
||||
echo "Are there any extra arguments you wish to pass to CMake?"
|
||||
echo "If you need no extra arugments to CMake, enter NONE in all caps."
|
||||
echo2 "[$EXTRA_CONFIG_ARGS] "
|
||||
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
|
||||
if [ "$INPUT" ] ; then
|
||||
EXTRA_CONFIG_ARGS=$INPUT
|
||||
if [ "$INPUT" = "NONE" ] ; then
|
||||
EXTRA_CONFIG_ARGS=""
|
||||
else
|
||||
EXTRA_CONFIG_ARGS=$INPUT
|
||||
fi
|
||||
fi
|
||||
echo ""
|
||||
|
||||
@@ -412,6 +461,8 @@ UMASK=$UMASK
|
||||
DEBUG="$DEBUG"
|
||||
USE_RUN_CC_PL="$USE_RUN_CC_PL"
|
||||
USE_PCH="$USE_PCH"
|
||||
EXTRA_INCLUDE_DIRS="$EXTRA_INCLUDE_DIRS"
|
||||
EXTRA_LIB_DIRS="$EXTRA_LIB_DIRS"
|
||||
EXTRA_CONFIG_ARGS="$EXTRA_CONFIG_ARGS"
|
||||
EOT
|
||||
echo "done."
|
||||
|
||||
BIN
Binary file not shown.
+27
-15
@@ -359,18 +359,18 @@ macro(find_includes SRC INCLUDES)
|
||||
endmacro(find_includes)
|
||||
|
||||
###############################################################################
|
||||
# calculate_depends(<source filename> <output variable set to TRUE on fail> [<optional output variable for includes>])
|
||||
# calculate_depends(<source filename> <output variable set to TRUE on fail> <TRUE to output error messages> [<optional output variable for includes>])
|
||||
#
|
||||
# This macro is used in most of the src (sub)directories to calculate the
|
||||
# header file dependencies for the given source file.
|
||||
###############################################################################
|
||||
macro(calculate_depends SRC SKIP)
|
||||
# Temporarily set that we didn't get a 3nd argument before we actually check if we did get one or not
|
||||
macro(calculate_depends SRC SKIP VERBOSE)
|
||||
# Temporarily set that we didn't get a 3rd argument before we actually check if we did get one or not
|
||||
set(CHECK_ANGLE_INCLUDES FALSE)
|
||||
# Check for a third argument
|
||||
if(${ARGC} GREATER 2)
|
||||
if(${ARGC} GREATER 3)
|
||||
set(CHECK_ANGLE_INCLUDES TRUE)
|
||||
endif(${ARGC} GREATER 2)
|
||||
endif(${ARGC} GREATER 3)
|
||||
# Find all the lines in the given source file that have any form of #include on them, regardless of whitespace, but only if they are valid for the platform we are on
|
||||
find_includes(${SRC} INCLUDES)
|
||||
# Reset the list of headers to empty
|
||||
@@ -392,16 +392,26 @@ macro(calculate_depends SRC SKIP)
|
||||
endif(DEFAULT_INCLUDE_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||
# If the include file was found, add it's path to the list of include paths, but only if it doesn't already exist and isn't in the defaults for the compiler
|
||||
if(FOUND_${FILENAME}_INCLUDE)
|
||||
find_in_list(DEFAULT_INCLUDE_DIRS "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_DEFAULTS)
|
||||
# This used to be find_in_list, but it was changed to this loop to do a find on each default include directory, this fixes Mac OS X trying to get it's framework directories in here
|
||||
set(FOUND_IN_DEFAULTS -1)
|
||||
foreach(DEFAULT_INCLUDE_DIR ${DEFAULT_INCLUDE_DIRS})
|
||||
string(REGEX REPLACE "\\+" "\\\\+" DEFAULT_INCLUDE_DIR ${DEFAULT_INCLUDE_DIR})
|
||||
string(REGEX MATCH ${DEFAULT_INCLUDE_DIR} FOUND_DEFAULT ${FOUND_${FILENAME}_INCLUDE})
|
||||
if(FOUND_DEFAULT)
|
||||
set(FOUND_IN_DEFAULTS 0)
|
||||
endif(FOUND_DEFAULT)
|
||||
endforeach(DEFAULT_INCLUDE_DIR)
|
||||
if(FOUND_IN_DEFAULTS EQUAL -1)
|
||||
find_in_list(${ARGV2} "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_INCLUDES)
|
||||
find_in_list(${ARGV3} "${FOUND_${FILENAME}_INCLUDE}" FOUND_IN_INCLUDES)
|
||||
if(FOUND_IN_INCLUDES EQUAL -1)
|
||||
append_to_list(${ARGV2} "${FOUND_${FILENAME}_INCLUDE}")
|
||||
append_to_list(${ARGV3} "${FOUND_${FILENAME}_INCLUDE}")
|
||||
endif(FOUND_IN_INCLUDES EQUAL -1)
|
||||
endif(FOUND_IN_DEFAULTS EQUAL -1)
|
||||
else(FOUND_${FILENAME}_INCLUDE)
|
||||
set(${SKIP} TRUE)
|
||||
message("${SRC} needs header file ${FILENAME} but we were unable to locate that header file! Check that the header file is within the search path of your OS.")
|
||||
if(VERBOSE)
|
||||
message("${SRC} needs header file ${FILENAME} but we were unable to locate that header file! Check that the header file is within the search path of your OS.")
|
||||
endif(VERBOSE)
|
||||
endif(FOUND_${FILENAME}_INCLUDE)
|
||||
endif(CHECK_ANGLE_INCLUDES)
|
||||
endif(QUOTE_TYPE STREQUAL "angle brackets")
|
||||
@@ -409,12 +419,12 @@ macro(calculate_depends SRC SKIP)
|
||||
endmacro(calculate_depends)
|
||||
|
||||
###############################################################################
|
||||
# calculate_libraries(<source filename> <output variable set to TRUE on fail> <output variable for linker flags> <output variable for extra depends>)
|
||||
# calculate_libraries(<source filename> <output variable set to TRUE on fail> <TRUE to output error messages> <output variable for linker flags> <output variable for extra depends>)
|
||||
#
|
||||
# This macro is used in most of the module (sub)directories to calculate the
|
||||
# library dependencies for the given source file.
|
||||
###############################################################################
|
||||
macro(calculate_libraries SRC SKIP SRC_LDFLAGS EXTRA_DEPENDS)
|
||||
macro(calculate_libraries SRC SKIP VERBOSE SRC_LDFLAGS EXTRA_DEPENDS)
|
||||
# Set up a temporary LDFLAGS for this file
|
||||
set(THIS_LDFLAGS "${LDFLAGS}")
|
||||
# Reset extra dependencies
|
||||
@@ -437,9 +447,9 @@ macro(calculate_libraries SRC SKIP SRC_LDFLAGS EXTRA_DEPENDS)
|
||||
foreach(LIBRARY ${REQUIRED_LIBRARY})
|
||||
# Locate the library to see if it exists
|
||||
if(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib ${EXTRA_INCLUDE})
|
||||
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib ${EXTRA_INCLUDE} ${EXTRA_LIBS})
|
||||
else(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} ${EXTRA_INCLUDE})
|
||||
find_library(FOUND_${LIBRARY}_LIBRARY NAMES ${LIBRARY} ${EXTRA_INCLUDE} ${EXTRA_LIBS})
|
||||
endif(DEFAULT_LIBRARY_DIRS OR WSDK_PATH OR DEFINED $ENV{VCINSTALLDIR})
|
||||
# If the library was found, we will add it to the linker flags
|
||||
if(FOUND_${LIBRARY}_LIBRARY)
|
||||
@@ -456,8 +466,10 @@ macro(calculate_libraries SRC SKIP SRC_LDFLAGS EXTRA_DEPENDS)
|
||||
else(FOUND_${LIBRARY}_LIBRARY)
|
||||
# Skip this file
|
||||
set(${SKIP} TRUE)
|
||||
# In the case of the library not being found, we fatally error so CMake stops trying to generate
|
||||
message("${SRC} needs library ${LIBRARY} but we were unable to locate that library! Check that the library is within the search path of your OS.")
|
||||
if(VERBOSE)
|
||||
# In the case of the library not being found, we fatally error so CMake stops trying to generate
|
||||
message(FATAL_ERROR "${SRC} needs library ${LIBRARY} but we were unable to locate that library! Check that the library is within the search path of your OS.")
|
||||
endif(VERBOSE)
|
||||
endif(FOUND_${LIBRARY}_LIBRARY)
|
||||
endforeach(LIBRARY)
|
||||
endforeach(REQUIRED_LIBRARY)
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
# Find the header files, libs, and executables for gettext
|
||||
if(NOT WIN32)
|
||||
find_path(GETTEXT_INCLUDE libintl.h /usr/include /usr/local/include ${EXTRA_INCLUDE})
|
||||
find_library(GETTEXT_LIBRARY intl PATHS /usr/lib /usr/lib64 ${EXTRA_INCLUDE})
|
||||
find_library(GETTEXT_LIBRARY intl PATHS /usr/lib /usr/lib64 ${EXTRA_LIBS})
|
||||
find_library(ICONV_LIBRARY iconv PATHS /usr/lib /usr/lib64 ${EXTRA_LIBS})
|
||||
find_program(GETTEXT_MSGFMT msgfmt PATHS /usr/bin/ /usr/local/bin ${EXTRA_INCLUDE})
|
||||
if(GETTEXT_INCLUDE AND GETTEXT_MSGFMT)
|
||||
set(GETTEXT_FOUND TRUE)
|
||||
endif(GETTEXT_INCLUDE AND GETTEXT_MSGFMT)
|
||||
else(NOT WIN32)
|
||||
find_path(GETTEXT_INCLUDE libintl.h ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/include $ENV{VCINSTALLDIR}/include gettext/include ${EXTRA_INCLUDE})
|
||||
find_library(GETTEXT_LIBRARY libintl PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_INCLUDE})
|
||||
find_library(ICONV_LIBRARY libiconv PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_INCLUDE})
|
||||
find_library(MINGWEX_LIBRARY libmingwex PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_INCLUDE})
|
||||
find_library(GCC_LIBRARY libgcc PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_INCLUDE})
|
||||
find_library(GETTEXT_LIBRARY libintl PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
|
||||
find_library(ICONV_LIBRARY libiconv PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
|
||||
find_library(MINGWEX_LIBRARY libmingwex PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
|
||||
find_library(GCC_LIBRARY libgcc PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
|
||||
find_program(GETTEXT_MSGFMT msgfmt PATHS ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/bin $ENV{VCINSTALLDIR}/bin gettext/bin ${EXTRA_INCLUDE})
|
||||
if(GETTEXT_INCLUDE AND GETTEXT_MSGFMT AND ICONV_LIBRARY AND MINGWEX_LIBRARY AND GCC_LIBRARY)
|
||||
set(GETTEXT_FOUND TRUE)
|
||||
@@ -27,7 +28,7 @@ if(GETTEXT_FOUND)
|
||||
set(GETTEXT_LIBRARIES libiconv libintl libmingwex libgcc)
|
||||
else(WIN32)
|
||||
if(GETTEXT_LIBRARY)
|
||||
set(GETTEXT_LIBRARIES ${GETTEXT_LIBRARY})
|
||||
set(GETTEXT_LIBRARIES ${GETTEXT_LIBRARY} ${ICONV_LIBRARY})
|
||||
endif(GETTEXT_LIBRARY)
|
||||
endif(WIN32)
|
||||
endif(GETTEXT_FOUND)
|
||||
|
||||
@@ -525,7 +525,7 @@ FunctionEnd
|
||||
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
|
||||
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\docs\README.txt"
|
||||
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\doc\README.txt"
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#include <sys/eventfd.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int i = eventfd(0, EFD_NONBLOCK);
|
||||
return i >= 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
+65
-58
@@ -9,7 +9,7 @@
|
||||
service
|
||||
{
|
||||
/*
|
||||
* The name of the BotServ client
|
||||
* The name of the BotServ client.
|
||||
*/
|
||||
nick = "BotServ"
|
||||
|
||||
@@ -35,8 +35,8 @@ service
|
||||
* These modes are very IRCd specific. If left commented, sane defaults
|
||||
* are used based on what protocol module you have loaded.
|
||||
*
|
||||
* Note that setting this option incorrectly could potentially BREAK some if
|
||||
* not all usefulness of the client. We will not support you if this client is
|
||||
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||
* not all, usefulness of the client. We will not support you if this client is
|
||||
* unable to do certain things if this option is enabled.
|
||||
*/
|
||||
#modes = "+o"
|
||||
@@ -46,7 +46,7 @@ service
|
||||
* of log channels this is not very useful, as the service will just idle in the
|
||||
* specified channels, and will not accept any types of commands.
|
||||
*
|
||||
* Prefixes may be given to the channels in the form of mode character or prefix symbol.
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
}
|
||||
@@ -131,7 +131,7 @@ botserv
|
||||
#casesensitive = yes
|
||||
|
||||
/*
|
||||
* Defines the prefixs for fantasy commands in channels. One of these characters will have to be prepended
|
||||
* Defines the prefixes for fantasy commands in channels. One of these characters will have to be prepended
|
||||
* to all fantasy commands. If you choose "!", for example, fantasy commands will be "!kick",
|
||||
* "!op", etc. This directive is optional, if left out, the default fantasy character is "!".
|
||||
*/
|
||||
@@ -149,7 +149,7 @@ botserv
|
||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||
*/
|
||||
|
||||
/* Give it a help command */
|
||||
/* Give it a help command. */
|
||||
command { service = "BotServ"; name = "HELP"; command = "generic/help"; }
|
||||
|
||||
/*
|
||||
@@ -241,70 +241,77 @@ command { service = "BotServ"; name = "KICK"; command = "botserv/kick"; }
|
||||
/*
|
||||
* bs_set
|
||||
*
|
||||
* Provides the command botserv/set.
|
||||
* Provides the commands:
|
||||
* botserv/set/dontkickops - Used for preventing BotServ from kicking channel operators.
|
||||
* botserv/set/dontkickvoices - Used for preventing BotServ from kicking voices.
|
||||
* botserv/set/fantasy - Used for enabling or disabling BotServ's fantasist commands.
|
||||
* botserv/set/greet - Used for enabling or disabling BotServ's greet messages in a channel.
|
||||
* botserv/set/nobot - Used to prohibit specific channels from being assigned BotServ bots.
|
||||
* botserv/set/private - Used to prohibit specific BotServ bots from being assigned to channels.
|
||||
*
|
||||
* Used for setting options such as kickers and fantasy replies.
|
||||
*/
|
||||
module { name = "bs_set" }
|
||||
command { service = "BotServ"; name = "SET"; command = "botserv/set"; }
|
||||
|
||||
/*
|
||||
* bs_set_dontkickops
|
||||
*
|
||||
* Provides the command botserv/set/dontkickops.
|
||||
*
|
||||
* Used for preventing BotServ from kicking channel operators.
|
||||
*/
|
||||
module { name = "bs_set_dontkickops" }
|
||||
command { service = "BotServ"; name = "SET DONTKICKOPS"; command = "botserv/set/dontkickops"; }
|
||||
|
||||
/*
|
||||
* bs_set_dontkickvoices
|
||||
*
|
||||
* Provides the command botserv/set/dontkickvoices.
|
||||
*
|
||||
* Used for preventing BotServ from kicking voices.
|
||||
*/
|
||||
module { name = "bs_set_dontkickvoices" }
|
||||
command { service = "BotServ"; name = "SET DONTKICKVOICES"; command = "botserv/set/dontkickvoices"; }
|
||||
|
||||
/*
|
||||
* bs_set_fantasy
|
||||
*
|
||||
* Provides the command botserv/set/fantasy.
|
||||
*
|
||||
* Used for enabling or disabling BotServ's fantaisist commands.
|
||||
*/
|
||||
module { name = "bs_set_fantasy" }
|
||||
command { service = "BotServ"; name = "SET FANTASY"; command = "botserv/set/fantasy"; }
|
||||
|
||||
/*
|
||||
* bs_set_greet
|
||||
*
|
||||
* Provides the command botserv/set/greet.
|
||||
*
|
||||
* Used for enabling or disabling BotServ's greet messages in a channel.
|
||||
*/
|
||||
module { name = "bs_set_greet" }
|
||||
command { service = "BotServ"; name = "SET GREET"; command = "botserv/set/greet"; }
|
||||
command { service = "BotServ"; name = "SET NOBOT"; command = "botserv/set/nobot"; permission = "botserv/set/nobot"; }
|
||||
command { service = "BotServ"; name = "SET PRIVATE"; command = "botserv/set/private"; permission = "botserv/set/private"; }
|
||||
|
||||
/*
|
||||
* bs_set_nobot
|
||||
/* Fantasy commands
|
||||
*
|
||||
* Provides the command botserv/set/nobot.
|
||||
* Fantasy commands can be executed in channels that have a BotServ bot by prefixing the
|
||||
* command with one of the fantasy characters configured in botserv:fantasycharacter.
|
||||
*
|
||||
* Used by Services Operators to prohibit specific channels from being assigned BotServ bots.
|
||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||
*/
|
||||
module { name = "bs_set_nobot" }
|
||||
command { service = "BotServ"; name = "SET NOBOT"; command = "botserv/set/nobot"; }
|
||||
fantasy { name = "ACCESS"; command = "chanserv/access"; }
|
||||
fantasy { name = "AKICK"; command = "chanserv/akick"; }
|
||||
fantasy { name = "AOP"; command = "chanserv/aop"; }
|
||||
fantasy { name = "BAN"; command = "chanserv/ban"; }
|
||||
fantasy { name = "CLONE"; command = "chanserv/clone"; }
|
||||
fantasy { name = "DOWN"; command = "chanserv/down"; }
|
||||
fantasy { name = "ENFORCE"; command = "chanserv/enforce"; }
|
||||
fantasy { name = "ENTRYMSG"; command = "chanserv/entrymsg"; }
|
||||
fantasy { name = "FLAGS"; command = "chanserv/flags"; }
|
||||
fantasy { name = "HELP"; command = "generic/help"; prepend_channel = false; }
|
||||
fantasy { name = "HOP"; command = "chanserv/hop"; }
|
||||
fantasy { name = "INFO"; command = "chanserv/info"; prepend_channel = false; }
|
||||
fantasy { name = "INVITE"; command = "chanserv/invite"; }
|
||||
fantasy { name = "K"; command = "chanserv/kick"; }
|
||||
fantasy { name = "KB"; command = "chanserv/ban"; }
|
||||
fantasy { name = "KICK"; command = "chanserv/kick"; }
|
||||
fantasy { name = "LEVELS"; command = "chanserv/levels"; }
|
||||
fantasy { name = "LIST"; command = "chanserv/list"; prepend_channel = false; }
|
||||
fantasy { name = "LOG"; command = "chanserv/log"; }
|
||||
fantasy { name = "MODE"; command = "chanserv/mode"; }
|
||||
fantasy { name = "QOP"; command = "chanserv/qop"; }
|
||||
fantasy { name = "SEEN"; command = "chanserv/seen"; prepend_channel = false; }
|
||||
fantasy { name = "SOP"; command = "chanserv/sop"; }
|
||||
fantasy { name = "STATUS"; command = "chanserv/status"; }
|
||||
fantasy { name = "SUSPEND"; command = "chanserv/suspend"; permission = "chanserv/suspend"; }
|
||||
fantasy { name = "SYNC"; command = "chanserv/sync"; }
|
||||
fantasy { name = "TOPIC"; command = "chanserv/topic"; }
|
||||
fantasy { name = "UNBAN"; command = "chanserv/unban"; }
|
||||
fantasy { name = "UNSUSPEND"; command = "chanserv/unsuspend"; permission = "chanserv/suspend"; }
|
||||
fantasy { name = "UP"; command = "chanserv/up"; }
|
||||
fantasy { name = "VOP"; command = "chanserv/vop"; }
|
||||
|
||||
/*
|
||||
* bs_set_private
|
||||
*
|
||||
* Provides the command botserv/set/private.
|
||||
*
|
||||
* Used by Services Operators to prohibit specific BotServ bots from being assigned to channels.
|
||||
*/
|
||||
module { name = "bs_set_private" }
|
||||
command { service = "BotServ"; name = "SET PRIVATE"; command = "botserv/set/private"; }
|
||||
|
||||
/* Use m_rewrite to rewrite the op, deop, etc. fantasy commands (see chanserv.conf). */
|
||||
fantasy { name = "OWNER"; command = "rewrite"; }
|
||||
fantasy { name = "DEOWNER"; command = "rewrite"; }
|
||||
|
||||
fantasy { name = "PROTECT"; command = "rewrite"; }
|
||||
fantasy { name = "DEPROTECT"; command = "rewrite"; }
|
||||
|
||||
fantasy { name = "OP"; command = "rewrite"; }
|
||||
fantasy { name = "DEOP"; command = "rewrite"; }
|
||||
|
||||
fantasy { name = "HALFOP"; command = "rewrite"; }
|
||||
fantasy { name = "DEHALFOP"; command = "rewrite"; }
|
||||
|
||||
fantasy { name = "VOICE"; command = "rewrite"; }
|
||||
fantasy { name = "DEVOICE"; command = "rewrite"; }
|
||||
|
||||
+283
-261
@@ -9,7 +9,7 @@
|
||||
service
|
||||
{
|
||||
/*
|
||||
* The name of the ChanServ client
|
||||
* The name of the ChanServ client.
|
||||
*/
|
||||
nick = "ChanServ"
|
||||
|
||||
@@ -35,8 +35,8 @@ service
|
||||
* These modes are very IRCd specific. If left commented, sane defaults
|
||||
* are used based on what protocol module you have loaded.
|
||||
*
|
||||
* Note that setting this option incorrectly could potentially BREAK some if
|
||||
* not all usefulness of the client. We will not support you if this client is
|
||||
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||
* not all, usefulness of the client. We will not support you if this client is
|
||||
* unable to do certain things if this option is enabled.
|
||||
*/
|
||||
#modes = "+o"
|
||||
@@ -46,7 +46,7 @@ service
|
||||
* of log channels this is not very useful, as the service will just idle in the
|
||||
* specified channels, and will not accept any types of commands.
|
||||
*
|
||||
* Prefixes may be given to the channels in the form of mode character or prefix symbol.
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
}
|
||||
@@ -89,6 +89,7 @@ chanserv
|
||||
* level or superior to the target
|
||||
* - topiclock: Disallow the topic to be changed except with ChanServ's TOPIC command
|
||||
* - persist: Keep the channel open at all times
|
||||
* - noautoop: Disables autoop on the channel
|
||||
* - none: No defaults
|
||||
*
|
||||
* This directive is optional, if left blank, the options will default to keeptopic, secure, securefounder,
|
||||
@@ -116,7 +117,7 @@ chanserv
|
||||
* The length of time before a suspended channel becomes unsuspended.
|
||||
*
|
||||
* This directive is optional.
|
||||
* If not set, the default is to never.
|
||||
* If not set, the default is never.
|
||||
*/
|
||||
#suspendexpire = 90d
|
||||
|
||||
@@ -124,7 +125,7 @@ chanserv
|
||||
* The lenth of time before a forbidden channel drops.
|
||||
*
|
||||
* This directive is optional.
|
||||
* If not set, the default is to never.
|
||||
* If not set, the default is never.
|
||||
*/
|
||||
#forbidexpire = 90d
|
||||
|
||||
@@ -198,6 +199,18 @@ chanserv
|
||||
* services immediately reversing mode changes for locked modes.
|
||||
*/
|
||||
use_server_side_mlock = yes
|
||||
|
||||
/*
|
||||
* Some IRCds can enforce topic locks server-side. This reduces the spam caused by
|
||||
* services immediately reversing topic changes.
|
||||
*/
|
||||
use_server_side_topiclock = yes
|
||||
|
||||
/*
|
||||
* The maximum length of the reason field for user commands such as chanserv/kick
|
||||
* and chanserv/ban.
|
||||
*/
|
||||
reasonmax = 200
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -384,7 +397,7 @@ privilege
|
||||
/*
|
||||
* BAN privilege.
|
||||
*
|
||||
* Used by chanserv/ban and chanserv/tban.
|
||||
* Used by chanserv/ban.
|
||||
*
|
||||
* Users with this permission can use the BAN command.
|
||||
*/
|
||||
@@ -416,8 +429,8 @@ privilege
|
||||
/*
|
||||
* FOUNDER privilege.
|
||||
*
|
||||
* Used by botserv/info, chanserv/access, chanserv/akick,
|
||||
* chanserv/clearusers, chanserv/drop, chanserv/set/founder,
|
||||
* Used by chanserv/access, chanserv/akick,
|
||||
* chanserv/drop, chanserv/set/founder,
|
||||
* chanserv/set/securefounder, chanserv/set/successor and chanserv/xop.
|
||||
*
|
||||
* Users with this permission are treated as founders and can use
|
||||
@@ -757,7 +770,7 @@ privilege
|
||||
/*
|
||||
* TOPIC privilege.
|
||||
*
|
||||
* Used by chanserv/appendtopic and chanserv/topic.
|
||||
* Used by chanserv/topic.
|
||||
*
|
||||
* Users with this permission can change the channel topic through ChanServ.
|
||||
*/
|
||||
@@ -831,7 +844,36 @@ privilege
|
||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||
*/
|
||||
|
||||
/* Give it a help command */
|
||||
/* Command group configuration for ChanServ.
|
||||
*
|
||||
* Commands may optionally be placed into groups to make ChanServ's HELP output easier to understand.
|
||||
* Remove the following groups to use the old behavior of simply listing all ChanServ commands from HELP.
|
||||
*/
|
||||
command_group
|
||||
{
|
||||
name = "chanserv/access"
|
||||
description = "Used to manage the list of privileged users"
|
||||
}
|
||||
|
||||
command_group
|
||||
{
|
||||
name = "chanserv/status"
|
||||
description = "Used to modify the channel status of you or other users"
|
||||
}
|
||||
|
||||
command_group
|
||||
{
|
||||
name = "chanserv/management"
|
||||
description = "Used to manage channels"
|
||||
}
|
||||
|
||||
command_group
|
||||
{
|
||||
name = "chanserv/admin"
|
||||
description = "Services Operator commands"
|
||||
}
|
||||
|
||||
/* Give it a help command. */
|
||||
command { service = "ChanServ"; name = "HELP"; command = "generic/help"; }
|
||||
|
||||
/*
|
||||
@@ -843,8 +885,8 @@ command { service = "ChanServ"; name = "HELP"; command = "generic/help"; }
|
||||
* Used for giving users access in channels.
|
||||
*/
|
||||
module { name = "cs_access" }
|
||||
command { service = "ChanServ"; name = "ACCESS"; command = "chanserv/access"; }
|
||||
command { service = "ChanServ"; name = "LEVELS"; command = "chanserv/levels"; }
|
||||
command { service = "ChanServ"; name = "ACCESS"; command = "chanserv/access"; group = "chanserv/access"; }
|
||||
command { service = "ChanServ"; name = "LEVELS"; command = "chanserv/levels"; group = "chanserv/access"; }
|
||||
|
||||
/*
|
||||
* cs_akick
|
||||
@@ -854,17 +896,7 @@ command { service = "ChanServ"; name = "LEVELS"; command = "chanserv/levels"; }
|
||||
* Used for preventing users from joining channels.
|
||||
*/
|
||||
module { name = "cs_akick" }
|
||||
command { service = "ChanServ"; name = "AKICK"; command = "chanserv/akick"; }
|
||||
|
||||
/*
|
||||
* cs_appendtopic
|
||||
*
|
||||
* Provides the chanserv/appendtopic command.
|
||||
*
|
||||
* Used to append text to existing channel topics.
|
||||
*/
|
||||
module { name = "cs_appendtopic" }
|
||||
command { service = "ChanServ"; name = "APPENDTOPIC"; command = "chanserv/appendtopic"; }
|
||||
command { service = "ChanServ"; name = "AKICK"; command = "chanserv/akick"; group = "chanserv/management"; }
|
||||
|
||||
/*
|
||||
* cs_ban
|
||||
@@ -875,27 +907,6 @@ command { service = "ChanServ"; name = "APPENDTOPIC"; command = "chanserv/append
|
||||
*/
|
||||
module { name = "cs_ban" }
|
||||
command { service = "ChanServ"; name = "BAN"; command = "chanserv/ban"; }
|
||||
command { service = "ChanServ"; name = "KB"; command = "chanserv/ban"; }
|
||||
|
||||
/*
|
||||
* cs_tban
|
||||
*
|
||||
* Provides the command chanserv/tban.
|
||||
*
|
||||
* Used for banning users from channels for a specified time.
|
||||
*/
|
||||
module { name = "cs_tban" }
|
||||
command { service = "ChanServ"; name = "TBAN"; command = "chanserv/tban"; }
|
||||
|
||||
/*
|
||||
* cs_clearusers
|
||||
*
|
||||
* Provides the command chanserv/clearusers.
|
||||
*
|
||||
* Used for kicking all users from channels.
|
||||
*/
|
||||
module { name = "cs_clearusers" }
|
||||
command { service = "ChanServ"; name = "CLEARUSERS"; command = "chanserv/clearusers"; }
|
||||
|
||||
/*
|
||||
* cs_clone
|
||||
@@ -905,7 +916,7 @@ command { service = "ChanServ"; name = "CLEARUSERS"; command = "chanserv/clearus
|
||||
* Used for copying channel settings from one channel to another.
|
||||
*/
|
||||
module { name = "cs_clone" }
|
||||
command { service = "ChanServ"; name = "CLONE"; command = "chanserv/clone"; }
|
||||
command { service = "ChanServ"; name = "CLONE"; command = "chanserv/clone"; group = "chanserv/management"; }
|
||||
|
||||
/*
|
||||
* cs_drop
|
||||
@@ -925,7 +936,7 @@ command { service = "ChanServ"; name = "DROP"; command = "chanserv/drop"; }
|
||||
* Used to enforce various channel settings such as secureops and restricted.
|
||||
*/
|
||||
module { name = "cs_enforce" }
|
||||
command { service = "ChanServ"; name = "ENFORCE"; command = "chanserv/enforce"; }
|
||||
command { service = "ChanServ"; name = "ENFORCE"; command = "chanserv/enforce"; group = "chanserv/management"; }
|
||||
|
||||
/*
|
||||
* cs_entrymsg
|
||||
@@ -935,7 +946,7 @@ command { service = "ChanServ"; name = "ENFORCE"; command = "chanserv/enforce";
|
||||
* Used to configure entry messages sent to users when they join a channel.
|
||||
*/
|
||||
module { name = "cs_entrymsg" }
|
||||
command { service = "ChanServ"; name = "ENTRYMSG"; command = "chanserv/entrymsg"; }
|
||||
command { service = "ChanServ"; name = "ENTRYMSG"; command = "chanserv/entrymsg"; group = "chanserv/management"; }
|
||||
cs_entrymsg
|
||||
{
|
||||
/* The maximum number of entrymsgs allowed per channel. If not set, defaults to 5. */
|
||||
@@ -951,7 +962,7 @@ cs_entrymsg
|
||||
* Used for giving users access in channels.
|
||||
*/
|
||||
module { name = "cs_flags" }
|
||||
command { service = "ChanServ"; name = "FLAGS"; command = "chanserv/flags"; }
|
||||
command { service = "ChanServ"; name = "FLAGS"; command = "chanserv/flags"; group = "chanserv/access"; }
|
||||
|
||||
/*
|
||||
* cs_getkey
|
||||
@@ -992,7 +1003,6 @@ command { service = "ChanServ"; name = "INVITE"; command = "chanserv/invite"; }
|
||||
*/
|
||||
module { name = "cs_kick" }
|
||||
command { service = "ChanServ"; name = "KICK"; command = "chanserv/kick"; }
|
||||
command { service = "ChanServ"; name = "K"; command = "chanserv/kick"; }
|
||||
|
||||
/*
|
||||
* cs_list
|
||||
@@ -1002,7 +1012,7 @@ command { service = "ChanServ"; name = "K"; command = "chanserv/kick"; }
|
||||
* Used for retrieving and searching the registered channel list.
|
||||
*/
|
||||
module { name = "cs_list" }
|
||||
command { service = "ChanServ"; name = "LIST"; command = "chanserv/list"; permission = "chanserv/list"; }
|
||||
command { service = "ChanServ"; name = "LIST"; command = "chanserv/list"; permission = "chanserv/list"; group = "chanserv/admin"; }
|
||||
|
||||
/*
|
||||
* cs_log
|
||||
@@ -1012,7 +1022,7 @@ command { service = "ChanServ"; name = "LIST"; command = "chanserv/list"; permis
|
||||
* Use for configuring what actions on channels are logged and where.
|
||||
*/
|
||||
module { name = "cs_log" }
|
||||
command { service = "ChanServ"; name = "LOG"; command = "chanserv/log"; }
|
||||
command { service = "ChanServ"; name = "LOG"; command = "chanserv/log"; group = "chanserv/management"; }
|
||||
|
||||
/*
|
||||
* cs_mode
|
||||
@@ -1022,28 +1032,7 @@ command { service = "ChanServ"; name = "LOG"; command = "chanserv/log"; }
|
||||
* Used for changing mode locks and changing modes.
|
||||
*/
|
||||
module { name = "cs_mode" }
|
||||
command { service = "ChanServ"; name = "MODE"; command = "chanserv/mode"; }
|
||||
|
||||
/*
|
||||
* cs_mode
|
||||
*
|
||||
* Provides the commands chanserv/op, chanserv/deop, chanserv/halfop, chanserv/dehalfop
|
||||
* chanserv/voice, chanserv/devoice, chanserv/protect, chanserv/deprotect,
|
||||
* chanserv/owner, and chanserv/deowner.
|
||||
*
|
||||
* Used for setting and removing modes on users.
|
||||
*/
|
||||
module { name = "cs_modes" }
|
||||
command { service = "ChanServ"; name = "OP"; command = "chanserv/op"; }
|
||||
command { service = "ChanServ"; name = "DEOP"; command = "chanserv/deop"; }
|
||||
command { service = "ChanServ"; name = "HALFOP"; command = "chanserv/halfop"; }
|
||||
command { service = "ChanServ"; name = "DEHALFOP"; command = "chanserv/dehalfop"; }
|
||||
command { service = "ChanServ"; name = "VOICE"; command = "chanserv/voice"; }
|
||||
command { service = "ChanServ"; name = "DEVOICE"; command = "chanserv/devoice"; }
|
||||
command { service = "ChanServ"; name = "PROTECT"; command = "chanserv/protect"; }
|
||||
command { service = "ChanServ"; name = "DEPROTECT"; command = "chanserv/deprotect"; }
|
||||
command { service = "ChanServ"; name = "OWNER"; command = "chanserv/owner"; }
|
||||
command { service = "ChanServ"; name = "DEOWNER"; command = "chanserv/deowner"; }
|
||||
command { service = "ChanServ"; name = "MODE"; command = "chanserv/mode"; group = "chanserv/management"; }
|
||||
|
||||
/*
|
||||
* cs_register
|
||||
@@ -1064,75 +1053,89 @@ command { service = "ChanServ"; name = "REGISTER"; command = "chanserv/register"
|
||||
* Also allows administrators to view stats about seen data and purge the database.
|
||||
*/
|
||||
module { name = "cs_seen" }
|
||||
command { service = "ChanServ"; name = "SEEN"; command = "chanserv/seen"; }
|
||||
#command { service = "OperServ"; name = "SEEN"; command = "operserv/seen"; }
|
||||
command { service = "OperServ"; name = "SEEN"; command = "operserv/seen"; permission = "operserv/seen"; }
|
||||
cs_seen
|
||||
{
|
||||
/* Sets the time to keep seen entries in the seen database. */
|
||||
purgetime = "30d"
|
||||
|
||||
/* Sets the delay between checks for expired seen entries. */
|
||||
expiretimeout = "1d"
|
||||
}
|
||||
|
||||
/*
|
||||
* cs_set
|
||||
*
|
||||
* Provides the command chanserv/set.
|
||||
* Provides the commands:
|
||||
* chanserv/set and chanserv/saset - Dummy help wrappers for the SET and SASET commands.
|
||||
* chanserv/set/autoop - Used for configuring whether or not ChanServ automatically gives channel status to users.
|
||||
* chanserv/set/bantype - Used for controlling what format of bans are placed on channels.
|
||||
* chanserv/set/description - Used for changing channels descriptions.
|
||||
* chanserv/set/founder - Used for changing a channel's founder.
|
||||
* chanserv/set/keeptopic - Used for configuring if ChanServ is to restore the channel topic when a channel is created.
|
||||
* chanserv/set/peace - Used for configuring if users are able to kick other users with higher access than them.
|
||||
* chanserv/set/persist - Used for setting whether ChanServ should stay in channels after the last user leaves.
|
||||
* chanserv/set/private - Used for setting whether channels should show up in chanserv/list.
|
||||
* chanserv/set/restricted - Used for setting whether users not on a channel's access list can join.
|
||||
* chanserv/set/secure - Used for setting whether users who are recognized for accounts should have their access in channels.
|
||||
* chanserv/set/securefounder - Used for setting whether users with founder level access in channels have true founder or not.
|
||||
* chanserv/set/secureops - Used for restricting who can have channel op privilege in a channel to those whom have access in the channel.
|
||||
* chanserv/set/signkick - Used for setting signkick, which appends the kicker's name to kicks sent through ChanServ.
|
||||
* chanserv/set/successor - Used for setting channel successors, which become channel founders if the founders' account expires.
|
||||
* chanserv/saset/noexpire - Used for setting noexpire, which prevents channels from expiring.
|
||||
*
|
||||
* Is a dummy command to provide a help wrapper for the various SET commands.
|
||||
* This is a dummy command to provide a help wrapper for the various SET and SASET commands.
|
||||
*/
|
||||
module { name = "cs_set" }
|
||||
command { service = "ChanServ"; name = "SET"; command = "chanserv/set"; }
|
||||
|
||||
/*
|
||||
* cs_saset
|
||||
*
|
||||
* Provides the command chanserv/saset.
|
||||
*
|
||||
* Is a dummy command to provide a help wrapper for the various SASET commands.
|
||||
*/
|
||||
module { name = "cs_saset" }
|
||||
command { service = "ChanServ"; name = "SASET"; command = "chanserv/saset"; permission = "chanserv/saset"; }
|
||||
command { service = "ChanServ"; name = "SET"; command = "chanserv/set"; group = "chanserv/management"; }
|
||||
command { service = "ChanServ"; name = "SASET"; command = "chanserv/saset"; permission = "chanserv/saset/"; group = "chanserv/admin"; }
|
||||
|
||||
/*
|
||||
* cs_set_bantype
|
||||
*
|
||||
* Provides the commands chanserv/set/bantype and chanserv/saset/bantype.
|
||||
*
|
||||
* Used for controlling what format bans are placed on channels.
|
||||
*/
|
||||
module { name = "cs_set_bantype" }
|
||||
command { service = "ChanServ"; name = "SET BANTYPE"; command = "chanserv/set/bantype"; }
|
||||
command { service = "ChanServ"; name = "SASET BANTYPE"; command = "chanserv/saset/bantype"; permission = "chanserv/saset/bantype"; }
|
||||
command { service = "ChanServ"; name = "SET AUTOOP"; command = "chanserv/set/autoop"; group = "chanserv/management"; }
|
||||
command { service = "ChanServ"; name = "SASET AUTOOP"; command = "chanserv/set/autoop"; permission = "chanserv/saset/autoop"; group = "chanserv/admin"; }
|
||||
|
||||
/*
|
||||
* cs_set_description
|
||||
*
|
||||
* Provides the commands chanserv/set/description and chanserv/saset/description.
|
||||
*
|
||||
* Used for changing channels descriptions.
|
||||
*/
|
||||
module { name = "cs_set_description" }
|
||||
command { service = "ChanServ"; name = "SET DESCRIPTION"; command = "chanserv/set/description"; }
|
||||
command { service = "ChanServ"; name = "SET DESC"; command = "chanserv/set/description"; }
|
||||
command { service = "ChanServ"; name = "SASET DESCRIPTION"; command = "chanserv/saset/description"; permission = "chanserv/saset/description"; }
|
||||
command { service = "ChanServ"; name = "SASET DESC"; command = "chanserv/saset/description"; permission = "chanserv/saset/description"; }
|
||||
command { service = "ChanServ"; name = "SET BANTYPE"; command = "chanserv/set/bantype"; group = "chanserv/management"; }
|
||||
command { service = "ChanServ"; name = "SASET BANTYPE"; command = "chanserv/set/bantype"; permission = "chanserv/saset/bantype"; group = "chanserv/admin"; }
|
||||
|
||||
/*
|
||||
* cs_set_founder
|
||||
*
|
||||
* Provides the commands chanserv/set/founder and chanserv/saset/founder.
|
||||
*
|
||||
* Used for changing channel founders.
|
||||
*/
|
||||
module { name = "cs_set_founder" }
|
||||
command { service = "ChanServ"; name = "SET FOUNDER"; command = "chanserv/set/founder"; }
|
||||
command { service = "ChanServ"; name = "SASET FOUNDER"; command = "chanserv/saset/founder"; permission = "chanserv/saset/founder"; }
|
||||
command { service = "ChanServ"; name = "SET DESCRIPTION"; command = "chanserv/set/description"; group = "chanserv/management"; }
|
||||
command { service = "ChanServ"; name = "SET DESC"; command = "chanserv/set/description"; group = "chanserv/management"; }
|
||||
command { service = "ChanServ"; name = "SASET DESCRIPTION"; command = "chanserv/set/description"; permission = "chanserv/saset/description"; group = "chanserv/admin"; }
|
||||
command { service = "ChanServ"; name = "SASET DESC"; command = "chanserv/set/description"; permission = "chanserv/saset/description"; group = "chanserv/admin"; }
|
||||
|
||||
/*
|
||||
* cs_set_keeptopic
|
||||
*
|
||||
* Provides the commands chanserv/set/keeptopic and chanserv/saset/keeptopic.
|
||||
*
|
||||
* Used for enabling keeptopic on channels, which causes ChanServ to restore the channel topic
|
||||
* when a channel is created.
|
||||
*/
|
||||
module { name = "cs_set_keeptopic" }
|
||||
command { service = "ChanServ"; name = "SET KEEPTOPIC"; command = "chanserv/set/keeptopic"; }
|
||||
command { service = "ChanServ"; name = "SASET KEEPTOPIC"; command = "chanserv/saset/keeptopic"; permission = "chanserv/saset/keeptopic"; }
|
||||
command { service = "ChanServ"; name = "SET FOUNDER"; command = "chanserv/set/founder"; group = "chanserv/management"; }
|
||||
command { service = "ChanServ"; name = "SASET FOUNDER"; command = "chanserv/set/founder"; permission = "chanserv/saset/founder"; group = "chanserv/admin"; }
|
||||
|
||||
command { service = "ChanServ"; name = "SET KEEPTOPIC"; command = "chanserv/set/keeptopic"; group = "chanserv/management"; }
|
||||
command { service = "ChanServ"; name = "SASET KEEPTOPIC"; command = "chanserv/set/keeptopic"; permission = "chanserv/saset/keeptopic"; group = "chanserv/admin"; }
|
||||
|
||||
command { service = "ChanServ"; name = "SET PEACE"; command = "chanserv/set/peace"; group = "chanserv/management"; }
|
||||
command { service = "ChanServ"; name = "SASET PEACE"; command = "chanserv/set/peace"; permission = "chanserv/saset/peace"; group = "chanserv/admin"; }
|
||||
|
||||
command { service = "ChanServ"; name = "SET PERSIST"; command = "chanserv/set/persist"; group = "chanserv/management"; }
|
||||
command { service = "ChanServ"; name = "SASET PERSIST"; command = "chanserv/set/persist"; permission = "chanserv/saset/persist"; group = "chanserv/admin"; }
|
||||
|
||||
command { service = "ChanServ"; name = "SET PRIVATE"; command = "chanserv/set/private"; group = "chanserv/management"; }
|
||||
command { service = "ChanServ"; name = "SASET PRIVATE"; command = "chanserv/set/private"; permission = "chanserv/saset/private"; group = "chanserv/admin"; }
|
||||
|
||||
command { service = "ChanServ"; name = "SET RESTRICTED"; command = "chanserv/set/restricted"; group = "chanserv/management"; }
|
||||
command { service = "ChanServ"; name = "SASET RESTRICTED"; command = "chanserv/set/restricted"; permission = "chanserv/saset/restricted"; group = "chanserv/admin"; }
|
||||
|
||||
command { service = "ChanServ"; name = "SET SECURE"; command = "chanserv/set/secure"; group = "chanserv/management"; }
|
||||
command { service = "ChanServ"; name = "SASET SECURE"; command = "chanserv/set/secure"; permission = "chanserv/saset/secure"; group = "chanserv/admin"; }
|
||||
|
||||
command { service = "ChanServ"; name = "SET SECUREFOUNDER"; command = "chanserv/set/securefounder"; group = "chanserv/management"; }
|
||||
command { service = "ChanServ"; name = "SASET SECUREFOUNDER"; command = "chanserv/set/securefounder"; permission = "chanserv/saset/securefounder"; group = "chanserv/admin"; }
|
||||
|
||||
command { service = "ChanServ"; name = "SET SECUREOPS"; command = "chanserv/set/secureops"; group = "chanserv/management"; }
|
||||
command { service = "ChanServ"; name = "SASET SECUREOPS"; command = "chanserv/set/secureops"; permission = "chanserv/saset/secureops"; group = "chanserv/admin"; }
|
||||
|
||||
command { service = "ChanServ"; name = "SET SIGNKICK"; command = "chanserv/set/signkick"; group = "chanserv/management"; }
|
||||
command { service = "ChanServ"; name = "SASET SIGNKICK"; command = "chanserv/set/signkick"; permission = "chanserv/saset/signkick"; group = "chanserv/admin"; }
|
||||
|
||||
command { service = "ChanServ"; name = "SET SUCCESSOR"; command = "chanserv/set/successor"; group = "chanserv/management"; }
|
||||
command { service = "ChanServ"; name = "SASET SUCCESSOR"; command = "chanserv/set/successor"; permission = "chanserv/saset/successor"; group = "chanserv/admin"; }
|
||||
|
||||
command { service = "ChanServ"; name = "SASET NOEXPIRE"; command = "chanserv/saset/noexpire"; permission = "chanserv/saset/noexpire"; group = "chanserv/admin"; }
|
||||
|
||||
/*
|
||||
* cs_set_misc
|
||||
@@ -1140,131 +1143,24 @@ command { service = "ChanServ"; name = "SASET KEEPTOPIC"; command = "chanserv/sa
|
||||
* Provides the command chanserv/set/misc.
|
||||
*
|
||||
* Allows you to create arbitrary commands to set data, and have that data show up in chanserv/info.
|
||||
* A field named misc_description may be given for use with help output.
|
||||
*/
|
||||
module { name = "cs_set_misc" }
|
||||
command { service = "ChanServ"; name = "SET URL"; command = "chanserv/set/misc"; }
|
||||
command { service = "ChanServ"; name = "SET EMAIL"; command = "chanserv/set/misc"; }
|
||||
command { service = "ChanServ"; name = "SET URL"; command = "chanserv/set/misc"; group = "chanserv/management"; misc_description = _("Associate a URL with the channel"); }
|
||||
command { service = "ChanServ"; name = "SASET URL"; command = "chanserv/set/misc"; group = "chanserv/management"; misc_description = _("Associate a URL with the channel"); permission = "chanserv/saset/url"; group = "chanserv/admin"; }
|
||||
command { service = "ChanServ"; name = "SET EMAIL"; command = "chanserv/set/misc"; group = "chanserv/management"; misc_description = _("Associate an E-mail address with the channel"); }
|
||||
command { service = "ChanServ"; name = "SASET EMAIL"; command = "chanserv/set/misc"; group = "chanserv/management"; misc_description = _("Associate an E-mail address with the channel"); permission = "chanserv/saset/email"; group = "chanserv/admin"; }
|
||||
|
||||
/*
|
||||
* cs_set_peace
|
||||
* cs_status
|
||||
*
|
||||
* Provides the commands chanserv/set/peace and chanserv/saset/peace.
|
||||
* Provides the command chanserv/status.
|
||||
*
|
||||
* Used for setting the peace option, which prevents users from kicking other users with
|
||||
* higher level access than them.
|
||||
* Used for determining a user's access on a channel and whether
|
||||
* or not they match any autokick entries.
|
||||
*/
|
||||
module { name = "cs_set_peace" }
|
||||
command { service = "ChanServ"; name = "SET PEACE"; command = "chanserv/set/peace"; }
|
||||
command { service = "ChanServ"; name = "SASET PEACE"; command = "chanserv/saset/peace"; permission = "chanserv/saset/peace"; }
|
||||
|
||||
/*
|
||||
* cs_set_persist
|
||||
*
|
||||
* Provides the commands chanserv/set/persist and chanserv/saset/persist.
|
||||
*
|
||||
* Used for setting whether ChanServ should stay in channels after the last user leaves.
|
||||
*/
|
||||
module { name = "cs_set_persist" }
|
||||
command { service = "ChanServ"; name = "SET PERSIST"; command = "chanserv/set/persist"; }
|
||||
command { service = "ChanServ"; name = "SASET PERSIST"; command = "chanserv/saset/persist"; permission = "chanserv/saset/persist"; }
|
||||
|
||||
/*
|
||||
* cs_set_private
|
||||
*
|
||||
* Provides the commands chanserv/set/private and chanserv/saset/private.
|
||||
*
|
||||
* Used for setting whether channels should show up in chanserv/list.
|
||||
*/
|
||||
module { name = "cs_set_private" }
|
||||
command { service = "ChanServ"; name = "SET PRIVATE"; command = "chanserv/set/private"; }
|
||||
command { service = "ChanServ"; name = "SASET PRIVATE"; command = "chanserv/saset/private"; permission = "chanserv/saset/private"; }
|
||||
|
||||
/*
|
||||
* cs_set_restricted
|
||||
*
|
||||
* Provides the commands chanserv/set/restricted and chanserv/saset/restricted.
|
||||
*
|
||||
* Used for setting whether users not on a channel's access list can join.
|
||||
*/
|
||||
module { name = "cs_set_restricted" }
|
||||
command { service = "ChanServ"; name = "SET RESTRICTED"; command = "chanserv/set/restricted"; }
|
||||
command { service = "ChanServ"; name = "SASET RESTRICTED"; command = "chanserv/saset/restricted"; permission = "chanserv/saset/restricted"; }
|
||||
|
||||
/*
|
||||
* cs_set_secure
|
||||
*
|
||||
* Provides the commands chanserv/set/secure and chanserv/saset/secure.
|
||||
*
|
||||
* Used for setting whether users who are recognized for accounts should have their access in channels.
|
||||
*/
|
||||
module { name = "cs_set_secure" }
|
||||
command { service = "ChanServ"; name = "SET SECURE"; command = "chanserv/set/secure"; }
|
||||
command { service = "ChanServ"; name = "SASET SECURE"; command = "chanserv/saset/secure"; permission = "chanserv/saset/secure"; }
|
||||
|
||||
/*
|
||||
* cs_set_securefounder
|
||||
*
|
||||
* Provides the commands chanserv/set/securefounder and chanserv/saset/securefounder.
|
||||
*
|
||||
* Used for setting whether users with founder level access in channels have true founder or not.
|
||||
*/
|
||||
module { name = "cs_set_securefounder" }
|
||||
command { service = "ChanServ"; name = "SET SECUREFOUNDER"; command = "chanserv/set/securefounder"; }
|
||||
command { service = "ChanServ"; name = "SASET SECUREFOUNDER"; command = "chanserv/saset/securefounder"; permission = "chanserv/saset/securefounder"; }
|
||||
|
||||
/*
|
||||
* cs_set_secureops
|
||||
*
|
||||
* Provides the commands chanserv/set/secureops and chanserv/saset/secureops.
|
||||
*
|
||||
* Used for restricting who can have channel op privilege in a channel to those whom have access in the channel.
|
||||
*/
|
||||
module { name = "cs_set_secureops" }
|
||||
command { service = "ChanServ"; name = "SET SECUREOPS"; command = "chanserv/set/secureops"; }
|
||||
command { service = "ChanServ"; name = "SASET SECUREOPS"; command = "chanserv/saset/secureops"; permission = "chanserv/saset/secureops"; }
|
||||
|
||||
/*
|
||||
* cs_set_signkick
|
||||
*
|
||||
* Provides the commands chanserv/set/signkick and chanserv/saset/signkick.
|
||||
*
|
||||
* Used for setting signkick, which appends the kicker's name to kicks sent through ChanServ.
|
||||
*/
|
||||
module { name = "cs_set_signkick" }
|
||||
command { service = "ChanServ"; name = "SET SIGNKICK"; command = "chanserv/set/signkick"; }
|
||||
command { service = "ChanServ"; name = "SASET SIGNKICK"; command = "chanserv/saset/signkick"; permission = "chanserv/saset/signkick"; }
|
||||
|
||||
/*
|
||||
* cs_set_successor
|
||||
*
|
||||
* Provides the commands chanserv/set/successor and chanserv/saset/successor.
|
||||
*
|
||||
* Used for setting channel successors, which become channel founders if the founders account expires.
|
||||
*/
|
||||
module { name = "cs_set_successor" }
|
||||
command { service = "ChanServ"; name = "SET SUCCESSOR"; command = "chanserv/set/successor"; }
|
||||
command { service = "ChanServ"; name = "SASET SUCCESSOR"; command = "chanserv/saset/successor"; permission = "chanserv/saset/successor"; }
|
||||
|
||||
/*
|
||||
* cs_set_topiclock
|
||||
*
|
||||
* Provides the commands chanserv/set/topiclock and chanserv/saset/topiclock.
|
||||
*
|
||||
* Used for setting topiclock, which prevents channel topics from being modified.
|
||||
*/
|
||||
module { name = "cs_set_topiclock" }
|
||||
command { service = "ChanServ"; name = "SET TOPICLOCK"; command = "chanserv/set/topiclock"; }
|
||||
command { service = "ChanServ"; name = "SASET TOPICLOCK"; command = "chanserv/saset/topiclock"; permission = "chanserv/saset/topiclock"; }
|
||||
|
||||
/*
|
||||
* cs_set_noexpire
|
||||
*
|
||||
* Provides the command chanserv/saset/noexpire.
|
||||
*
|
||||
* Used for setting noexpire, which prevents channels from expiring.
|
||||
*/
|
||||
module { name = "cs_saset_noexpire" }
|
||||
command { service = "ChanServ"; name = "SASET NOEXPIRE"; command = "chanserv/saset/noexpire"; permission = "chanserv/saset/noexpire"; }
|
||||
module { name = "cs_status" }
|
||||
command { service = "ChanServ"; name = "STATUS"; command = "chanserv/status"; }
|
||||
|
||||
/*
|
||||
* cs_suspend
|
||||
@@ -1274,8 +1170,8 @@ command { service = "ChanServ"; name = "SASET NOEXPIRE"; command = "chanserv/sas
|
||||
* Used for suspending and unsuspending channels. Suspended channels can not be used but their settings are stored.
|
||||
*/
|
||||
module { name = "cs_suspend" }
|
||||
command { service = "ChanServ"; name = "SUSPEND"; command = "chanserv/suspend"; permission = "chanserv/suspend"; }
|
||||
command { service = "ChanServ"; name = "UNSUSPEND"; command = "chanserv/unsuspend"; permission = "chanserv/suspend"; }
|
||||
command { service = "ChanServ"; name = "SUSPEND"; command = "chanserv/suspend"; permission = "chanserv/suspend"; group = "chanserv/admin"; }
|
||||
command { service = "ChanServ"; name = "UNSUSPEND"; command = "chanserv/unsuspend"; permission = "chanserv/suspend"; group = "chanserv/admin"; }
|
||||
|
||||
/*
|
||||
* cs_sync
|
||||
@@ -1285,17 +1181,17 @@ command { service = "ChanServ"; name = "UNSUSPEND"; command = "chanserv/unsuspen
|
||||
* Used to sync users channel status modes with what access they have.
|
||||
*/
|
||||
module { name = "cs_sync" }
|
||||
command { service = "ChanServ"; name = "SYNC"; command = "chanserv/sync"; }
|
||||
command { service = "ChanServ"; name = "SYNC"; command = "chanserv/sync"; group = "chanserv/management"; }
|
||||
|
||||
/*
|
||||
* cs_topic
|
||||
*
|
||||
* Provides the command chanserv/topic.
|
||||
*
|
||||
* Used for changing the channel topic. Usedful in conjunction with chanserv/set/topiclock.
|
||||
* Used for changing the channel topic. Useful in conjunction with chanserv/set/topiclock.
|
||||
*/
|
||||
module { name = "cs_topic" }
|
||||
command { service = "ChanServ"; name = "TOPIC"; command = "chanserv/topic"; }
|
||||
command { service = "ChanServ"; name = "TOPIC"; command = "chanserv/topic"; group = "chanserv/management"; }
|
||||
|
||||
/*
|
||||
* cs_unban
|
||||
@@ -1315,8 +1211,8 @@ command { service = "ChanServ"; name = "UNBAN"; command = "chanserv/unban"; }
|
||||
* Used for setting or removing your status modes on a channel.
|
||||
*/
|
||||
module { name = "cs_updown" }
|
||||
command { service = "ChanServ"; name = "DOWN"; command = "chanserv/down"; }
|
||||
command { service = "ChanServ"; name = "UP"; command = "chanserv/up"; }
|
||||
command { service = "ChanServ"; name = "DOWN"; command = "chanserv/down"; group = "chanserv/status"; }
|
||||
command { service = "ChanServ"; name = "UP"; command = "chanserv/up"; group = "chanserv/status"; }
|
||||
|
||||
/*
|
||||
* cs_xop
|
||||
@@ -1327,9 +1223,135 @@ command { service = "ChanServ"; name = "UP"; command = "chanserv/up"; }
|
||||
* Used for giving users access in channels.
|
||||
*/
|
||||
module { name = "cs_xop" }
|
||||
command { service = "ChanServ"; name = "QOP"; command = "chanserv/qop"; }
|
||||
command { service = "ChanServ"; name = "SOP"; command = "chanserv/sop"; }
|
||||
command { service = "ChanServ"; name = "AOP"; command = "chanserv/aop"; }
|
||||
command { service = "ChanServ"; name = "HOP"; command = "chanserv/hop"; }
|
||||
command { service = "ChanServ"; name = "VOP"; command = "chanserv/vop"; }
|
||||
command { service = "ChanServ"; name = "QOP"; command = "chanserv/qop"; group = "chanserv/access"; }
|
||||
command { service = "ChanServ"; name = "SOP"; command = "chanserv/sop"; group = "chanserv/access"; }
|
||||
command { service = "ChanServ"; name = "AOP"; command = "chanserv/aop"; group = "chanserv/access"; }
|
||||
command { service = "ChanServ"; name = "HOP"; command = "chanserv/hop"; group = "chanserv/access"; }
|
||||
command { service = "ChanServ"; name = "VOP"; command = "chanserv/vop"; group = "chanserv/access"; }
|
||||
|
||||
|
||||
/* Use m_rewrite to rewrite the op, deop, etc. commands (see modules.conf). */
|
||||
|
||||
/* OWNER and DEOWNER commands */
|
||||
command
|
||||
{
|
||||
service = "ChanServ"; name = "OWNER"; command = "rewrite"; group = "chanserv/status"
|
||||
|
||||
rewrite = true
|
||||
rewrite_source = "OWNER $"
|
||||
rewrite_target = "MODE $1 SET +q $2"
|
||||
|
||||
rewrite_description = _("Gives you or a specified nick owner status on a channel")
|
||||
}
|
||||
command
|
||||
{
|
||||
service = "ChanServ"; name = "DEOWNER"; command = "rewrite"; group = "chanserv/status"
|
||||
|
||||
rewrite = true
|
||||
rewrite_source = "DEOWNER $"
|
||||
rewrite_target = "MODE $1 SET -q $2"
|
||||
|
||||
rewrite_description = _("Removes owner status from you or a specified nick on a channel")
|
||||
}
|
||||
|
||||
/* PROTECT and DEPROTECT commands */
|
||||
command
|
||||
{
|
||||
service = "ChanServ"; name = "PROTECT"; command = "rewrite"; group = "chanserv/status"
|
||||
|
||||
rewrite = true
|
||||
rewrite_source = "PROTECT $"
|
||||
rewrite_target = "MODE $1 SET +a $2"
|
||||
|
||||
rewrite_description = _("Protects you or a specified nick on a channel")
|
||||
}
|
||||
command
|
||||
{
|
||||
service = "ChanServ"; name = "DEPROTECT"; command = "rewrite"; group = "chanserv/status"
|
||||
|
||||
rewrite = true
|
||||
rewrite_source = "DEPROTECT $"
|
||||
rewrite_target = "MODE $1 SET -a $2"
|
||||
|
||||
rewrite_description = _("Deprotects you or a specified nick on a channel")
|
||||
}
|
||||
|
||||
/* OP and DEOP commands */
|
||||
command
|
||||
{
|
||||
service = "ChanServ"; name = "OP"; command = "rewrite"; group = "chanserv/status"
|
||||
|
||||
rewrite = true
|
||||
rewrite_source = "OP $"
|
||||
rewrite_target = "MODE $1 SET +o $2"
|
||||
|
||||
rewrite_description = _("Gives operator status to you or a specified nick on a channel")
|
||||
}
|
||||
command
|
||||
{
|
||||
service = "ChanServ"; name = "DEOP"; command = "rewrite"; group = "chanserv/status"
|
||||
|
||||
rewrite = true
|
||||
rewrite_source = "DEOP $"
|
||||
rewrite_target = "MODE $1 SET -o $2";
|
||||
|
||||
rewrite_description = _("Deops you or a specified nick on a channel")
|
||||
}
|
||||
|
||||
/* HALFOP and DEHALFOP commands */
|
||||
command
|
||||
{
|
||||
service = "ChanServ"; name = "HALFOP"; command = "rewrite"; group = "chanserv/status"
|
||||
|
||||
rewrite = true
|
||||
rewrite_source = "HALFOP $"
|
||||
rewrite_target = "MODE $1 SET +h $2"
|
||||
|
||||
rewrite_description = _("Halfops you or a specified nick on a channel")
|
||||
|
||||
}
|
||||
command
|
||||
{
|
||||
service = "ChanServ"; name = "DEHALFOP"; command = "rewrite"; group = "chanserv/status"
|
||||
|
||||
rewrite = true
|
||||
rewrite_source = "DEHALFOP $"
|
||||
rewrite_target = "MODE $1 SET -h $2"
|
||||
|
||||
rewrite_description = _("Dehalfops you or a specified nick on a channel")
|
||||
}
|
||||
|
||||
/* VOICE and DEVOICE commands */
|
||||
command
|
||||
{
|
||||
service = "ChanServ"; name = "VOICE"; command = "rewrite"; group = "chanserv/status"
|
||||
|
||||
rewrite = true
|
||||
rewrite_source = "VOICE $"
|
||||
rewrite_target = "MODE $1 SET +v $2"
|
||||
|
||||
rewrite_description = _("Voices you or a specified nick on a channel")
|
||||
}
|
||||
command
|
||||
{
|
||||
service = "ChanServ"; name = "DEVOICE"; command = "rewrite"; group = "chanserv/status"
|
||||
|
||||
rewrite = true
|
||||
rewrite_source = "DEVOICE $"
|
||||
rewrite_target = "MODE $1 SET -v $2"
|
||||
|
||||
rewrite_description = _("Devoices you or a specified nick on a channel")
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Extra ChanServ related modules.
|
||||
*/
|
||||
|
||||
/*
|
||||
* cs_statusupdate
|
||||
*
|
||||
* This module automatically updates users status on channels when the
|
||||
* channel's access list is modified.
|
||||
*/
|
||||
module { name = "cs_statusupdate" }
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
/*
|
||||
* Example configuration file for chanstats
|
||||
* Example configuration file for Chanstats.
|
||||
* Make sure BotServ, ChanServ and NickServ are running.
|
||||
*/
|
||||
|
||||
module { name = "m_chanstats" }
|
||||
|
||||
chanstats
|
||||
{
|
||||
/*
|
||||
/*
|
||||
* The name of this engine.
|
||||
* This must match with the name of a SQL engine block
|
||||
* This must match with the name of an SQL engine block.
|
||||
*/
|
||||
|
||||
engine = "mysql/main"
|
||||
@@ -20,24 +19,20 @@ chanstats
|
||||
*/
|
||||
prefix = "anope_"
|
||||
|
||||
smileyshappy = ":) :-) ;) :D :-D"
|
||||
smileyshappy = ":) :-) ;) ;-) :D :-D :P :-P"
|
||||
smileyssad = ":( :-( ;( ;-("
|
||||
smileysother = ":/"
|
||||
smileysother = ":/ :-/"
|
||||
|
||||
/*
|
||||
* Enable Chanstats for new registered nicks / channels
|
||||
* set it to 0 to disable it.
|
||||
* Enable Chanstats for newly registered nicks / channels.
|
||||
* Set it to 0 to disable it.
|
||||
*/
|
||||
NSDefChanstats = 1
|
||||
CSDefChanstats = 1
|
||||
}
|
||||
|
||||
|
||||
module { name = "cs_set_chanstats" }
|
||||
command { service = "ChanServ"; name = "SET CHANSTATS"; command = "chanserv/set/chanstats"; }
|
||||
|
||||
module { name = "ns_set_chanstats" }
|
||||
command { service = "NickServ"; name = "SET CHANSTATS"; command = "nickserv/set/chanstats"; }
|
||||
command { service = "NickServ"; name = "SASET CHANSTATS"; command = "nickserv/saset/chanstats"; }
|
||||
|
||||
module { name = "cs_fantasy_stats" }
|
||||
command { service = "ChanServ"; name = "STATS"; command = "chanserv/stats"; }
|
||||
|
||||
+93
-97
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Example configuration file for Services. After making the appropriate
|
||||
* changes to this file, place it in the Services data directory (as
|
||||
* specified in the "configure" script, default /home/username/services/data)
|
||||
* changes to this file, place it in the Services conf directory (as
|
||||
* specified in the "configure" script, default /home/username/services/conf)
|
||||
* under the name "services.conf".
|
||||
*
|
||||
* The format of this file is fairly simple: three types of comments are supported:
|
||||
@@ -224,9 +224,11 @@ serverinfo
|
||||
*
|
||||
* Supported:
|
||||
* - bahamut
|
||||
* - hybrid
|
||||
* - inspircd11
|
||||
* - inspircd12
|
||||
* - inspircd20
|
||||
* - ngircd
|
||||
* - plexus
|
||||
* - ratbox
|
||||
* - unreal
|
||||
@@ -267,6 +269,10 @@ networkinfo
|
||||
* but recommended.
|
||||
*/
|
||||
hostlen = 64
|
||||
|
||||
/* Set this to the maximum allowed channel length on your network.
|
||||
*/
|
||||
chanlen = 32
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -276,6 +282,13 @@ networkinfo
|
||||
*/
|
||||
options
|
||||
{
|
||||
/*
|
||||
* On Linux/UNIX systems Anope can setuid and setgid to this user and group
|
||||
* after starting up. This is useful if Anope has to bind to privileged ports
|
||||
*/
|
||||
#user = "anope"
|
||||
#group = "anope"
|
||||
|
||||
/*
|
||||
* The case mapping used by services. This must be set to a valid locale name
|
||||
* installed on your machine. Services use this case map to compare, with
|
||||
@@ -327,8 +340,8 @@ options
|
||||
* entity (nickname name) with which it is associated. When set, however,
|
||||
* Services will also check that the password is at least five
|
||||
* characters long, and in the future will probably check other things
|
||||
* as well.
|
||||
*
|
||||
* as well.
|
||||
*
|
||||
* This directive is optional, but recommended.
|
||||
*/
|
||||
strictpasswords = yes
|
||||
@@ -340,7 +353,7 @@ options
|
||||
* during a single IRC session (subject to badpasstimeout, below), Services
|
||||
* will issues a /KILL for the user. If not given, Services will ignore
|
||||
* failed password attempts (though they will be logged in any case).
|
||||
*
|
||||
*
|
||||
* This directive is optional, but recommended.
|
||||
*/
|
||||
badpasslimit = 5
|
||||
@@ -475,7 +488,7 @@ options
|
||||
|
||||
/*
|
||||
* The number of LOGON/OPER news items to display when a user logs on.
|
||||
*
|
||||
*
|
||||
* This directive is optional, if no set it will default to 3.
|
||||
*/
|
||||
#newscount = 3
|
||||
@@ -507,7 +520,7 @@ options
|
||||
* If set, Services will hide commands that users don't have the privileges to execute
|
||||
* from HELP output.
|
||||
*/
|
||||
hideprivilegedcommands = no
|
||||
hideprivilegedcommands = yes
|
||||
|
||||
/*
|
||||
* If set, Services do not allow ownership of nick names, only ownership of accounts.
|
||||
@@ -614,7 +627,7 @@ include
|
||||
}
|
||||
|
||||
/*
|
||||
* [RECOMMENDED] Logging Configuration
|
||||
* [RECOMMENDED] Logging Configuration
|
||||
*
|
||||
* This section is used for configuring what is logged and where it is logged to.
|
||||
* You may have multiple log blocks if you wish. Remember to properly secure any
|
||||
@@ -631,7 +644,7 @@ log
|
||||
target = "services.log"
|
||||
|
||||
/* Log to both services.log and the channel #services
|
||||
*
|
||||
*
|
||||
* Note that some older IRCds, such as Ratbox, require services to be in the
|
||||
* log channel to be able to message it. To do this, configure service:channels to
|
||||
* join your logging channel.
|
||||
@@ -703,7 +716,7 @@ log
|
||||
log
|
||||
{
|
||||
target = "globops"
|
||||
admin = "global/* operserv/mode operserv/kick operserv/akill operserv/s*line operserv/noop operserv/jupe operserv/oline operserv/set operserv/svsnick nickserv/getpass */drop"
|
||||
admin = "global/* operserv/global operserv/mode operserv/kick operserv/akill operserv/s*line operserv/noop operserv/jupe operserv/oline operserv/set operserv/svsnick operserv/svsjoin operserv/svspart nickserv/getpass */drop"
|
||||
servers = "squit"
|
||||
users = "oper"
|
||||
other = "expire/* bados akill/*"
|
||||
@@ -723,8 +736,8 @@ log
|
||||
* must be included in the opertype block before the command can be used.
|
||||
*
|
||||
* Available privileges:
|
||||
* botserv/administration - Can perform certain BotServ administrative tasks
|
||||
* chanserv/access/modify - Can modify channel access and akick lists
|
||||
* botserv/administration - Can view and assign private BotServ bots
|
||||
* chanserv/access/modify - Can modify channel access and akick lists, and use /chanserv enforce
|
||||
* chanserv/auspex - Can see any information with /chanserv info
|
||||
* chanserv/no-register-limit - May register an unlimited number of channels and nicknames
|
||||
* chanserv/set - Can modify the settings of any channel (incl. changing of the owner!)
|
||||
@@ -732,44 +745,45 @@ log
|
||||
* memoserv/set-limit - Can set the limit of max stored memos on any user and channel
|
||||
* memoserv/no-limit - Can send memos through limits and throttles
|
||||
* nickserv/access - Can modify other users access list
|
||||
* nickserv/alist - Can see the access list of other users
|
||||
* nickserv/auspex - Can see any information with /nickserv info
|
||||
* nickserv/confirm - Can confirm other users nicknames
|
||||
* nickserv/drop - Can drop other users nicks
|
||||
*
|
||||
* Available commands:
|
||||
* botserv/bot/del botserv/bot/add botserv/bot/change botserv/assign/private
|
||||
* botserv/botlist botserv/set/private botserv/set/nobot
|
||||
* botserv/bot/del botserv/bot/add botserv/bot/change botserv/set/private
|
||||
* botserv/set/nobot
|
||||
*
|
||||
* chanserv/access/list chanserv/drop chanserv/getkey chanserv/invite
|
||||
* chanserv/list chanserv/suspend chanserv/topic chanserv/clearusers
|
||||
* chanserv/list chanserv/suspend chanserv/topic
|
||||
*
|
||||
* chanserv/saset/bantype chanserv/saset/description chanserv/saset/email
|
||||
* chanserv/saset/founder chanserv/saset/keeptopic chanserv/saset/restricted
|
||||
* chanserv/saset/peace chanserv/saset/persist chanserv/saset/private
|
||||
* chanserv/saset/secure chanserv/saset/securefounder chanserv/saset/secureops
|
||||
* chanserv/saset/signkick chanserv/saset/successor chanserv/saset/topiclock
|
||||
* chanserv/saset/url chanserv/saset/noexpire
|
||||
* chanserv/saset/url chanserv/saset/noexpire chanserv/saset/autoop
|
||||
*
|
||||
* memoserv/sendall memoserv/staff
|
||||
*
|
||||
* nickserv/getpass nickserv/sendpass nickserv/getemail nickserv/suspend
|
||||
* nickserv/getpass nickserv/getemail nickserv/suspend
|
||||
* nickserv/resetpass nickserv/release nickserv/list
|
||||
*
|
||||
* nickserv/saset/autoop nickserv/saset/email nickserv/saset/greet
|
||||
* nickserv/saset/icq nickserv/saset/kill nickserv/saset/language nickserv/saset/message
|
||||
* nickserv/saset/private nickserv/saset/secure nickserv/saset/url nickserv/saset/noexpire
|
||||
* nickserv/saset/autoop nickserv/saset/email nickserv/saset/greet nickserv/saset/password
|
||||
* nickserv/saset/display nickserv/saset/kill nickserv/saset/language nickserv/saset/message
|
||||
* nickserv/saset/private nickserv/saset/secure nickserv/saset/url nickserv/saset/noexpire
|
||||
*
|
||||
* hostserv/set hostserv/del
|
||||
* hostserv/set hostserv/del hostserv/list
|
||||
*
|
||||
* global/global
|
||||
*
|
||||
* operserv/news operserv/stats operserv/kick operserv/exception
|
||||
* operserv/mode operserv/session operserv/modlist operserv/ignore
|
||||
* operserv/chankill operserv/akill operserv/sqline operserv/snline
|
||||
* operserv/szline operserv/oper operserv/config operserv/umode
|
||||
* operserv/news operserv/stats operserv/kick operserv/exception operserv/seen
|
||||
* operserv/mode operserv/session operserv/modinfo operserv/ignore operserv/chanlist
|
||||
* operserv/chankill operserv/akill operserv/sqline operserv/snline operserv/userlist
|
||||
* operserv/global operserv/oper operserv/config operserv/umode operserv/logsearch
|
||||
* operserv/modload operserv/jupe operserv/set operserv/noop
|
||||
* operserv/quit operserv/update operserv/reload operserv/restart
|
||||
* operserv/shutdown operserv/svsnick operserv/oline operserv/kill
|
||||
* operserv/shutdown operserv/svs operserv/oline operserv/kill
|
||||
*
|
||||
* Firstly, we define 'opertypes' which are named whatever we want ('Network Administrator', etc).
|
||||
* These can contain commands for oper-only strings (see above) which grants access to that specific command,
|
||||
@@ -798,7 +812,7 @@ opertype
|
||||
inherits = "Helper, Another Helper"
|
||||
|
||||
/* What commands (see above) this opertype may use */
|
||||
commands = "chanserv/list chanserv/suspend chanserv/topic memoserv/staff nickserv/list nickserv/sendpass nickserv/resetpass nickserv/suspend operserv/mode operserv/chankill operserv/szline operserv/akill operserv/session operserv/modlist operserv/sqline operserv/oper operserv/kick operserv/ignore operserv/snline"
|
||||
commands = "chanserv/list chanserv/suspend chanserv/topic memoserv/staff nickserv/list nickserv/resetpass nickserv/suspend operserv/mode operserv/chankill operserv/akill operserv/session operserv/modinfo operserv/sqline operserv/oper operserv/kick operserv/ignore operserv/snline"
|
||||
|
||||
/* What privs (see above) this opertype has */
|
||||
privs = "chanserv/auspex chanserv/no-register-limit memoserv/* nickserv/auspex nickserv/confirm"
|
||||
@@ -820,7 +834,7 @@ opertype
|
||||
|
||||
inherits = "Services Operator"
|
||||
|
||||
commands = "chanserv/access/list chanserv/drop chanserv/getkey chanserv/saset/noexpire memoserv/sendall nickserv/saset/* nickserv/getemail operserv/news operserv/jupe operserv/svsnick operserv/stats operserv/oline operserv/noop operserv/forbid global/*"
|
||||
commands = "chanserv/access/list chanserv/drop chanserv/getkey chanserv/saset/noexpire memoserv/sendall nickserv/saset/* nickserv/getemail operserv/news operserv/jupe operserv/svs operserv/stats operserv/oline operserv/noop operserv/forbid global/* operserv/global"
|
||||
|
||||
privs = "*"
|
||||
}
|
||||
@@ -857,17 +871,17 @@ oper
|
||||
*/
|
||||
require_oper = yes
|
||||
|
||||
/* An optional password. If defined the user must login using /operserv login first */
|
||||
/* An optional password. If defined the user must login using "/msg OperServ LOGIN" first */
|
||||
#password = "secret"
|
||||
|
||||
/* An optional SSL fingerprint. If defined is required to use this opertype. */
|
||||
/* An optional SSL fingerprint. If defined, it's required to be able to use this opertype. */
|
||||
#certfp = "ed3383b3f7d74e89433ddaa4a6e5b2d7"
|
||||
|
||||
/* An optional list of user@host masks. If defined the user must be connected from one of them */
|
||||
#host = "*@*.anope.org ident@*"
|
||||
|
||||
/* An optional vhost to set on users who identify for this oper block.
|
||||
* This will override HostServ vhosts, and may not be available on all IRCds
|
||||
/* An optional vHost to set on users who identify for this oper block.
|
||||
* This will override HostServ vHosts, and may not be available on all IRCds
|
||||
*/
|
||||
#vhost = "oper.mynet"
|
||||
}
|
||||
@@ -927,7 +941,8 @@ mail
|
||||
sendfrom = "services@localhost.net"
|
||||
|
||||
/*
|
||||
* If set, SENDPASS and RESETPASS will be restricted to IRC operators.
|
||||
* If set, RESETPASS will be restricted to services operators with access to
|
||||
* nickserv/resetpass in their opertype:commands.
|
||||
* This directive is optional.
|
||||
*
|
||||
* WARNING: If you choose to not enable this option, you should limit the
|
||||
@@ -961,13 +976,14 @@ mail
|
||||
/*
|
||||
* The subject and message of emails sent to users when they register accounts.
|
||||
*/
|
||||
registration_subject = "Nickname Registration for %n"
|
||||
registration_subject = "Nickname registration for %n"
|
||||
registration_message = "Hi,
|
||||
|
||||
You have requested to register the nickname %n on %N.
|
||||
Please type \" /msg NickServ confirm %c \" to complete registration.
|
||||
Please type \" /msg NickServ CONFIRM %c \" to complete registration.
|
||||
|
||||
If you don't know why this mail was sent to you, please ignore it silently.
|
||||
|
||||
%N administrators."
|
||||
|
||||
/*
|
||||
@@ -983,19 +999,6 @@ mail
|
||||
|
||||
%N administrators."
|
||||
|
||||
/*
|
||||
* The subject and message of emails sent to users when they request SENDPASS.
|
||||
*/
|
||||
sendpass_subject = "Nickname password for %n"
|
||||
sendpass_message = "Hi,
|
||||
|
||||
You have requested to receive the password of nickname %n by e-mail.
|
||||
The password is %p. For security purposes, you should change it as soon as you receive this mail.
|
||||
|
||||
If you don't know why this mail was sent to you, please ignore it silently.
|
||||
|
||||
%N administrators."
|
||||
|
||||
/*
|
||||
* The subject and message of emails sent to users when they request a new email address.
|
||||
*/
|
||||
@@ -1003,45 +1006,23 @@ mail
|
||||
emailchange_message = "Hi,
|
||||
|
||||
You have requested to change your email address to %e.
|
||||
Please type \" /msg NickServ confirm %c \" to confirm this change.
|
||||
Please type \" /msg NickServ CONFIRM %c \" to confirm this change.
|
||||
|
||||
If you don't know why this mail was sent to you, please ignore it silently.
|
||||
|
||||
%N administrators."
|
||||
|
||||
/*
|
||||
* The subject and message of emails sent to users when they recieve a new memo.
|
||||
* The subject and message of emails sent to users when they receive a new memo.
|
||||
*/
|
||||
memo_subject = "New memo"
|
||||
memo_message = "Hi %n
|
||||
You've just received a new memo from %s. This is memo number %d.
|
||||
memo_message = "Hi %n,
|
||||
|
||||
Memo text:
|
||||
You've just received a new memo from %s. This is memo number %d.
|
||||
|
||||
%t"
|
||||
}
|
||||
Memo text:
|
||||
|
||||
/*
|
||||
* [OPTIONAL] DNS Config
|
||||
*
|
||||
* This section is used to configure DNS.
|
||||
* At this time DNS is only used by a few modules (m_dnsbl)
|
||||
* and is not required by the core to function.
|
||||
*/
|
||||
dns
|
||||
{
|
||||
/*
|
||||
* The nameserver to use for resolving hostnames, must be an IP or a resolver configuration file.
|
||||
* The below should work fine on all unix like systems. Windows users will have to find their nameservers
|
||||
* from ipconfig /all and put the IP here
|
||||
*/
|
||||
nameserver = "/etc/resolv.conf"
|
||||
#nameserver = "127.0.0.1"
|
||||
|
||||
/*
|
||||
* How long to wait in seconds before a DNS query has timed out
|
||||
*/
|
||||
timeout = 5
|
||||
%t"
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1099,6 +1080,15 @@ db_flatfile
|
||||
* The database name db_flatfile should use
|
||||
*/
|
||||
database = "anope.db"
|
||||
|
||||
/*
|
||||
* If enabled, services will fork a child process to save databases.
|
||||
*
|
||||
* This is only useful with very large databases, with hundreds
|
||||
* of thousands of objects, that have a noticeable delay from
|
||||
* writing databases.
|
||||
*/
|
||||
fork = no
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1118,7 +1108,8 @@ db_flatfile
|
||||
* This module allows saving and loading databases using one of the SQL engines.
|
||||
* This module reads and writes to SQL in real time. Changes to the SQL tables
|
||||
* will be immediately reflected into Anope. This module should not be loaded
|
||||
* in conjunction with db_sql.
|
||||
* in conjunction with db_sql, except during the initial import of existing
|
||||
* databases to SQL.
|
||||
*/
|
||||
#module { name = "db_sql_live" }
|
||||
|
||||
@@ -1138,18 +1129,26 @@ db_sql
|
||||
}
|
||||
|
||||
/*
|
||||
* [REQUIRED] Encryption modules.
|
||||
* [RECOMMENDED] Encryption modules.
|
||||
*
|
||||
* The encryption modules are used when dealing with passwords. This determines how
|
||||
* the passwords are stored in the databases, and does not add any security as
|
||||
* far as transmitting passwords over the network goes.
|
||||
*
|
||||
* Without any encryption modules, passwords will be stored in plain text, allowing
|
||||
* for passwords to be recovered later but isn't secure therefore is not recommended.
|
||||
*
|
||||
* The other encryption modules use one-way encryption, so the passwords can not
|
||||
*
|
||||
* Without any encryption modules loaded users will not be able to authenticate unless
|
||||
* there is another module loaded that provides authentication checking, such as
|
||||
* m_ldap_authentication or m_sql_authentication.
|
||||
*
|
||||
* With enc_none, passwords will be stored in plain text, allowing for passwords
|
||||
* to be recovered later but it isn't secure and therefore is not recommended.
|
||||
*
|
||||
* The other encryption modules use one-way encryption, so the passwords can not
|
||||
* be recovered later if those are used.
|
||||
*
|
||||
* The first encryption module loaded is the primary encryption module. All new passwords are
|
||||
* encrypted by this module. Old passwords stored in another encryption method are
|
||||
* automatically re-encrypted by the primary encryption module on next identify.
|
||||
*
|
||||
* NOTE: enc_old is Anope's previous (broken) MD5 implementation, if your databases
|
||||
* were made using that module, continue to use it and do not use enc_md5.
|
||||
*
|
||||
@@ -1160,29 +1159,27 @@ db_sql
|
||||
* that you first try to get everyone's passwords converted to enc_sha256 before
|
||||
* switching OSes by placing enc_sha256 at the beginning of the list.
|
||||
*
|
||||
* The first encryption module loaded is the primary encryption module. All new passwords are
|
||||
* encrypted by this module. Old passwords stored in another encryption method are
|
||||
* automatically re-encrypted by the primary encryption module on next identify.
|
||||
*/
|
||||
module { name = "enc_md5" }
|
||||
|
||||
module { name = "enc_sha256" }
|
||||
#module { name = "enc_md5" }
|
||||
#module { name = "enc_sha1" }
|
||||
#module { name = "enc_sha256" }
|
||||
|
||||
/*
|
||||
* When using enc_none, passwords will be stored without encryption in plain
|
||||
* text, allowing for passwords to be recovered later. This isn't secure therefore
|
||||
* is not recommended.
|
||||
* When using enc_none, passwords will be stored without encryption. This isn't secure
|
||||
* therefore it is not recommended.
|
||||
*/
|
||||
#module { name = "enc_none" }
|
||||
|
||||
/*
|
||||
* enc_old is Anope's previous (broken) MD5 implementation, if your databases
|
||||
* were made using that module, load it here to allow conversion to the primary
|
||||
* enc_old is Anope's previous (broken) MD5 implementation used from 1.4.x to 1.7.16.
|
||||
* If your databases were made using that module, load it here to allow conversion to the primary
|
||||
* encryption method.
|
||||
*/
|
||||
#module { name = "enc_old" }
|
||||
|
||||
/* Extra (optional) modules */
|
||||
|
||||
/* Extra (optional) modules. */
|
||||
include
|
||||
{
|
||||
type = "file"
|
||||
@@ -1190,10 +1187,9 @@ include
|
||||
}
|
||||
|
||||
/*
|
||||
* Chanstats Modules
|
||||
* Requires a MySQL Database
|
||||
* Chanstats module.
|
||||
* Requires a MySQL Database.
|
||||
*/
|
||||
|
||||
#include
|
||||
#{
|
||||
# type = "file"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
service
|
||||
{
|
||||
/*
|
||||
* The name of the Global client
|
||||
* The name of the Global client.
|
||||
*/
|
||||
nick = "Global"
|
||||
|
||||
@@ -35,8 +35,8 @@ service
|
||||
* These modes are very IRCd specific. If left commented, sane defaults
|
||||
* are used based on what protocol module you have loaded.
|
||||
*
|
||||
* Note that setting this option incorrectly could potentially BREAK some if
|
||||
* not all usefulness of the client. We will not support you if this client is
|
||||
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||
* not all, usefulness of the client. We will not support you if this client is
|
||||
* unable to do certain things if this option is enabled.
|
||||
*/
|
||||
#modes = "+o"
|
||||
@@ -46,7 +46,7 @@ service
|
||||
* of log channels this is not very useful, as the service will just idle in the
|
||||
* specified channels, and will not accept any types of commands.
|
||||
*
|
||||
* Prefixes may be given to the channels in the form of mode character or prefix symbol.
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
}
|
||||
@@ -90,7 +90,7 @@ global
|
||||
globaloncycleup = "Services are now back online - have a nice day"
|
||||
|
||||
/*
|
||||
* If set, Services will hide the IRC operator's nick in a global
|
||||
* If set, Services will hide the IRC Operator's nick in a global
|
||||
* message/notice.
|
||||
*
|
||||
* This directive is optional.
|
||||
@@ -109,7 +109,7 @@ global
|
||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||
*/
|
||||
|
||||
/* Give it a help command */
|
||||
/* Give it a help command. */
|
||||
command { service = "Global"; name = "HELP"; command = "generic/help"; }
|
||||
|
||||
/*
|
||||
@@ -122,4 +122,3 @@ command { service = "Global"; name = "HELP"; command = "generic/help"; }
|
||||
module { name = "gl_global" }
|
||||
command { service = "OperServ"; name = "GLOBAL"; command = "global/global"; permission = "operserv/global"; }
|
||||
command { service = "Global"; name = "GLOBAL"; command = "global/global"; permission = "global/global"; }
|
||||
|
||||
|
||||
+12
-13
@@ -9,7 +9,7 @@
|
||||
service
|
||||
{
|
||||
/*
|
||||
* The name of the HostServ client
|
||||
* The name of the HostServ client.
|
||||
*/
|
||||
nick = "HostServ"
|
||||
|
||||
@@ -35,8 +35,8 @@ service
|
||||
* These modes are very IRCd specific. If left commented, sane defaults
|
||||
* are used based on what protocol module you have loaded.
|
||||
*
|
||||
* Note that setting this option incorrectly could potentially BREAK some if
|
||||
* not all usefulness of the client. We will not support you if this client is
|
||||
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||
* not all, usefulness of the client. We will not support you if this client is
|
||||
* unable to do certain things if this option is enabled.
|
||||
*/
|
||||
#modes = "+o"
|
||||
@@ -46,7 +46,7 @@ service
|
||||
* of log channels this is not very useful, as the service will just idle in the
|
||||
* specified channels, and will not accept any types of commands.
|
||||
*
|
||||
* Prefixes may be given to the channels in the form of mode character or prefix symbol.
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
}
|
||||
@@ -69,9 +69,9 @@ hostserv
|
||||
name = "HostServ"
|
||||
|
||||
/*
|
||||
* The characters allowed in a vhost. Changing this is not recommended unless
|
||||
* The characters allowed in a vHost. Changing this is not recommended unless
|
||||
* you know for sure your IRCd supports whatever characters you are wanting to use.
|
||||
* Telling services to set a vhost containing characters your IRCd disallows could
|
||||
* Telling services to set a vHost containing characters your IRCd disallows could
|
||||
* potentially break the IRCd and/or Services. Note these are 1 byte characters, so
|
||||
* UTF-8 characters will not work.
|
||||
*
|
||||
@@ -80,7 +80,7 @@ hostserv
|
||||
vhost_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-"
|
||||
|
||||
/*
|
||||
* If set, allows vhosts to not contain dots (.).
|
||||
* If set to true, allows vHosts to not contain dots (.).
|
||||
* Newer IRCds generally do not have a problem with this, but the same warning as
|
||||
* vhost_chars applies.
|
||||
*
|
||||
@@ -90,7 +90,7 @@ hostserv
|
||||
|
||||
/*
|
||||
* The characters that are not allowed to be at the very beginning or very ending
|
||||
* of a vhost. The same warning as vhost_chars applies.
|
||||
* of a vHost. The same warning as vhost_chars applies.
|
||||
*
|
||||
* It is recommended you DON'T change this.
|
||||
*/
|
||||
@@ -108,7 +108,7 @@ hostserv
|
||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||
*/
|
||||
|
||||
/* Give it a help command */
|
||||
/* Give it a help command. */
|
||||
command { service = "HostServ"; name = "HELP"; command = "generic/help"; }
|
||||
|
||||
/*
|
||||
@@ -116,7 +116,7 @@ command { service = "HostServ"; name = "HELP"; command = "generic/help"; }
|
||||
*
|
||||
* Provides the commands hostserv/del and hostserv/delall.
|
||||
*
|
||||
* Used for removing users vHosts.
|
||||
* Used for removing users' vHosts.
|
||||
*/
|
||||
module { name = "hs_del" }
|
||||
command { service = "HostServ"; name = "DEL"; command = "hostserv/del"; permission = "hostserv/del"; }
|
||||
@@ -167,7 +167,7 @@ command { service = "HostServ"; name = "ON"; command = "hostserv/on"; }
|
||||
*
|
||||
* Provides the commands hostserv/request, hostserv/active, hostserv/reject, and hostserv/waiting.
|
||||
*
|
||||
* Used to manage vhosts requested by users.
|
||||
* Used to manage vHosts requested by users.
|
||||
*/
|
||||
module { name = "hs_request" }
|
||||
command { service = "HostServ"; name = "REQUEST"; command = "hostserv/request"; }
|
||||
@@ -193,9 +193,8 @@ hs_request
|
||||
*
|
||||
* Provides the commands hostserv/set and hostserv/setall.
|
||||
*
|
||||
* Used for setting users vhosts.
|
||||
* Used for setting users' vHosts.
|
||||
*/
|
||||
module { name = "hs_set" }
|
||||
command { service = "HostServ"; name = "SET"; command = "hostserv/set"; permission = "hostserv/set"; }
|
||||
command { service = "HostServ"; name = "SETALL"; command = "hostserv/setall"; permission = "hostserv/set"; }
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
service
|
||||
{
|
||||
/*
|
||||
* The name of the MemoServ client
|
||||
* The name of the MemoServ client.
|
||||
*/
|
||||
nick = "MemoServ"
|
||||
|
||||
@@ -35,8 +35,8 @@ service
|
||||
* These modes are very IRCd specific. If left commented, sane defaults
|
||||
* are used based on what protocol module you have loaded.
|
||||
*
|
||||
* Note that setting this option incorrectly could potentially BREAK some if
|
||||
* not all usefulness of the client. We will not support you if this client is
|
||||
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||
* not all, usefulness of the client. We will not support you if this client is
|
||||
* unable to do certain things if this option is enabled.
|
||||
*/
|
||||
#modes = "+o"
|
||||
@@ -46,7 +46,7 @@ service
|
||||
* of log channels this is not very useful, as the service will just idle in the
|
||||
* specified channels, and will not accept any types of commands.
|
||||
*
|
||||
* Prefixes may be given to the channels in the form of mode character or prefix symbol.
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
}
|
||||
@@ -111,7 +111,7 @@ memoserv
|
||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||
*/
|
||||
|
||||
/* Give it a help command */
|
||||
/* Give it a help command. */
|
||||
command { service = "MemoServ"; name = "HELP"; command = "generic/help"; }
|
||||
|
||||
/*
|
||||
@@ -190,7 +190,7 @@ command { service = "MemoServ"; name = "READ"; command = "memoserv/read"; }
|
||||
* Provides the command memoserv/rsend.
|
||||
*
|
||||
* Used to send a memo requiring a receipt be sent back once it is read.
|
||||
*
|
||||
*
|
||||
* Requires configuring memoserv:memoreceipt.
|
||||
*/
|
||||
#module { name = "ms_rsend" }
|
||||
@@ -199,7 +199,7 @@ command { service = "MemoServ"; name = "READ"; command = "memoserv/read"; }
|
||||
/*
|
||||
* ms_send
|
||||
*
|
||||
* Provides the command memoserv/send
|
||||
* Provides the command memoserv/send.
|
||||
*
|
||||
* Used to send memos.
|
||||
*/
|
||||
@@ -209,7 +209,7 @@ command { service = "MemoServ"; name = "SEND"; command = "memoserv/send"; }
|
||||
/*
|
||||
* ms_sendall
|
||||
*
|
||||
* Provides the command memoserv/sendall
|
||||
* Provides the command memoserv/sendall.
|
||||
*
|
||||
* Used to send a mass memo to every registered user.
|
||||
*/
|
||||
@@ -235,4 +235,3 @@ command { service = "MemoServ"; name = "SET"; command = "memoserv/set"; }
|
||||
*/
|
||||
module { name = "ms_staff" }
|
||||
command { service = "MemoServ"; name = "STAFF"; command = "memoserv/staff"; permission = "memoserv/staff"; }
|
||||
|
||||
|
||||
+191
-85
@@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
* [OPTIONAL] Non-Core Modules
|
||||
*
|
||||
@@ -10,12 +9,64 @@
|
||||
/*
|
||||
* help
|
||||
*
|
||||
* Provides commands generic/help
|
||||
* Provides the command generic/help.
|
||||
*
|
||||
* Is a generic help command that can be used with any client.
|
||||
* This is a generic help command that can be used with any client.
|
||||
*/
|
||||
module { name = "help" }
|
||||
|
||||
/*
|
||||
* m_dns
|
||||
*
|
||||
* Adds support for the DNS protocol. By itself this module does nothing useful,
|
||||
* but other modules such as m_dnsbl and os_dns require this.
|
||||
*/
|
||||
#module { name = "m_dns" }
|
||||
dns
|
||||
{
|
||||
/*
|
||||
* The nameserver to use for resolving hostnames, must be an IP or a resolver configuration file.
|
||||
* The below should work fine on all unix like systems. Windows users will have to find their nameservers
|
||||
* from ipconfig /all and put the IP here.
|
||||
*/
|
||||
nameserver = "/etc/resolv.conf"
|
||||
#nameserver = "127.0.0.1"
|
||||
|
||||
/*
|
||||
* How long to wait in seconds before a DNS query has timed out.
|
||||
*/
|
||||
timeout = 5
|
||||
|
||||
|
||||
/* Only edit below if you are expecting to use os_dns or otherwise answer DNS queries. */
|
||||
|
||||
/*
|
||||
* The IP and port services use to listen for DNS queries.
|
||||
* Note that ports less than 1024 are privileged on UNIX/Linux systems, and
|
||||
* require Anope to be started as root. If you do this, it is recommended you
|
||||
* set options:user and options:group so Anope can change users after binding
|
||||
* to this port.
|
||||
*/
|
||||
ip = "0.0.0.0"
|
||||
port = 53
|
||||
|
||||
|
||||
/*
|
||||
* SOA record information.
|
||||
*/
|
||||
|
||||
/* E-mail address of the DNS administrator. */
|
||||
admin = "admin@example.com"
|
||||
|
||||
/* This should be the names of the public facing nameservers serving the records. */
|
||||
nameservers = "ns1.example.com ns2.example.com"
|
||||
|
||||
/* The time slave servers are allowed to cache. This should be reasonably low
|
||||
* if you want your records to be updated without much delay.
|
||||
*/
|
||||
refresh = 3600
|
||||
}
|
||||
|
||||
/*
|
||||
* m_dnsbl
|
||||
*
|
||||
@@ -23,7 +74,7 @@ module { name = "help" }
|
||||
* is found on the blacklist they will be immediately banned. This is a crucial module
|
||||
* to prevent bot attacks.
|
||||
*/
|
||||
module { name = "m_dnsbl" }
|
||||
#module { name = "m_dnsbl" }
|
||||
m_dnsbl
|
||||
{
|
||||
/*
|
||||
@@ -48,10 +99,10 @@ m_dnsbl
|
||||
}
|
||||
blacklist
|
||||
{
|
||||
/* Name of the blacklist */
|
||||
/* Name of the blacklist. */
|
||||
name = "rbl.efnetrbl.org"
|
||||
|
||||
/* How long to set the ban for */
|
||||
/* How long to set the ban for. */
|
||||
time = 4h
|
||||
|
||||
/* Reason for akill.
|
||||
@@ -65,7 +116,7 @@ blacklist
|
||||
*/
|
||||
reason = "You are listed in the efnet RBL, visit http://rbl.efnetrbl.org/?i=%i for info"
|
||||
|
||||
/* Replies to ban and their reason. If this is totally ommited all replies get banned */
|
||||
/* Replies to ban and their reason. If this is totally ommited all replies get banned. */
|
||||
1 = "Open Proxy"
|
||||
/* Don't ban for result 2 or 3 */
|
||||
#2 = "spamtrap666"
|
||||
@@ -102,16 +153,21 @@ m_helpchan
|
||||
#module { name = "m_httpd" }
|
||||
httpd
|
||||
{
|
||||
/* Name of this service */
|
||||
/* Name of this service. */
|
||||
name = "httpd/main"
|
||||
|
||||
/* IP to listen on */
|
||||
|
||||
/* IP to listen on. */
|
||||
ip = "0.0.0.0"
|
||||
/* Port to listen on */
|
||||
|
||||
/* Port to listen on. */
|
||||
port = 8080
|
||||
/* Time before connections to this server are timed out */
|
||||
|
||||
/* Time before connections to this server are timed out. */
|
||||
timeout = 30
|
||||
|
||||
/* Listen using SSL. Requires m_ssl. */
|
||||
#ssl = yes
|
||||
|
||||
/* If you are using a reverse proxy that sends one of the
|
||||
* extforward_headers set below, set this to its IP.
|
||||
* This allows services to obtain the real IP of users by
|
||||
@@ -157,14 +213,14 @@ m_ldap_authentication
|
||||
|
||||
/*
|
||||
* The search filter used to look up users's accounts.
|
||||
* %account is replaced with the user's account
|
||||
* %account is replaced with the user's account.
|
||||
* %object_class is replaced with the object_class configured below.
|
||||
*/
|
||||
search_filter = "(&(uid=%account)(objectClass=%object_class))"
|
||||
|
||||
/*
|
||||
* The object class used by LDAP to store user account information.
|
||||
* Used for adding new users to LDAP if disable_ns_register is false
|
||||
* Used for adding new users to LDAP if disable_ns_register is false.
|
||||
*/
|
||||
object_class = "anopeUser"
|
||||
|
||||
@@ -186,15 +242,15 @@ m_ldap_authentication
|
||||
password_attribute = "userPassword"
|
||||
|
||||
/*
|
||||
* Enable to have this module disable /nickserv register.
|
||||
* Enable this to have this module disable "/msg NickServ REGISTER".
|
||||
*/
|
||||
disable_ns_register = false
|
||||
|
||||
/*
|
||||
* The reason to give the users who try to /ns register if
|
||||
* The reason to give the users who try to "/msg NickServ REGISTER" if
|
||||
* disable_ns_register is enabled.
|
||||
*/
|
||||
#disable_reason = "To register on this network visit http://some.misconfigured.site/register"
|
||||
#disable_reason = "To register on this network, visit http://some.misconfigured.site/register"
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -245,7 +301,7 @@ m_ldap_oper
|
||||
#module { name = "m_mysql" }
|
||||
mysql
|
||||
{
|
||||
/* The name of this service */
|
||||
/* The name of this service. */
|
||||
name = "mysql/main"
|
||||
database = "anope"
|
||||
server = "127.0.0.1"
|
||||
@@ -275,7 +331,7 @@ m_proxyscan
|
||||
* avaiable IP that remote proxies can connect to.
|
||||
*/
|
||||
#target_ip = "127.0.0.1"
|
||||
|
||||
|
||||
/*
|
||||
* The port services tells the proxy to connect to.
|
||||
*/
|
||||
@@ -296,7 +352,7 @@ m_proxyscan
|
||||
/*
|
||||
* An optional notice sent to clients upon connect.
|
||||
*/
|
||||
#connect_notice = "We will now scan your host for insecure proxies. If you do not consent to this scan please disconnect immediately"
|
||||
#connect_notice = "We will now scan your host for insecure proxies. If you do not consent to this scan please disconnect immediately."
|
||||
|
||||
/*
|
||||
* Who the notice should be sent from.
|
||||
@@ -305,7 +361,7 @@ m_proxyscan
|
||||
|
||||
/*
|
||||
* If set, OperServ will add infected clients to the akill list. Without it, OperServ simply sends
|
||||
* a timed G/K-line to the IRCd and forgets about it. Can be useful if your akill list is being fill up by bots.
|
||||
* a timed G/K-line to the IRCd and forgets about it. Can be useful if your akill list is being filled up by bots.
|
||||
*/
|
||||
add_to_akill = yes
|
||||
|
||||
@@ -321,13 +377,13 @@ m_proxyscan
|
||||
*/
|
||||
proxyscan
|
||||
{
|
||||
/* The type of proxy to check for. A comma separated list is allowed */
|
||||
/* The type of proxy to check for. A comma separated list is allowed. */
|
||||
type = "HTTP"
|
||||
|
||||
/* The ports to check */
|
||||
/* The ports to check. */
|
||||
port = "80,8080"
|
||||
|
||||
/* How long to set the ban for */
|
||||
/* How long to set the ban for. */
|
||||
time = 4h
|
||||
|
||||
/*
|
||||
@@ -339,6 +395,80 @@ proxyscan
|
||||
reason = "You have an open proxy running on your host (%t:%i:%p)"
|
||||
}
|
||||
|
||||
/*
|
||||
* m_sql_authentication
|
||||
*
|
||||
* This module allows authenticating users against an external SQL database using a custom
|
||||
* query.
|
||||
*/
|
||||
#module { name = "m_sql_authentication" }
|
||||
m_sql_authentication
|
||||
{
|
||||
/* SQL engine to use. Should be configured elsewhere with m_mysql, m_sqlite, etc. */
|
||||
engine = "mysql/main"
|
||||
|
||||
/* Query to execute to authenticate. A non empty result from this query is considered a success,
|
||||
* and the user will be authenticated.
|
||||
*
|
||||
* @a@ is replaced with the user's account name
|
||||
* @p@ is replaced with the user's password
|
||||
* @n@ is replaced with the user's nickname
|
||||
* @i@ is replaced with the user's IP
|
||||
*
|
||||
* Note that @n@ and @i@ may not always exist in the case of a user identifying outside of the normal
|
||||
* nickserv/identify command, such as through the web panel.
|
||||
*
|
||||
* Furthermore, if a field named email is returned from this query the user's email is
|
||||
* set to its value.
|
||||
*
|
||||
*
|
||||
* We've included some example queries for some popular website/forum systems.
|
||||
*
|
||||
* Drupal 6: "SELECT `mail` AS `email` FROM `users` WHERE `name` = @a@ AND `pass` = MD5(@p@) AND `status` = 1"
|
||||
* e107 cms: "SELECT `user_email` AS `email` FROM `e107_user` WHERE `user_loginname` = @a@ AND `user_password` = MD5(@p@)"
|
||||
* SMF Forum: "SELECT `email_address` AS `email` FROM `smf_members` WHERE `member_name` = @a@ AND `passwd` = SHA1(CONCAT(LOWER(@a@), @p@))"
|
||||
* vBulletin: "SELECT `email` FROM `user` WHERE `username` = @a@ AND `password` = MD5(CONCAT(MD5(@p@), `salt`))"
|
||||
* IP.Board: "SELECT `email` FROM `ibf_members` WHERE `name` = @a@ AND `members_pass_hash` = MD5(CONCAT(MD5(`members_pass_salt`), MD5(@p@)))"
|
||||
*/
|
||||
query = "SELECT `email_addr` AS `email` FROM `my_users` WHERE `username` = @a@ AND `password` = MD5(CONCAT('salt', @p@))"
|
||||
|
||||
/*
|
||||
* Enable this to have this module disable "/msg NickServ REGISTER".
|
||||
*/
|
||||
disable_ns_register = false
|
||||
|
||||
/*
|
||||
* The reason to give the users who try to "/msg NickServ REGISTER" if
|
||||
* disable_ns_register is enabled.
|
||||
*/
|
||||
#disable_reason = "To register on this network visit http://some.misconfigured.site/register"
|
||||
}
|
||||
|
||||
/*
|
||||
* m_sql_oper
|
||||
*
|
||||
* This module allows granting users services operator privileges and possibly IRC Operator
|
||||
* privileges based on an external SQL database using a custom query.
|
||||
*/
|
||||
#module { name = "m_sql_oper" }
|
||||
m_sql_oper
|
||||
{
|
||||
/* SQL engine to use. Should be configured elsewhere with m_mysql, m_sqlite, etc. */
|
||||
engine = "mysql/main"
|
||||
|
||||
/* Query to execute to determine if a user should have operator privileges.
|
||||
* A field named opertype must be returned in order to link the user to their oper type.
|
||||
* The oper types must be configured earlier in services.conf.
|
||||
*
|
||||
* If a field named modes is returned from this query then those modes are set on the user.
|
||||
* Without this, only a simple +o is sent.
|
||||
*
|
||||
* @a@ is replaced with the user's account name
|
||||
* @i@ is replaced with the user's IP
|
||||
*/
|
||||
query = "SELECT `opertype` FROM `my_users` WHERE `user_name` = @a@"
|
||||
}
|
||||
|
||||
/*
|
||||
* m_sqlite
|
||||
*
|
||||
@@ -347,8 +477,9 @@ proxyscan
|
||||
#module { name = "m_sqlite" }
|
||||
sqlite
|
||||
{
|
||||
/* The name of this service */
|
||||
/* The name of this service. */
|
||||
name = "sqlite/main"
|
||||
|
||||
/* The database name, it will be created if it does not exist. */
|
||||
database = "anope.db"
|
||||
}
|
||||
@@ -378,30 +509,39 @@ module { name = "m_regex_pcre" }
|
||||
/*
|
||||
* m_rewrite
|
||||
*
|
||||
* Allows rewriting commands sent to clients.
|
||||
* Allows rewriting commands sent to/from clients.
|
||||
*/
|
||||
#module { name = "m_rewrite" }
|
||||
rewrite
|
||||
{
|
||||
/* The client to apply this rewrite to. */
|
||||
client = "ChanServ"
|
||||
|
||||
/* Source message to match. A $ can be used to match anything. */
|
||||
source_message = "CLEAR $ USERS"
|
||||
|
||||
/*
|
||||
* Message to rewrite the source message to. A $ followed by a number, eg $0, gets
|
||||
* replaced by the number-th word from the source_message, starting from 0.
|
||||
*/
|
||||
target_message = "CLEARUSERS $1"
|
||||
}
|
||||
module { name = "m_rewrite" }
|
||||
#command
|
||||
#{
|
||||
# service = "ChanServ"; name = "CLEAR"; command = "rewrite"
|
||||
#
|
||||
# /* Enable m_rewrite. */
|
||||
# rewrite = true
|
||||
#
|
||||
# /* Source message to match. A $ can be used to match anything. */
|
||||
# rewrite_source = "CLEAR $ USERS"
|
||||
#
|
||||
# /*
|
||||
# * Message to rewrite the source message to. A $ followed by a number, eg $0, gets
|
||||
# * replaced by the number-th word from the source_message, starting from 0.
|
||||
# */
|
||||
# rewrite_target = "KICK $1 *"
|
||||
#
|
||||
# /*
|
||||
# * The command description. This only shows up in HELP's output.
|
||||
# * Comment this option to prevent the command from showing in the
|
||||
# * HELP command.
|
||||
# */
|
||||
# rewrite_description = "Clears all users from a channel"
|
||||
#}
|
||||
|
||||
/*
|
||||
* m_ssl
|
||||
*
|
||||
* This module uses SSL to connect to the uplink server(s)
|
||||
* This module uses SSL to connect to the uplink server(s).
|
||||
*/
|
||||
module { name = "m_ssl" }
|
||||
#module { name = "m_ssl" }
|
||||
ssl
|
||||
{
|
||||
/*
|
||||
@@ -417,14 +557,6 @@ ssl
|
||||
}
|
||||
|
||||
/*
|
||||
* m_statusupdate
|
||||
*
|
||||
* This module automatically updates users status on channels when the
|
||||
* channel's access list is modified.
|
||||
*/
|
||||
module { name = "m_statusupdate" }
|
||||
|
||||
/*
|
||||
* m_xmlrpc
|
||||
*
|
||||
* Allows remote applications (websites) to execute queries in real time to retrieve data from Anope.
|
||||
@@ -433,18 +565,8 @@ module { name = "m_statusupdate" }
|
||||
#module { name = "m_xmlrpc" }
|
||||
m_xmlrpc
|
||||
{
|
||||
/* IP to listen on */
|
||||
bindip = "127.0.0.1"
|
||||
/* Port to listen on */
|
||||
port = 26673
|
||||
/* Enable for IPv6 */
|
||||
ipv6 = no
|
||||
/* If enabled, requires m_ssl to be loaded */
|
||||
ssl = no
|
||||
/* IPs allowed to connect (separate with spaces), this should be secured. We also recommend you firewall this
|
||||
* with an outside program to increase security.
|
||||
*/
|
||||
allowed = "127.0.0.0/24"
|
||||
/* Web service to use. Requires m_httpd. */
|
||||
server = "httpd/main"
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -455,23 +577,6 @@ m_xmlrpc
|
||||
*/
|
||||
#module { name = "m_xmlrpc_main" }
|
||||
|
||||
/*
|
||||
* ns_maxemail
|
||||
*
|
||||
* Limits how many times the same email address may be used in Anope
|
||||
* to register accounts.
|
||||
*/
|
||||
module { name = "ns_maxemail" }
|
||||
ns_maxemail
|
||||
{
|
||||
/*
|
||||
* The limit to how many registered nicks can use the same e-mail address. If set to 0 or left
|
||||
* commented, there will be no limit enforced when registering new accounts or using
|
||||
* /msg NickServ SET EMAIL.
|
||||
*/
|
||||
#maxemails = 1
|
||||
}
|
||||
|
||||
/*
|
||||
* webcpanel
|
||||
*
|
||||
@@ -484,14 +589,15 @@ ns_maxemail
|
||||
#module { name = "webcpanel" }
|
||||
webcpanel
|
||||
{
|
||||
/* Web server to use */
|
||||
/* Web server to use. */
|
||||
server = "httpd/main";
|
||||
|
||||
/* Template to use */
|
||||
/* Template to use. */
|
||||
template = "default";
|
||||
|
||||
/* Page title */
|
||||
/* Page title. */
|
||||
title = "Anope IRC Services";
|
||||
|
||||
/* Whether or not to use https on redirecting URLs. */
|
||||
ssl = no
|
||||
}
|
||||
|
||||
|
||||
|
||||
+141
-176
@@ -9,7 +9,7 @@
|
||||
service
|
||||
{
|
||||
/*
|
||||
* The name of the NickServ client
|
||||
* The name of the NickServ client.
|
||||
*/
|
||||
nick = "NickServ"
|
||||
|
||||
@@ -35,8 +35,8 @@ service
|
||||
* These modes are very IRCd specific. If left commented, sane defaults
|
||||
* are used based on what protocol module you have loaded.
|
||||
*
|
||||
* Note that setting this option incorrectly could potentially BREAK some if
|
||||
* not all usefulness of the client. We will not support you if this client is
|
||||
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||
* not all, usefulness of the client. We will not support you if this client is
|
||||
* unable to do certain things if this option is enabled.
|
||||
*/
|
||||
#modes = "+o"
|
||||
@@ -46,7 +46,7 @@ service
|
||||
* of log channels this is not very useful, as the service will just idle in the
|
||||
* specified channels, and will not accept any types of commands.
|
||||
*
|
||||
* Prefixes may be given to the channels in the form of mode character or prefix symbol.
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
}
|
||||
@@ -70,7 +70,7 @@ nickserv
|
||||
|
||||
/*
|
||||
* Force users to give an e-mail address when they register a nick.
|
||||
*
|
||||
*
|
||||
* This directive is recommended to be enabled, and required if e-mail registration is enabled.
|
||||
*/
|
||||
forceemail = yes
|
||||
@@ -89,11 +89,11 @@ nickserv
|
||||
registration = "none"
|
||||
|
||||
/*
|
||||
* A message sent to users on connect if they user an unregistered nick.
|
||||
* A message sent to users on connect if they use an unregistered nick.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#unregistered_notice = "Your nickname is not registered. To register it use /nickserv register password email."
|
||||
#unregistered_notice = "Your nickname is not registered. To register it, use: /msg NickServ REGISTER password email"
|
||||
|
||||
/*
|
||||
* The default options for newly registered nicks. Note that changing these options
|
||||
@@ -110,29 +110,31 @@ nickserv
|
||||
* - hideemail: Hide's the nick's e-mail address from NickServ's INFO command
|
||||
* - hideusermask: Hide's the nick's last or current user@host from NickServ's INFO command
|
||||
* - hidequit: Hide's the nick's last quit message
|
||||
* - memosignon: Notify user if they have a new memo when they sign into the nick
|
||||
* - memoreceive: Notify user if they have a new memo as soon as it's received
|
||||
* - memo_signon: Notify user if they have a new memo when they sign into the nick
|
||||
* - memo_receive: Notify user if they have a new memo as soon as it's received
|
||||
* - autoop: User will be automatically opped in channels they enter and have access to
|
||||
* - msg: Services messages will be sent as PRIVMSGs instead of NOTICEs, requires UsePrivmsg
|
||||
* to be enabled as well
|
||||
* - msg: Services messages will be sent as PRIVMSGs instead of NOTICEs, requires
|
||||
* options:useprivmsg to be enabled as well
|
||||
*
|
||||
* This directive is optional, if left blank, the options will default to secure, memosignon, and
|
||||
* memoreceive. If you really want no defaults, use "none" by itself as the option.
|
||||
* This directive is optional, if left blank, the options will default to secure, memo_signon, and
|
||||
* memo_receive. If you really want no defaults, use "none" by itself as the option.
|
||||
*/
|
||||
defaults="secure private hideemail hideusermask memosignon memoreceive autoop"
|
||||
defaults="secure private hideemail hideusermask memo_signon memo_receive autoop"
|
||||
|
||||
/*
|
||||
* A list of languages to load on startup that will be available in /nickserv set language.
|
||||
* Useful if you translate Anope to your language. (Explained further in docs/LANGUAGE).
|
||||
* Note that english should not be listed here because it is the base language.
|
||||
*
|
||||
* Removing .UTF-8 will instead use the default encoding for the language, eg. iso-8859-1 for western European languages.
|
||||
*/
|
||||
languages = "ca_ES de_DE el_GR es_ES fr_FR hu_HU it_IT nl_NL pl_PL pt_PT ru_RU tr_TR"
|
||||
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"
|
||||
|
||||
/*
|
||||
* Default language that non- and newly-registered nicks will receive messages in.
|
||||
* Leave empty to default to English.
|
||||
*/
|
||||
#defaultlanguage = "es_ES"
|
||||
#defaultlanguage = "es_ES.UTF-8"
|
||||
|
||||
/*
|
||||
* The minimum length of time between consecutive uses of NickServ's REGISTER command. This
|
||||
@@ -148,7 +150,7 @@ nickserv
|
||||
resenddelay = 90s
|
||||
|
||||
/*
|
||||
* The length of time before a nick registration expires.
|
||||
* The length of time before a nick's registration expires.
|
||||
*
|
||||
* This directive is optional, but recommended. If not set, the default is 21 days.
|
||||
*/
|
||||
@@ -157,7 +159,7 @@ nickserv
|
||||
/*
|
||||
* The length of time before a suspended nick becomes unsuspended.
|
||||
*
|
||||
* This directive is optional. If not set, the default is to never.
|
||||
* This directive is optional. If not set, the default is never.
|
||||
*/
|
||||
#suspendexpire = 90d
|
||||
|
||||
@@ -183,7 +185,7 @@ nickserv
|
||||
|
||||
/*
|
||||
* The username (and possibly hostname) used for the fake user created when NickServ collides
|
||||
* a user. Should be in the user@host format.
|
||||
* a user.
|
||||
*/
|
||||
enforceruser = "enforcer"
|
||||
enforcerhost = "localhost.net"
|
||||
@@ -230,7 +232,7 @@ nickserv
|
||||
|
||||
/*
|
||||
* If set, any user wanting to use the privileges of Services Root, Services Admin, or Services
|
||||
* Operator must have been logged as an IRC Operator with the /oper command.
|
||||
* Operator must have been logged as an IRC Operator with the /OPER command.
|
||||
*
|
||||
* This directive is optional, but recommended.
|
||||
*/
|
||||
@@ -256,6 +258,41 @@ nickserv
|
||||
* The maximum number of channels a user can have on NickServ's AJOIN command.
|
||||
*/
|
||||
ajoinmax = 10
|
||||
|
||||
/*
|
||||
* If set, is the length of time NickServ's killquick and kill options wait before
|
||||
* forcing users off of protected nicknames.
|
||||
*/
|
||||
killquick = 20s
|
||||
kill = 60s
|
||||
|
||||
/*
|
||||
* If set, Services will set these user modes on any user who identifies.
|
||||
*
|
||||
* This directive is optional.
|
||||
*/
|
||||
#modesonid = "+R"
|
||||
|
||||
/*
|
||||
* If set, Services will svsnick and svsjoin users who use the recover
|
||||
* command on an identified user to the nick and channels of the recovered user.
|
||||
*
|
||||
* This directive is opional.
|
||||
*/
|
||||
restoreonrecover = yes
|
||||
|
||||
/*
|
||||
* Some IRCds allow "SASL" authentication to let users identify to Services
|
||||
* during the IRCd user registration process. If set, Services will allow
|
||||
* authenticating users through this mechanism.
|
||||
*/
|
||||
sasl = yes
|
||||
|
||||
/*
|
||||
* If set, Services will not show netsplits in the last quit message field
|
||||
* of NickServ's INFO command.
|
||||
*/
|
||||
hidenetsplitquit = no
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -266,10 +303,21 @@ nickserv
|
||||
*
|
||||
* Additionally, you may provide a permission name that must be in the opertype of users executing the command.
|
||||
*
|
||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behaviour.
|
||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||
*/
|
||||
|
||||
/* Give it a help command */
|
||||
/* Command group configuration for NickServ.
|
||||
*
|
||||
* Commands may optionally be placed into groups to make NickServ's HELP output easier to understand.
|
||||
* Remove the following groups to use the old behavior of simply listing all NickServ commands from HELP.
|
||||
*/
|
||||
command_group
|
||||
{
|
||||
name = "nickserv/admin"
|
||||
description = "Services Operator commands"
|
||||
}
|
||||
|
||||
/* Give it a help command. */
|
||||
command { service = "NickServ"; name = "HELP"; command = "generic/help"; }
|
||||
|
||||
/*
|
||||
@@ -330,7 +378,7 @@ command { service = "NickServ"; name = "DROP"; command = "nickserv/drop"; }
|
||||
* Used for getting registered accounts by searching for emails.
|
||||
*/
|
||||
module { name = "ns_getemail" }
|
||||
command { service = "NickServ"; name = "GETEMAIL"; command = "nickserv/getemail"; permission = "nickserv/getemail"; }
|
||||
command { service = "NickServ"; name = "GETEMAIL"; command = "nickserv/getemail"; permission = "nickserv/getemail"; group = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_getpass
|
||||
@@ -344,16 +392,6 @@ command { service = "NickServ"; name = "GETEMAIL"; command = "nickserv/getemail"
|
||||
#module { name = "ns_getpass" }
|
||||
#command { service = "NickServ"; name = "GETPASS"; command = "nickserv/getpass"; permission = "nickserv/getpass"; }
|
||||
|
||||
/*
|
||||
* ns_ghost
|
||||
*
|
||||
* Provides the command nickserv/ghost.
|
||||
*
|
||||
* Used for disconnecting "ghost" sessions.
|
||||
*/
|
||||
module { name = "ns_ghost" }
|
||||
command { service = "NickServ"; name = "GHOST"; command = "nickserv/ghost"; }
|
||||
|
||||
/*
|
||||
* ns_group
|
||||
*
|
||||
@@ -374,7 +412,7 @@ command { service = "NickServ"; name = "UNGROUP"; command = "nickserv/ungroup";
|
||||
* Used for identifying to accounts.
|
||||
*/
|
||||
module { name = "ns_identify" }
|
||||
command { service = "NickServ"; name = "ID"; command = "nickserv/identify"; }
|
||||
command { service = "NickServ"; name = "ID"; command = "nickserv/identify"; hide = true; }
|
||||
command { service = "NickServ"; name = "IDENTIFY"; command = "nickserv/identify"; }
|
||||
|
||||
/*
|
||||
@@ -395,7 +433,7 @@ command { service = "NickServ"; name = "INFO"; command = "nickserv/info"; }
|
||||
* Used for retrieving and searching the registered account list.
|
||||
*/
|
||||
module { name = "ns_list" }
|
||||
command { service = "NickServ"; name = "LIST"; command = "nickserv/list"; }
|
||||
command { service = "NickServ"; name = "LIST"; command = "nickserv/list"; command = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_logout
|
||||
@@ -412,10 +450,13 @@ command { service = "NickServ"; name = "LOGOUT"; command = "nickserv/logout"; }
|
||||
*
|
||||
* Provides the command nickserv/recover.
|
||||
*
|
||||
* Used for forcing someone on your nick to a guest nick.
|
||||
* Used for recovering your nick from services or another user.
|
||||
*/
|
||||
module { name = "ns_recover" }
|
||||
command { service = "NickServ"; name = "RECOVER"; command = "nickserv/recover"; }
|
||||
# Uncomment below to emulate 1.8's behavior of ghost, recover, and release.
|
||||
#command { service = "NickServ"; name = "GHOST"; command = "nickserv/recover"; }
|
||||
#command { service = "NickServ"; name = "RELEASE"; command = "nickserv/recover"; }
|
||||
|
||||
/*
|
||||
* ns_register
|
||||
@@ -429,16 +470,6 @@ command { service = "NickServ"; name = "CONFIRM"; command = "nickserv/confirm";
|
||||
command { service = "NickServ"; name = "REGISTER"; command = "nickserv/register"; }
|
||||
command { service = "NickServ"; name = "RESEND"; command = "nickserv/resend"; }
|
||||
|
||||
/*
|
||||
* ns_release
|
||||
*
|
||||
* Provides the command nickserv/release.
|
||||
*
|
||||
* Used for releasing names held by nickserv/recover.
|
||||
*/
|
||||
module { name = "ns_release" }
|
||||
command { service = "NickServ"; name = "RELEASE"; command = "nickserv/release"; }
|
||||
|
||||
/*
|
||||
* ns_resetpass
|
||||
*
|
||||
@@ -449,159 +480,65 @@ command { service = "NickServ"; name = "RELEASE"; command = "nickserv/release";
|
||||
module { name = "ns_resetpass" }
|
||||
command { service = "NickServ"; name = "RESETPASS"; command = "nickserv/resetpass"; }
|
||||
|
||||
/*
|
||||
* ns_saset
|
||||
*
|
||||
* Provides commands nickserv/saset, nickserv/saset/password.
|
||||
*
|
||||
* Used as a help wrapper for SASET commands, and used to force change users password.
|
||||
*/
|
||||
module { name = "ns_saset" }
|
||||
command { service = "NickServ"; name = "SASET"; command = "nickserv/saset"; }
|
||||
command { service = "NickServ"; name = "SASET PASSWORD"; command = "nickserv/saset/password"; }
|
||||
|
||||
/*
|
||||
* ns_saset_noexpire
|
||||
*
|
||||
* Provides the command nickserv/saset/noexpire.
|
||||
*
|
||||
* Used for configuring noexpire, which prevents nicks from expiring.
|
||||
*/
|
||||
module { name = "ns_saset_noexpire" }
|
||||
command { service = "NickServ"; name = "SASET NOEXPIRE"; command = "nickserv/saset/noexpire"; permission = "nickserv/saset/noexpire" }
|
||||
|
||||
/*
|
||||
* ns_set
|
||||
*
|
||||
* Provides the commands nickserv/set, nickserv/set/password.
|
||||
* Provides the commands:
|
||||
* nickserv/set, nickserv/saset - Dummy help wrappers for the SET and SASET commands.
|
||||
* nickserv/set/autoop, nickserv/saset/autoop - Determines whether or not modes are automatically set users when joining a channel.
|
||||
* nickserv/set/display, nickserv/saset/display - Used for setting a users display name.
|
||||
* nickserv/set/email, nickserv/saset/email - Used for setting a users email address.
|
||||
* nickserv/set/greet, nickserv/saset/greet - Used for changing a users greet message, which is displayed when they enter channels.
|
||||
* nicksrev/set/hide, nickserv/saset/hide - Used for configuring which options are publically shown in nickserv/info for users account.
|
||||
* nickserv/set/kill, nickserv/saset/kill - Used for configuring nickname protection.
|
||||
* nickserv/set/language, nickserv/saset/language - Used for configuring what language services use.
|
||||
* nickserv/set/message, nickserv/saset/message - Used to configure how services send messages to you.
|
||||
* nickserv/set/password, nickserv/saset/password - Used for changing a users greet password.
|
||||
* nickserv/set/private, nickserv/saset/private - Used for configuring whether or a users account shows up in nickserv/list.
|
||||
* nickserv/set/secure, nickserv/saset/secure - Used for configuring whether a user can identify by simply being recognized by nickserv/access.
|
||||
* nickserv/saset/noexpire - Used for configuring noexpire, which prevents nicks from expiring.
|
||||
*
|
||||
* Used as a help wrapper for SET commands, and used for users to change their password.
|
||||
* This is a dummy command to provide a help wrapper for the various SET and SASET commands.
|
||||
*/
|
||||
module { name = "ns_set" }
|
||||
|
||||
command { service = "NickServ"; name = "SET"; command = "nickserv/set"; }
|
||||
command { service = "NickServ"; name = "SET PASSWORD"; command = "nickserv/set/password"; }
|
||||
command { service = "NickServ"; name = "SASET"; command = "nickserv/saset"; permission = "nickserv/saset/"; group = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_set_autoop
|
||||
*
|
||||
* Provides the commands nickserv/set/autoop and nickserv/saset/autoop.
|
||||
*
|
||||
* Used for setting autoop, which determines whether or not modes are automatically set on you when joining a channel.
|
||||
*/
|
||||
module { name = "ns_set_autoop" }
|
||||
command { service = "NickServ"; name = "SET AUTOOP"; command = "nickserv/set/autoop"; }
|
||||
command { service = "NickServ"; name = "SASET AUTOOP"; command = "nickserv/saset/autoop"; permission = "nickserv/saset/autoop"; }
|
||||
command { service = "NickServ"; name = "SASET AUTOOP"; command = "nickserv/saset/autoop"; permission = "nickserv/saset/autoop"; group = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_set_display
|
||||
*
|
||||
* Provides the commands nickserv/set/display and nickserv/saset/display.
|
||||
*
|
||||
* Used for setting users display names.
|
||||
*/
|
||||
module { name = "ns_set_display" }
|
||||
command { service = "NickServ"; name = "SET DISPLAY"; command = "nickserv/set/display"; }
|
||||
command { service = "NickServ"; name = "SASET DISPLAY"; command = "nickserv/saset/display"; permission = "nickserv/saset/display"; }
|
||||
command { service = "NickServ"; name = "SASET DISPLAY"; command = "nickserv/saset/display"; permission = "nickserv/saset/display"; group = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_set_email
|
||||
*
|
||||
* Provides the commands nickserv/set/email and nickserv/saset/email.
|
||||
*
|
||||
* Used for setting users email addresses.
|
||||
*/
|
||||
module { name = "ns_set_email" }
|
||||
command { service = "NickServ"; name = "SET EMAIL"; command = "nickserv/set/email"; }
|
||||
command { service = "NickServ"; name = "SASET EMAIL"; command = "nickserv/saset/email"; permission = "nickserv/saset/email"; }
|
||||
command { service = "NickServ"; name = "SASET EMAIL"; command = "nickserv/saset/email"; permission = "nickserv/saset/email"; group = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_set_greet
|
||||
*
|
||||
* Provides the commands nickserv/set/greet and nickserv/saset/greet.
|
||||
*
|
||||
* Used for changing users greet message, which is displayed when they enter channels.
|
||||
*/
|
||||
module { name = "ns_set_greet" }
|
||||
command { service = "NickServ"; name = "SET GREET"; command = "nickserv/set/greet"; }
|
||||
command { service = "NickServ"; name = "SASET GREET"; command = "nickserv/saset/greet"; permission = "nickserv/saset/greet"; }
|
||||
command { service = "NickServ"; name = "SASET GREET"; command = "nickserv/saset/greet"; permission = "nickserv/saset/greet"; group = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_set_hide
|
||||
*
|
||||
* Provides the commands nickserv/set/hide and nickserv/saset/hide.
|
||||
*
|
||||
* Used for configuring which options are publically shown in nickserv/info for your account.
|
||||
*/
|
||||
module { name = "ns_set_hide" }
|
||||
command { service = "NickServ"; name = "SET HIDE"; command = "nickserv/set/hide"; }
|
||||
command { service = "NickServ"; name = "SASET HIDE"; command = "nickserv/saset/hide"; permission = "nickserv/saset/hide"; }
|
||||
command { service = "NickServ"; name = "SASET HIDE"; command = "nickserv/saset/hide"; permission = "nickserv/saset/hide"; group = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_set_kill
|
||||
*
|
||||
* Provides the commands nickserv/set/kill and nickserv/saset/kill.
|
||||
*
|
||||
* Used for configuring if and for how long other users are allowed to use your nick.
|
||||
*/
|
||||
module { name = "ns_set_kill" }
|
||||
command { service = "NickServ"; name = "SET KILL"; command = "nickserv/set/kill"; }
|
||||
command { service = "NickServ"; name = "SASET KILL"; command = "nickserv/saset/kill"; permission = "nickserv/saset/kill"; }
|
||||
command { service = "NickServ"; name = "SASET KILL"; command = "nickserv/saset/kill"; permission = "nickserv/saset/kill"; group = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_set_language
|
||||
*
|
||||
* Provides the commands nickserv/set/language and nickserv/saset/language.
|
||||
*
|
||||
* Used for configuring what language services use when messaging you.
|
||||
*/
|
||||
module { name = "ns_set_language" }
|
||||
command { service = "NickServ"; name = "SET LANGUAGE"; command = "nickserv/set/language"; }
|
||||
command { service = "NickServ"; name = "SASET LANGUAGE"; command = "nickserv/saset/language"; permission = "nickserv/saset/language"; }
|
||||
command { service = "NickServ"; name = "SASET LANGUAGE"; command = "nickserv/saset/language"; permission = "nickserv/saset/language"; group = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_set_message
|
||||
*
|
||||
* Provides the commands nickserv/set/message and nickserv/saset/message.
|
||||
*
|
||||
* Used to configure how services send messages to you.
|
||||
*/
|
||||
module { name = "ns_set_message" }
|
||||
command { service = "NickServ"; name = "SET MESSAGE"; command = "nickserv/set/message"; }
|
||||
command { service = "NickServ"; name = "SASET MESSAGE"; command = "nickserv/saset/message"; permission = "nickserv/saset/message"; }
|
||||
command { service = "NickServ"; name = "SASET MESSAGE"; command = "nickserv/saset/message"; permission = "nickserv/saset/message"; group = "nickserv/admin"; }
|
||||
|
||||
command { service = "NickServ"; name = "SET PASSWORD"; command = "nickserv/set/password"; }
|
||||
command { service = "NickServ"; name = "SASET PASSWORD"; command = "nickserv/saset/password"; permission = "nickserv/saset/password"; group = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_set_private
|
||||
*
|
||||
* Provides the commands nickserv/set/private and nickserv/saset/private.
|
||||
*
|
||||
* Used for configuring whether or not your account shows up in nickserv/list.
|
||||
*/
|
||||
module { name = "ns_set_private" }
|
||||
command { service = "NickServ"; name = "SET PRIVATE"; command = "nickserv/set/private"; }
|
||||
command { service = "NickServ"; name = "SASET PRIVATE"; command = "nickserv/saset/private"; permission = "nickserv/saset/private"; }
|
||||
command { service = "NickServ"; name = "SASET PRIVATE"; command = "nickserv/saset/private"; permission = "nickserv/saset/private"; group = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_set_secure
|
||||
*
|
||||
* Provides the commands nickserv/set/secure and nickserv/saset/secure.
|
||||
*
|
||||
* Used for configuring whether you can gain access to your nick by simply being recognized by nickserv/access.
|
||||
*/
|
||||
module { name = "ns_set_secure" }
|
||||
command { service = "NickServ"; name = "SET SECURE"; command = "nickserv/set/secure"; }
|
||||
command { service = "NickServ"; name = "SASET SECURE"; command = "nickserv/saset/secure"; permission = "nickserv/saset/secure"; }
|
||||
command { service = "NickServ"; name = "SASET SECURE"; command = "nickserv/saset/secure"; permission = "nickserv/saset/secure"; group = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_sendpass
|
||||
*
|
||||
* Provides the command nickserv/sendpass.
|
||||
*
|
||||
* Used to send users their password via email.
|
||||
*
|
||||
* Requires that no encryption is being used.
|
||||
*/
|
||||
module { name = "ns_sendpass" }
|
||||
command { service = "NickServ"; name = "SENDPASS"; command = "nickserv/sendpass"; permission = "nickserv/sendpass"; }
|
||||
command { service = "NickServ"; name = "SASET NOEXPIRE"; command = "nickserv/saset/noexpire"; permission = "nickserv/saset/noexpire"; group = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_set_misc
|
||||
@@ -609,10 +546,17 @@ command { service = "NickServ"; name = "SENDPASS"; command = "nickserv/sendpass"
|
||||
* Provides the command nickserv/set/misc.
|
||||
*
|
||||
* Allows you to create arbitrary commands to set data, and have that data show up in nickserv/info.
|
||||
* A field named misc_description may be given for use with help output.
|
||||
*/
|
||||
module { name = "ns_set_misc" }
|
||||
command { service = "NickServ"; name = "SET URL"; command = "nickserv/set/misc"; }
|
||||
command { service = "NickServ"; name = "SET ICQ"; command = "nickserv/set/misc"; }
|
||||
command { service = "NickServ"; name = "SET URL"; command = "nickserv/set/misc"; misc_description = _("Associate a URL with your account"); }
|
||||
command { service = "NickServ"; name = "SASET URL"; command = "nickserv/saset/misc"; misc_description = _("Associate a URL with this account"); permission = "nickserv/saset/url"; group = "nickserv/admin"; }
|
||||
#command { service = "NickServ"; name = "SET ICQ"; command = "nickserv/set/misc"; misc_description = _("Associate an ICQ account with your account"); }
|
||||
#command { service = "NickServ"; name = "SASET ICQ"; command = "nickserv/saset/misc"; misc_description = _("Associate an ICQ account with this account"); permission = "nickserv/saset/icq"; group = "nickserv/admin"; }
|
||||
#command { service = "NickServ"; name = "SET TWITTER"; command = "nickserv/set/misc"; misc_description = _("Associate a Twitter account with your account"); }
|
||||
#command { service = "NickServ"; name = "SASET TWITTER"; command = "nickserv/saset/misc"; misc_description = _("Associate a Twitter account with this account"); permission = "nickserv/saset/twitter"; group = "nickserv/admin"; }
|
||||
#command { service = "NickServ"; name = "SET FACEBOOK"; command = "nickserv/set/misc"; misc_description = _("Associate a Facebook URL with your account"); }
|
||||
#command { service = "NickServ"; name = "SASET FACEBOOK"; command = "nickserv/saset/misc"; misc_description = _("Associate a Facebook URL with this account"); permission = "nickserv/saset/facebook"; group = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_status
|
||||
@@ -629,11 +573,11 @@ command { service = "NickServ"; name = "STATUS"; command = "nickserv/status"; }
|
||||
*
|
||||
* Provides the commands nickserv/suspend and nickserv/unsuspend.
|
||||
*
|
||||
* Used to suspend and unsuspend nicknames. Suspended nicknames can not be used but their settings are stored.
|
||||
* Used to suspend and unsuspend nicknames. Suspended nicknames can not be used but their settings are preserved.
|
||||
*/
|
||||
module { name = "ns_suspend" }
|
||||
command { service = "NickServ"; name = "SUSPEND"; command = "nickserv/suspend"; permission = "nickserv/suspend"; }
|
||||
command { service = "NickServ"; name = "UNSUSPEND"; command = "nickserv/unsuspend"; permission = "nickserv/suspend"; }
|
||||
command { service = "NickServ"; name = "SUSPEND"; command = "nickserv/suspend"; permission = "nickserv/suspend"; group = "nickserv/admin"; }
|
||||
command { service = "NickServ"; name = "UNSUSPEND"; command = "nickserv/unsuspend"; permission = "nickserv/suspend"; group = "nickserv/admin"; }
|
||||
|
||||
/*
|
||||
* ns_update
|
||||
@@ -645,3 +589,24 @@ command { service = "NickServ"; name = "UNSUSPEND"; command = "nickserv/unsuspen
|
||||
module { name = "ns_update" }
|
||||
command { service = "NickServ"; name = "UPDATE"; command = "nickserv/update"; }
|
||||
|
||||
|
||||
/*
|
||||
* Extra NickServ related modules.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ns_maxemail
|
||||
*
|
||||
* Limits how many times the same email address may be used in Anope
|
||||
* to register accounts.
|
||||
*/
|
||||
module { name = "ns_maxemail" }
|
||||
ns_maxemail
|
||||
{
|
||||
/*
|
||||
* The limit to how many registered nicks can use the same e-mail address. If set to 0 or left
|
||||
* commented, there will be no limit enforced when registering new accounts or using
|
||||
* /msg NickServ SET EMAIL.
|
||||
*/
|
||||
#maxemails = 1
|
||||
}
|
||||
|
||||
+112
-28
@@ -9,7 +9,7 @@
|
||||
service
|
||||
{
|
||||
/*
|
||||
* The name of the OperServ client
|
||||
* The name of the OperServ client.
|
||||
*/
|
||||
nick = "OperServ"
|
||||
|
||||
@@ -35,8 +35,8 @@ service
|
||||
* These modes are very IRCd specific. If left commented, sane defaults
|
||||
* are used based on what protocol module you have loaded.
|
||||
*
|
||||
* Note that setting this option incorrectly could potentially BREAK some if
|
||||
* not all usefulness of the client. We will not support you if this client is
|
||||
* Note that setting this option incorrectly could potentially BREAK some, if
|
||||
* not all, usefulness of the client. We will not support you if this client is
|
||||
* unable to do certain things if this option is enabled.
|
||||
*/
|
||||
#modes = "+o"
|
||||
@@ -46,7 +46,7 @@ service
|
||||
* of log channels this is not very useful, as the service will just idle in the
|
||||
* specified channels, and will not accept any types of commands.
|
||||
*
|
||||
* Prefixes may be given to the channels in the form of mode character or prefix symbol.
|
||||
* Prefixes may be given to the channels in the form of mode characters or prefix symbols.
|
||||
*/
|
||||
#channels = "@#services,#mychan"
|
||||
}
|
||||
@@ -84,7 +84,6 @@ operserv
|
||||
chankillexpiry = 30d
|
||||
snlineexpiry = 30d
|
||||
sqlineexpiry = 30d
|
||||
szlineexpiry = 30d
|
||||
|
||||
/*
|
||||
* If set, this option will make Services send an AKILL command immediately after it has been
|
||||
@@ -155,7 +154,7 @@ operserv
|
||||
*
|
||||
* This directive is optional, if not set, nothing will be sent.
|
||||
*/
|
||||
sessionlimitexceeded = "The session limit for your host %s has been exceeded."
|
||||
sessionlimitexceeded = "The session limit for your IP %s has been exceeded."
|
||||
|
||||
/*
|
||||
* Same as above, but should be used to provide a website address where users can find out more
|
||||
@@ -184,6 +183,13 @@ operserv
|
||||
*/
|
||||
sessionautokillexpiry = 30m
|
||||
|
||||
/*
|
||||
* Sets the CIDR value used to determine which IP addresses represent the same person.
|
||||
* By default this would limit 3 connections per IPv4 IP and 3 connections per IPv6 IP.
|
||||
*/
|
||||
session_ipv4_cidr = 32
|
||||
session_ipv6_cidr = 128
|
||||
|
||||
/*
|
||||
* Adds the nickname of the IRC Operator issuing an AKILL to the kill reason.
|
||||
*
|
||||
@@ -217,7 +223,7 @@ operserv
|
||||
* Sane defaults are provided below that do not need to be edited unless you wish to change the default behavior.
|
||||
*/
|
||||
|
||||
/* Give it a help command */
|
||||
/* Give it a help command. */
|
||||
command { service = "OperServ"; name = "HELP"; command = "generic/help"; }
|
||||
|
||||
/*
|
||||
@@ -298,7 +304,7 @@ defcon
|
||||
* the mode setting selected, Services will set the reverse on all channels, e.g. if this setting
|
||||
* is +RN when DefCon is used, all channels will be set to +RN, when DefCon is removed, all
|
||||
* channels will be set to -RN. You don't want to set this to +k for example, because when DefCon
|
||||
* is removed all channels with -k.
|
||||
* is removed, all channels are set -k, removing the key from previously keyed channels.
|
||||
*
|
||||
* Note 2: MLOCKed modes will not be lost.
|
||||
*/
|
||||
@@ -344,19 +350,68 @@ defcon
|
||||
* Defines the reason to use when clients are KILLed or AKILLed from the network while the proper
|
||||
* DefCon operation is in effect.
|
||||
*/
|
||||
#akillreason = "This network is currently not accepting connections, please try again later"
|
||||
#akillreason = "This network is currently not accepting connections, please try again later."
|
||||
}
|
||||
|
||||
/*
|
||||
* os_list
|
||||
* os_dns
|
||||
*
|
||||
* Provides the commands operserv/chanlist and operserv/userlist.
|
||||
* Provides the command operserv/dns.
|
||||
*
|
||||
* Used to list and search the channels and users currently on the network.
|
||||
* This module requires that m_dns is loaded.
|
||||
*
|
||||
* This module allows controlling a DNS zone. This is useful for
|
||||
* controlling what servers users are placed on for load balancing,
|
||||
* and to automatically remove split servers.
|
||||
*
|
||||
* To use this module you must set a nameserver record for services
|
||||
* so that DNS queries go to services.
|
||||
*
|
||||
* Alternatively, you may use a slave DNS server to hide service's IP,
|
||||
* provide query caching, and provide better fault tolerance.
|
||||
*
|
||||
* To do this using BIND, configure similar to:
|
||||
*
|
||||
* options { max-refresh-time 60; };
|
||||
* zone "irc.example.com" IN {
|
||||
* type slave;
|
||||
* masters { 127.0.0.1 port 5353; };
|
||||
* };
|
||||
*
|
||||
* Where 127.0.0.1:5353 is the IP and port services are listening on.
|
||||
* We recommend you externally firewall both UDP and TCP to the port
|
||||
* Anope is listening on.
|
||||
*
|
||||
* Finally set a NS record for irc.example.com. to BIND or services.
|
||||
*/
|
||||
module { name = "os_list" }
|
||||
command { service = "OperServ"; name = "CHANLIST"; command = "operserv/chanlist"; }
|
||||
command { service = "OperServ"; name = "USERLIST"; command = "operserv/userlist"; }
|
||||
#module { name = "os_dns" }
|
||||
#command { service = "OperServ"; name = "DNS"; command = "operserv/dns"; permission = "operserv/dns"; }
|
||||
os_dns
|
||||
{
|
||||
/* TTL for records. This should be very low if your records change often. */
|
||||
ttl = 1m
|
||||
|
||||
/* If a server drops this many users the server is automatically removed from the DNS zone.
|
||||
* This directive is optional.
|
||||
*/
|
||||
user_drop_mark = 50
|
||||
|
||||
/* The time used for user_drop_mark. */
|
||||
user_drop_time = 1m
|
||||
|
||||
/* When a server is removed from the zone for dropping users, it is readded after this time.
|
||||
* This directive is optional.
|
||||
*/
|
||||
user_drop_readd_time = 5m
|
||||
|
||||
/* If set, when a server splits, it is automatically removed from the zone. */
|
||||
remove_split_servers = yes
|
||||
|
||||
/* If set, when a server connects to the network, it will be automatically added to
|
||||
* the zone if it is a known server.
|
||||
*/
|
||||
readd_connected_servers = no
|
||||
}
|
||||
|
||||
/*
|
||||
* os_config
|
||||
@@ -418,6 +473,17 @@ command { service = "OperServ"; name = "KICK"; command = "operserv/kick"; permis
|
||||
module { name = "os_kill" }
|
||||
command { service = "OperServ"; name = "KILL"; command = "operserv/kill"; permission = "operserv/kill"; }
|
||||
|
||||
/*
|
||||
* os_list
|
||||
*
|
||||
* Provides the commands operserv/chanlist and operserv/userlist.
|
||||
*
|
||||
* Used to list and search the channels and users currently on the network.
|
||||
*/
|
||||
module { name = "os_list" }
|
||||
command { service = "OperServ"; name = "CHANLIST"; command = "operserv/chanlist"; permission = "operserv/chanlist"; }
|
||||
command { service = "OperServ"; name = "USERLIST"; command = "operserv/userlist"; permission = "operserv/userlist"; }
|
||||
|
||||
/*
|
||||
* os_login
|
||||
*
|
||||
@@ -429,6 +495,23 @@ module { name = "os_login" }
|
||||
command { service = "OperServ"; name = "LOGIN"; command = "operserv/login"; }
|
||||
command { service = "OperServ"; name = "LOGOUT"; command = "operserv/logout"; }
|
||||
|
||||
/*
|
||||
* os_logsearch
|
||||
*
|
||||
* Provides the command operserv/logsearch.
|
||||
*
|
||||
* Used to search services log files.
|
||||
*/
|
||||
module { name = "os_logsearch" }
|
||||
command { service = "OperServ"; name = "LOGSEARCH"; command = "operserv/logsearch"; permission = "operserv/logsearch"; }
|
||||
logsearch
|
||||
{
|
||||
/* The log file name to search. There should be a log{} block configured to log
|
||||
* to a file of this name.
|
||||
*/
|
||||
name = "services.log"
|
||||
}
|
||||
|
||||
/*
|
||||
* os_mode
|
||||
*
|
||||
@@ -437,8 +520,8 @@ command { service = "OperServ"; name = "LOGOUT"; command = "operserv/logout"; }
|
||||
* Used to change user and channel modes.
|
||||
*/
|
||||
module { name = "os_mode" }
|
||||
command { service = "OperServ"; name = "MODE"; command = "operserv/mode"; permission = "operserv/mode"; }
|
||||
command { service = "OperServ"; name = "UMODE"; command = "operserv/umode"; permission = "operserv/umode"; }
|
||||
command { service = "OperServ"; name = "MODE"; command = "operserv/mode"; permission = "operserv/mode"; }
|
||||
|
||||
/*
|
||||
* os_modinfo
|
||||
@@ -448,8 +531,8 @@ command { service = "OperServ"; name = "UMODE"; command = "operserv/umode"; perm
|
||||
* Used to show information about loaded modules.
|
||||
*/
|
||||
module { name = "os_modinfo" }
|
||||
command { service = "OperServ"; name = "MODINFO"; command = "operserv/modinfo"; }
|
||||
command { service = "OperServ"; name = "MODLIST"; command = "operserv/modlist"; permission = "operserv/modlist"; }
|
||||
command { service = "OperServ"; name = "MODINFO"; command = "operserv/modinfo"; permission = "operserv/modinfo"; }
|
||||
command { service = "OperServ"; name = "MODLIST"; command = "operserv/modlist"; permission = "operserv/modinfo"; }
|
||||
|
||||
/*
|
||||
* os_module
|
||||
@@ -498,7 +581,7 @@ command { service = "OperServ"; name = "OLINE"; command = "operserv/oline"; perm
|
||||
|
||||
/*
|
||||
* os_oper
|
||||
*
|
||||
*
|
||||
* Provides the command operserv/oper.
|
||||
*
|
||||
* Used to configure opers and show information about opertypes.
|
||||
@@ -509,7 +592,7 @@ command { service = "OperServ"; name = "OPER"; command = "operserv/oper"; permis
|
||||
/*
|
||||
* os_reload
|
||||
*
|
||||
* Provides the command operserv/relad.
|
||||
* Provides the command operserv/reload.
|
||||
*
|
||||
* Used to reload the services.conf configuration file.
|
||||
*/
|
||||
@@ -560,14 +643,16 @@ module { name = "os_stats" }
|
||||
command { service = "OperServ"; name = "STATS"; command = "operserv/stats"; permission = "operserv/stats"; }
|
||||
|
||||
/*
|
||||
* os_svsnick
|
||||
*
|
||||
* Provides the operserv/svsnick command.
|
||||
* os_svs
|
||||
*
|
||||
* Used to force change user's nicks.
|
||||
* Provides the commands operserv/svsnick, operserv/svsjoin, and operserv/svspart.
|
||||
*
|
||||
* Used to force users to change nicks, join and part channels.
|
||||
*/
|
||||
module { name = "os_svsnick" }
|
||||
command { service = "OperServ"; name = "SVSNICK"; command = "operserv/svsnick"; permission = "operserv/svsnick"; }
|
||||
module { name = "os_svs" }
|
||||
command { service = "OperServ"; name = "SVSNICK"; command = "operserv/svsnick"; permission = "operserv/svs"; }
|
||||
command { service = "OperServ"; name = "SVSJOIN"; command = "operserv/svsjoin"; permission = "operserv/svs"; }
|
||||
command { service = "OperServ"; name = "SVSPART"; command = "operserv/svspart"; permission = "operserv/svs"; }
|
||||
|
||||
/*
|
||||
* os_sxline
|
||||
@@ -583,10 +668,9 @@ command { service = "OperServ"; name = "SQLINE"; command = "operserv/sqline"; pe
|
||||
/*
|
||||
* os_update
|
||||
*
|
||||
* Provides the opersev/update command.
|
||||
* Provides the operserv/update command.
|
||||
*
|
||||
* Use to immediately update the databases.
|
||||
*/
|
||||
module { name = "os_update" }
|
||||
command { service = "OperServ"; name = "UPDATE"; command = "operserv/update"; permission = "operserv/update"; }
|
||||
|
||||
|
||||
+260
-252
@@ -1,339 +1,347 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
675 Mass Ave, Cambridge, MA 02139, USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
|
||||
Preamble
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the entire
|
||||
whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
b) Accompany it with a written offer, valid for at least three years,
|
||||
to give any third party, for a charge no more than your cost of
|
||||
physically performing source distribution, a complete machine-readable
|
||||
copy of the corresponding source code, to be distributed under the terms
|
||||
of Sections 1 and 2 above on a medium customarily used for software
|
||||
interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is allowed
|
||||
only for noncommercial distribution and only if you received the program
|
||||
in object code or executable form with such an offer, in accord with
|
||||
Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent license
|
||||
would not permit royalty-free redistribution of the Program by all those
|
||||
who receive copies directly or indirectly through you, then the only way
|
||||
you could satisfy both it and this License would be to refrain entirely
|
||||
from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is implemented
|
||||
by public license practices. Many people have made generous contributions
|
||||
to the wide range of software distributed through that system in reliance
|
||||
on consistent application of that system; it is up to the author/donor to
|
||||
decide if he or she is willing to distribute software through any other
|
||||
system and a licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
This section is intended to make thoroughly clear what is believed to be
|
||||
a consequence of the rest of this License.
|
||||
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Appendix: How to Apply These Terms to Your New Programs
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make
|
||||
it free software which everyone can redistribute and change under
|
||||
these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
<one line to give the program's name and an idea of what it does.>
|
||||
Copyright (C) yyyy name of author
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
|
||||
type `show w'. This is free software, and you are welcome
|
||||
to redistribute it under certain conditions; type `show c'
|
||||
for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
Anope Version 1.9.8
|
||||
--------------------
|
||||
A Ability to configure fantasy commands in the config
|
||||
A Add SVSJOIN and SVSPART commands
|
||||
F Fix "leave" channel log level from not logging
|
||||
F Fix users able to "resend" their registration mail with registration set to admin only
|
||||
F Fix build on OpenBSD
|
||||
F Fix not logging debug logs to the logfile when debug mode is enabled
|
||||
F Fix defcon timeout timer
|
||||
F Fix crash in os_forbid with expiring entries
|
||||
F Fix several issues with db_sql_live
|
||||
|
||||
Anope Version 1.9.7
|
||||
--------------------
|
||||
A Added ability for using regex as patterns for various commands
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
Anope Version 1.9.8
|
||||
-------------------
|
||||
networkinfo:chanlen added
|
||||
options:user and options:group added
|
||||
nickserv:modesonid added to set modes on everyone who identifies
|
||||
nickserv:kill and nickserv:killquick added to configure NickServ's kill timeout
|
||||
nickserv:restoreonrecover added to try to restore a user's session after a ghost
|
||||
command:group added
|
||||
fantasy block added
|
||||
dns block has been moved to modules.conf as a part of m_dns
|
||||
|
||||
Anope Version 1.9.7
|
||||
-------------------
|
||||
operserv:notifications removed in favor of log{} blocks
|
||||
|
||||
+2
-2
@@ -35,12 +35,12 @@ Anope Mutli Language Support
|
||||
want translated (messages to the user, etc).
|
||||
|
||||
If you want to translate a module someone has made, first generate a .pot file if there isn't one already using
|
||||
`xgettext -s -d modulename -o modulename.pot --from-code=utf-8 modulename.cpp`.
|
||||
`xgettext -s -d modulename -o modulename.pot --from-code=utf-8 --keyword --keyword=_ modulename.cpp`.
|
||||
The .pot file is a template of all of the language strings extracted from the source file.
|
||||
|
||||
Next, run msginit on the .pot file with
|
||||
`msginit -l language -o modulename.language.po -i modulename.pot`.
|
||||
Translate the new .po file and rerun ./Config; make && make install.
|
||||
|
||||
All .po and .pot files should be placed in modules/language/third. Additionally an update script is provided there
|
||||
All .po and .pot files should be placed in modules/third/language. Additionally an update script is provided there
|
||||
that will create .pot files and merge any changes to it with existing .po files.
|
||||
|
||||
+10
-2
@@ -1,7 +1,7 @@
|
||||
Anope -- a set of IRC services for IRC networks
|
||||
-----------------------------------------------
|
||||
|
||||
Anope is 2003-2012 Anope Team <team@anope.org>.
|
||||
Anope is 2003-2013 Anope Team <team@anope.org>.
|
||||
Based on Epona 2000-2002 PegSoft <epona@pegsoft.net>.
|
||||
Based on Services 1996-1999 Andrew Church <achurch@achurch.org>.
|
||||
|
||||
@@ -116,6 +116,12 @@ Table of Contents
|
||||
* Christopher N. <saka@epiknet.org> (fr.l)
|
||||
* Yusuf Kurekci <ysfm.20@gmail.com> (tr.l)
|
||||
|
||||
Anope Web panel:
|
||||
|
||||
* Thomas Edwards <thomas.edwards@ilkotech.co.uk>
|
||||
* Luke Thompson <luke.thompson@ilkotech.co.uk>
|
||||
* Matthew M. <mcm@they-got.us>
|
||||
|
||||
2) Presentation
|
||||
|
||||
Anope is a set of Services for IRC networks that allows users to manage
|
||||
@@ -165,10 +171,12 @@ Table of Contents
|
||||
Anope currently works with:
|
||||
|
||||
* Bahamut 1.4.27 or later (including 1.8)
|
||||
* Hybrid 8.0 or later
|
||||
* InspIRCd 1.1, 1.2, or 2.0
|
||||
* ngIRCd 19.2 or later
|
||||
* Plexus 3 or later
|
||||
* Ratbox 2.0.6 or later
|
||||
* UnrealIRCd 3.2 or later
|
||||
* Plexus 3 or later
|
||||
|
||||
Anope could also work with some of the daemons derived by the ones listed
|
||||
above, but there's no support for them if they work or don't work.
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
Legend:
|
||||
x = done
|
||||
? = unsure
|
||||
+ = in progress
|
||||
|
||||
Future
|
||||
------
|
||||
[ ] NS IDENTIFY changes
|
||||
[?] Last failed identify? Maybe more useful for sopers only, so users don't get unnecessarily worried
|
||||
[?] Last successful login time/ip? perhaps both of these should be a new nick setting
|
||||
[ ] NS SUSPEND: show suspender and reason, probably to sopers only (see CS SUSPEND)
|
||||
[ ] Allow channel founders to change the fantasy trigger for their channel.
|
||||
[+] CIDR Akills, session exceptions, etc
|
||||
[?] Language charset stuff, including collation (1.9.1? phoenix?)
|
||||
[?] a way for a module to queue itself (or even another module) for unloading
|
||||
[+] Useful/common "third party" modules to core distro
|
||||
[x] NS AJOIN
|
||||
[x] CS ENTRYMSG
|
||||
[?] Don't allow soper accounts to expire
|
||||
[?] Reason for CS SET RESTRICTED
|
||||
[ ] Unique IDs on each AKILL/blah so that networks may use them as ticket IDs
|
||||
[ ] HS ACTIVATE -ALL (rob sez this all needs reviewing)
|
||||
[ ] No nickname ownership?
|
||||
[ ] More commands need to be split up such as /bs bot, /ms set, /bs kick, /bs set, /os set? etc.
|
||||
[ ] Customize email messages
|
||||
+2
-3
@@ -16,9 +16,8 @@ Anope Bundled Tools
|
||||
sendmailpath = "/home/anope/services/bin/anopesmtp 127.0.0.1"
|
||||
|
||||
If the SMTP client doesn't send mail, or if there's an other problem with
|
||||
it, you can compile it in debug mode. To do this, open anopesmtp.cpp, and look
|
||||
for "smtp_debug" near the top. Change this from 0 to 1 and recompile
|
||||
the code. This should generate a log file of what happened when it tried
|
||||
it, you can enable debug mode by passing the --debug flag after the server
|
||||
address. This should generate a log file of what happened when it tried
|
||||
to connect to the SMTP server.
|
||||
|
||||
Credits:
|
||||
|
||||
+3
-4
@@ -25,12 +25,11 @@ Anope for Windows
|
||||
|
||||
(NOTE: When installing, tell CMake to add itself to the PATH.)
|
||||
|
||||
If you have Visual C++ 10 (2010) skip ahead to step 2, else you
|
||||
need to download the following free component from Microsoft. Once
|
||||
downloaded, install these packages.
|
||||
If you have Visual C++ 10 or 11 (2010/2012) skip ahead to step 2, else you
|
||||
need to download and install the following free component from Microsoft.
|
||||
|
||||
* Microsoft Visual C++ 2010 Express Edition:
|
||||
http://www.microsoft.com/express/vc/
|
||||
http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express
|
||||
|
||||
2) Unpack the Anope tarball with your favorite uncompression program
|
||||
(WinZip or WinRAR, etc).
|
||||
|
||||
+10
-21
@@ -1,33 +1,18 @@
|
||||
<?php
|
||||
/* XMLRPC Functions
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
*/
|
||||
|
||||
class AnopeXMLRPC
|
||||
{
|
||||
private $Host, $Bind, $Port;
|
||||
private $Host;
|
||||
|
||||
private $Socket;
|
||||
|
||||
function __construct($Host, $Port, $Bind = NULL)
|
||||
function __construct($Host)
|
||||
{
|
||||
$this->Host = $Host;
|
||||
$this->Port = $Port;
|
||||
$this->Bind = $Bind;
|
||||
|
||||
$this->Socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
|
||||
if ($Bind && socket_bind($this->Socket, $this->Bind) == false)
|
||||
$his->Socket = false;
|
||||
if (socket_connect($this->Socket, $this->Host, $this->Port) == false)
|
||||
$this->Socket = false;
|
||||
}
|
||||
|
||||
function __destruct()
|
||||
{
|
||||
@socket_close($this->Socket);
|
||||
}
|
||||
|
||||
/** Run an XMLRPC command. Name should be a query name and params an array of parameters, eg:
|
||||
@@ -40,10 +25,12 @@ class AnopeXMLRPC
|
||||
function RunXMLRPC($name, $params)
|
||||
{
|
||||
$xmlquery = xmlrpc_encode_request($name, $params);
|
||||
socket_write($this->Socket, $xmlquery);
|
||||
$context = stream_context_create(array("http" => array(
|
||||
"method" => "POST",
|
||||
"header" => "Content-Type: text/xml",
|
||||
"content" => $xmlquery)));
|
||||
|
||||
$inbuf = socket_read($this->Socket, 4096);
|
||||
$inbuf = substr($inbuf, strpos($inbuf, "\r\n\r\n") + 4);
|
||||
$inbuf = file_get_contents($this->Host, false, $context);
|
||||
$response = xmlrpc_decode($inbuf);
|
||||
|
||||
if (isset($response[0]))
|
||||
@@ -98,4 +85,6 @@ class AnopeXMLRPC
|
||||
}
|
||||
}
|
||||
|
||||
$anopexmlrpc = new AnopeXMLRPC("http://127.0.0.1:8080/xmlrpc");
|
||||
|
||||
?>
|
||||
|
||||
+68
-15
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -8,7 +8,6 @@
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ACCESS_H
|
||||
@@ -25,19 +24,25 @@ enum
|
||||
ACCESS_FOUNDER = 10001
|
||||
};
|
||||
|
||||
/* A privilege, probably configured using a privilege{} block. Most
|
||||
* commands require specific privileges to be executed. The AccessProvider
|
||||
* backing each ChanAccess determines whether that ChanAccess has a given
|
||||
* privilege.
|
||||
*/
|
||||
struct CoreExport Privilege
|
||||
{
|
||||
Anope::string name;
|
||||
Anope::string desc;
|
||||
/* Rank relative to other privileges */
|
||||
int rank;
|
||||
|
||||
Privilege(const Anope::string &n, const Anope::string &d, int r);
|
||||
Privilege(const Anope::string &name, const Anope::string &desc, int rank);
|
||||
bool operator==(const Privilege &other) const;
|
||||
};
|
||||
|
||||
class CoreExport PrivilegeManager
|
||||
{
|
||||
static std::vector<Privilege> privs;
|
||||
static std::vector<Privilege> Privileges;
|
||||
public:
|
||||
static void AddPrivilege(Privilege p);
|
||||
static void RemovePrivilege(Privilege &p);
|
||||
@@ -46,25 +51,34 @@ class CoreExport PrivilegeManager
|
||||
static void ClearPrivileges();
|
||||
};
|
||||
|
||||
|
||||
/* A provider of access. Only used for creating ChanAccesses, as
|
||||
* they contain pure virtual functions.
|
||||
*/
|
||||
class CoreExport AccessProvider : public Service
|
||||
{
|
||||
public:
|
||||
AccessProvider(Module *o, const Anope::string &n);
|
||||
AccessProvider(Module *owner, const Anope::string &name);
|
||||
virtual ~AccessProvider();
|
||||
|
||||
/** Creates a new ChanAccess entry using this provider.
|
||||
* @return The new entry
|
||||
*/
|
||||
virtual ChanAccess *Create() = 0;
|
||||
|
||||
private:
|
||||
static std::list<AccessProvider *> providers;
|
||||
static std::list<AccessProvider *> Providers;
|
||||
public:
|
||||
static const std::list<AccessProvider *>& GetProviders();
|
||||
};
|
||||
|
||||
/* Represents one entry of an access list on a channel. */
|
||||
class CoreExport ChanAccess : public Serializable
|
||||
{
|
||||
public:
|
||||
/* The provider that created this access entry */
|
||||
AccessProvider *provider;
|
||||
serialize_obj<ChannelInfo> ci;
|
||||
/* Channel this access entry is on */
|
||||
Serialize::Reference<ChannelInfo> ci;
|
||||
Anope::string mask;
|
||||
Anope::string creator;
|
||||
time_t last_seen;
|
||||
@@ -73,30 +87,69 @@ class CoreExport ChanAccess : public Serializable
|
||||
ChanAccess(AccessProvider *p);
|
||||
virtual ~ChanAccess();
|
||||
|
||||
const Anope::string serialize_name() const anope_override;
|
||||
Serialize::Data serialize() const anope_override;
|
||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &);
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
/** Check if this access entry matches the given user or account
|
||||
* @param u The user
|
||||
* @param nc The account
|
||||
*/
|
||||
virtual bool Matches(const User *u, const NickCore *nc) const;
|
||||
virtual bool HasPriv(const Anope::string &name) const = 0;
|
||||
virtual Anope::string Serialize() const = 0;
|
||||
virtual void Unserialize(const Anope::string &data) = 0;
|
||||
|
||||
/** Check if this access entry has the given privilege.
|
||||
* @param name The privilege name
|
||||
*/
|
||||
virtual bool HasPriv(const Anope::string &name) const = 0;
|
||||
|
||||
/** Serialize the access given by this access entry into a human
|
||||
* readable form. chanserv/access will return a number, chanserv/xop
|
||||
* will be AOP, SOP, etc.
|
||||
*/
|
||||
virtual Anope::string AccessSerialize() const = 0;
|
||||
|
||||
/** Unserialize this access entry from the given data. This data
|
||||
* will be fetched from AccessSerialize.
|
||||
*/
|
||||
virtual void AccessUnserialize(const Anope::string &data) = 0;
|
||||
|
||||
/* Comparison operators to other Access entries */
|
||||
bool operator>(const ChanAccess &other) const;
|
||||
bool operator<(const ChanAccess &other) const;
|
||||
bool operator>=(const ChanAccess &other) const;
|
||||
bool operator<=(const ChanAccess &other) const;
|
||||
};
|
||||
|
||||
/* A group of access entries. This is used commonly, for example with ChannelInfo::AccessFor,
|
||||
* to show what access a user has on a channel because users can match multiple access entries.
|
||||
*/
|
||||
class CoreExport AccessGroup : public std::vector<ChanAccess *>
|
||||
{
|
||||
public:
|
||||
/* Channel these access entries are on */
|
||||
const ChannelInfo *ci;
|
||||
/* Account these entries affect, if any */
|
||||
const NickCore *nc;
|
||||
bool SuperAdmin, Founder;
|
||||
/* super_admin always gets all privs. founder is a special case where ci->founder == nc */
|
||||
bool super_admin, founder;
|
||||
|
||||
AccessGroup();
|
||||
|
||||
/** Check if this access group has a certain privilege. Eg, it
|
||||
* will check every ChanAccess entry of this group for any that
|
||||
* has the given privilege.
|
||||
* @param priv The privilege
|
||||
* @return true if any entry has the given privilege
|
||||
*/
|
||||
bool HasPriv(const Anope::string &priv) const;
|
||||
|
||||
/** Get the "highest" access entry from this group of entries.
|
||||
* The highest entry is determined by the entry that has the privilege
|
||||
* with the highest rank (see Privilege::rank).
|
||||
* @return The "highest" entry
|
||||
*/
|
||||
const ChanAccess *Highest() const;
|
||||
|
||||
/* Comparison operators to other AccessGroups */
|
||||
bool operator>(const AccessGroup &other) const;
|
||||
bool operator<(const AccessGroup &other) const;
|
||||
bool operator>=(const AccessGroup &other) const;
|
||||
|
||||
+179
-136
@@ -1,14 +1,13 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ACCOUNT_H
|
||||
@@ -20,123 +19,51 @@
|
||||
#include "memo.h"
|
||||
#include "base.h"
|
||||
|
||||
typedef Anope::insensitive_map<NickAlias *> nickalias_map;
|
||||
typedef Anope::insensitive_map<NickCore *> nickcore_map;
|
||||
typedef Anope::hash_map<NickAlias *> nickalias_map;
|
||||
typedef Anope::hash_map<NickCore *> nickcore_map;
|
||||
|
||||
extern CoreExport serialize_checker<nickalias_map> NickAliasList;
|
||||
extern CoreExport serialize_checker<nickcore_map> NickCoreList;
|
||||
extern CoreExport Serialize::Checker<nickalias_map> NickAliasList;
|
||||
extern CoreExport Serialize::Checker<nickcore_map> NickCoreList;
|
||||
|
||||
/* NickServ nickname structures. */
|
||||
|
||||
/** Flags set on NickAliases
|
||||
/* A registered nickname.
|
||||
* It matters that Base is here before Extensible (it is inherited by Serializable)
|
||||
*
|
||||
* Possible flags:
|
||||
* NO_EXPIRE - Nick never expires
|
||||
* HELD - This nick is being held after a kill by an enforcer client
|
||||
* or is being SVSHeld.
|
||||
* COLLIDED - We are taking over this nick, either by SVSNICK or KILL
|
||||
* and are waiting for the confirmation of either of these actions to
|
||||
* proceed. This is checked in NickAlias::OnCancel
|
||||
*
|
||||
*/
|
||||
enum NickNameFlag
|
||||
{
|
||||
NS_BEGIN,
|
||||
|
||||
/* Nick never expires */
|
||||
NS_NO_EXPIRE,
|
||||
/* This nick is being held after a kill by an enforcer client
|
||||
* or is being SVSHeld. Used by ns_release to determin if something
|
||||
* should be allowed to be released
|
||||
*/
|
||||
NS_HELD,
|
||||
/* We are taking over this nick, either by SVSNICK or KILL.
|
||||
* We are waiting for the confirmation of either of these actions to
|
||||
* proceed. This is checked in NickAlias::OnCancel
|
||||
*/
|
||||
NS_COLLIDED,
|
||||
|
||||
NS_END
|
||||
};
|
||||
|
||||
const Anope::string NickNameFlagStrings[] = {
|
||||
"BEGIN", "NO_EXPIRE", "HELD", "COLLIDED", ""
|
||||
};
|
||||
|
||||
/** Flags set on NickCores
|
||||
*/
|
||||
enum NickCoreFlag
|
||||
{
|
||||
NI_BEGIN,
|
||||
|
||||
/* Kill others who take this nick */
|
||||
NI_KILLPROTECT,
|
||||
/* Dont recognize unless IDENTIFIED */
|
||||
NI_SECURE,
|
||||
/* Use PRIVMSG instead of NOTICE */
|
||||
NI_MSG,
|
||||
/* Don't allow user to change memo limit */
|
||||
NI_MEMO_HARDMAX,
|
||||
/* Notify of memos at signon and un-away */
|
||||
NI_MEMO_SIGNON,
|
||||
/* Notify of new memos when sent */
|
||||
NI_MEMO_RECEIVE,
|
||||
/* Don't show in LIST to non-servadmins */
|
||||
NI_PRIVATE,
|
||||
/* Don't show email in INFO */
|
||||
NI_HIDE_EMAIL,
|
||||
/* Don't show last seen address in INFO */
|
||||
NI_HIDE_MASK,
|
||||
/* Don't show last quit message in INFO */
|
||||
NI_HIDE_QUIT,
|
||||
/* Kill in 20 seconds instead of in 60 */
|
||||
NI_KILL_QUICK,
|
||||
/* Kill immediatly */
|
||||
NI_KILL_IMMED,
|
||||
/* User gets email on memo */
|
||||
NI_MEMO_MAIL,
|
||||
/* Don't show services access status */
|
||||
NI_HIDE_STATUS,
|
||||
/* Nickname is suspended */
|
||||
NI_SUSPENDED,
|
||||
/* Autoop nickname in channels */
|
||||
NI_AUTOOP,
|
||||
/* This nickcore is forbidden, which means the nickalias for it is aswell */
|
||||
NI_FORBIDDEN,
|
||||
/* If set means the nick core does not have their email addrses confirmed.
|
||||
*/
|
||||
NI_UNCONFIRMED,
|
||||
/* Chanstats are enabled for this user */
|
||||
NI_STATS,
|
||||
|
||||
NI_END
|
||||
};
|
||||
|
||||
const Anope::string NickCoreFlagStrings[] = {
|
||||
"BEGIN", "KILLPROTECT", "SECURE", "MSG", "MEMO_HARDMAX", "MEMO_SIGNON", "MEMO_RECEIVE",
|
||||
"PRIVATE", "HIDE_EMAIL", "HIDE_MASK", "HIDE_QUIT", "KILL_QUICK", "KILL_IMMED",
|
||||
"MEMO_MAIL", "HIDE_STATUS", "SUSPENDED", "AUTOOP", "FORBIDDEN", "UNCONFIRMED", "STATS", ""
|
||||
};
|
||||
|
||||
class CoreExport NickAlias : public Extensible, public Flags<NickNameFlag, NS_END>, public Serializable
|
||||
class CoreExport NickAlias : public Serializable, public Extensible
|
||||
{
|
||||
Anope::string vhost_ident, vhost_host, vhost_creator;
|
||||
time_t vhost_created;
|
||||
|
||||
public:
|
||||
/** Default constructor
|
||||
Anope::string nick;
|
||||
Anope::string last_quit;
|
||||
Anope::string last_realname;
|
||||
/* Last usermask this nick was seen on, eg user@host */
|
||||
Anope::string last_usermask;
|
||||
/* Last uncloaked usermask, requires nickserv/auspex to see */
|
||||
Anope::string last_realhost;
|
||||
time_t time_registered;
|
||||
time_t last_seen;
|
||||
/* Account this nick is tied to. Multiple nicks can be tied to a single account. */
|
||||
Serialize::Reference<NickCore> nc;
|
||||
|
||||
/** Constructor
|
||||
* @param nickname The nick
|
||||
* @param nickcore The nickcore for this nick
|
||||
*/
|
||||
NickAlias(const Anope::string &nickname, NickCore *nickcore);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
~NickAlias();
|
||||
|
||||
Anope::string nick; /* Nickname */
|
||||
Anope::string last_quit; /* Last quit message */
|
||||
Anope::string last_realname; /* Last realname */
|
||||
Anope::string last_usermask; /* Last usermask */
|
||||
Anope::string last_realhost; /* Last uncloaked usermask, requires nickserv/auspex to see */
|
||||
time_t time_registered; /* When the nick was registered */
|
||||
time_t last_seen; /* When it was seen online for the last time */
|
||||
serialize_obj<NickCore> nc; /* I'm an alias of this */
|
||||
|
||||
const Anope::string serialize_name() const anope_override;
|
||||
Serialize::Data serialize() const anope_override;
|
||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &);
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
/** Release a nick
|
||||
* See the comment in users.cpp
|
||||
@@ -186,41 +113,89 @@ class CoreExport NickAlias : public Extensible, public Flags<NickNameFlag, NS_EN
|
||||
* @return the time it was created
|
||||
*/
|
||||
time_t GetVhostCreated() const;
|
||||
|
||||
/** Finds a registered nick
|
||||
* @param nick The nick to lookup
|
||||
* @return the nick, if found
|
||||
*/
|
||||
static NickAlias *Find(const Anope::string &nick);
|
||||
};
|
||||
|
||||
class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag, NI_END>, public Serializable
|
||||
/* A registered account. Each account must have a NickAlias with the same nick as the
|
||||
* account's display.
|
||||
* It matters that Base is here before Extensible (it is inherited by Serializable)
|
||||
*
|
||||
* Possible flags:
|
||||
* KILLPROTECT - Kill other users who try to take this nick
|
||||
* SECURE - Don't recognize unless identified
|
||||
* MSG - Use PRIVMSG instead of notice
|
||||
* MEMO_HARDMAX - Don't allow user to change memo limit
|
||||
* MEMO_SIGNON - Notify of memos at signon and unaway
|
||||
* MEMO_RECEIEVE - Notify of new memos when sent
|
||||
* PRIVATE - Don't show in LIST to non-servadmins
|
||||
* HIDE_EMAIL - Don't show email in INFO
|
||||
* HIDE_MASK - Don't show last seen address in INFO
|
||||
* HIDE_QUIT - Don't show last quit message in INFO
|
||||
* KILL_QUICK - Kill quicker
|
||||
* KILL_IMMED - Kill immediately
|
||||
* MEMO_MAIL - User gets email on memo
|
||||
* HIDE_STATUS - Don't show services access status
|
||||
* SUSPEND - Nickname is suspended
|
||||
* AUTOOP - Autoop nickname in channels
|
||||
* UNCONFIRMED - Account has not had email address confirmed
|
||||
* STATS - ChanStats is enabled for this user
|
||||
*/
|
||||
class CoreExport NickCore : public Serializable, public Extensible
|
||||
{
|
||||
/* Channels which reference this core in some way (this is on their access list, akick list, is founder, successor, etc) */
|
||||
Serialize::Checker<std::map<ChannelInfo *, int> > chanaccess;
|
||||
public:
|
||||
/** Default constructor
|
||||
* @param display The display nick
|
||||
*/
|
||||
NickCore(const Anope::string &nickdisplay);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
~NickCore();
|
||||
|
||||
std::list<User *> Users;
|
||||
|
||||
Anope::string display; /* How the nick is displayed */
|
||||
Anope::string pass; /* Password of the nicks */
|
||||
Anope::string email; /* E-mail associated to the nick */
|
||||
Anope::string greet; /* Greet associated to the nick */
|
||||
Anope::string language; /* Language name */
|
||||
std::vector<Anope::string> access; /* Access list, vector of strings */
|
||||
std::vector<Anope::string> cert; /* ssl certificate list, vector of strings */
|
||||
/* Name of the account. Find(display)->nc == this. */
|
||||
Anope::string display;
|
||||
/* User password in form of hashm:data */
|
||||
Anope::string pass;
|
||||
Anope::string email;
|
||||
/* Greet associated with the account, sometimes sent when the user joins a channel */
|
||||
Anope::string greet;
|
||||
/* Locale name of the language of the user. Empty means default language */
|
||||
Anope::string language;
|
||||
/* Access list, contains user@host masks of users who get certain privileges based
|
||||
* on if NI_SECURE is set and what (if any) kill protection is enabled. */
|
||||
std::vector<Anope::string> access;
|
||||
/* SSL certificate list. Users who have a matching certificate may be automatically logged in */
|
||||
std::vector<Anope::string> cert;
|
||||
MemoInfo memos;
|
||||
|
||||
/* Nicknames registered that are grouped to this account.
|
||||
* for n in aliases, n->nc == this.
|
||||
*/
|
||||
Serialize::Checker<std::vector<NickAlias *> > aliases;
|
||||
|
||||
/* Set if this user is a services operattor. o->ot must exist. */
|
||||
Oper *o;
|
||||
|
||||
/* Unsaved data */
|
||||
uint16_t channelcount; /* Number of channels currently registered */
|
||||
time_t lastmail; /* Last time this nick record got a mail */
|
||||
std::list<serialize_obj<NickAlias> > aliases; /* List of aliases */
|
||||
|
||||
const Anope::string serialize_name() const anope_override;
|
||||
Serialize::Data serialize() const anope_override;
|
||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &);
|
||||
/* Number of channels registered by this account */
|
||||
uint16_t channelcount;
|
||||
/* Last time an email was sent to this user */
|
||||
time_t lastmail;
|
||||
/* Users online now logged into this account */
|
||||
std::list<User *> users;
|
||||
|
||||
/** Constructor
|
||||
* @param display The display nick
|
||||
*/
|
||||
NickCore(const Anope::string &nickdisplay);
|
||||
~NickCore();
|
||||
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
/** Changes the display for this account
|
||||
* @param na The new display, must be grouped to this account.
|
||||
*/
|
||||
void SetDisplay(const NickAlias *na);
|
||||
|
||||
/** Checks whether this account is a services oper or not.
|
||||
* @return True if this account is a services oper, false otherwise.
|
||||
@@ -267,6 +242,14 @@ class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag, NI_END
|
||||
*/
|
||||
void ClearAccess();
|
||||
|
||||
/** Is the given user on this accounts access list?
|
||||
*
|
||||
* @param u The user
|
||||
*
|
||||
* @return true if the user is on the access list
|
||||
*/
|
||||
bool IsOnAccess(const User *u) const;
|
||||
|
||||
/** Add an entry to the nick's certificate list
|
||||
*
|
||||
* @param entry The fingerprint to add to the cert list
|
||||
@@ -307,13 +290,73 @@ class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag, NI_END
|
||||
*/
|
||||
void ClearCert();
|
||||
|
||||
/** Finds an account
|
||||
* @param nick The account name to find
|
||||
* @return The account, if it exists
|
||||
*/
|
||||
static NickCore* Find(const Anope::string &nick);
|
||||
|
||||
void AddChannelReference(ChannelInfo *ci);
|
||||
void RemoveChannelReference(ChannelInfo *ci);
|
||||
void GetChannelReferences(std::deque<ChannelInfo *> &queue);
|
||||
};
|
||||
|
||||
extern CoreExport void change_core_display(NickCore *nc);
|
||||
extern CoreExport void change_core_display(NickCore *nc, const Anope::string &newdisplay);
|
||||
/* A request to check if an account/password is valid. These can exist for
|
||||
* extended periods of time due to some authentication modules take.
|
||||
*/
|
||||
class CoreExport IdentifyRequest
|
||||
{
|
||||
/* Owner of this request, used to cleanup requests if a module is unloaded
|
||||
* while a reqyest us pending */
|
||||
Module *owner;
|
||||
Anope::string account;
|
||||
Anope::string password;
|
||||
|
||||
extern CoreExport NickAlias *findnick(const Anope::string &nick);
|
||||
extern CoreExport NickCore *findcore(const Anope::string &nick);
|
||||
extern CoreExport bool is_on_access(const User *u, const NickCore *nc);
|
||||
std::set<Module *> holds;
|
||||
bool dispatched;
|
||||
bool success;
|
||||
|
||||
static std::set<IdentifyRequest *> Requests;
|
||||
|
||||
protected:
|
||||
IdentifyRequest(Module *o, const Anope::string &acc, const Anope::string &pass);
|
||||
virtual ~IdentifyRequest();
|
||||
|
||||
public:
|
||||
/* One of these is called when the request goes through */
|
||||
virtual void OnSuccess() = 0;
|
||||
virtual void OnFail() = 0;
|
||||
|
||||
const Anope::string &GetAccount() const { return account; }
|
||||
const Anope::string &GetPassword() const { return password; }
|
||||
|
||||
/* Holds this request. When a request is held it must be Released later
|
||||
* for the request to complete. Multiple modules may hold a request at any time,
|
||||
* but the request is not complete until every module has released it. If you do not
|
||||
* require holding this (eg, your password check is done in this thread and immediately)
|
||||
* then you don't need to hold the request before Successing it.
|
||||
* @param m The module holding this request
|
||||
*/
|
||||
void Hold(Module *m);
|
||||
|
||||
/** Releases a held request
|
||||
* @param m The module releaseing the hold
|
||||
*/
|
||||
void Release(Module *m);
|
||||
|
||||
/** Called by modules when this IdentifyRequest has successeded successfully.
|
||||
* If this request is behind held it must still be Released after calling this.
|
||||
* @param m The module confirming authentication
|
||||
*/
|
||||
void Success(Module *m);
|
||||
|
||||
/** Used to either finalize this request or marks
|
||||
* it as dispatched and begins waiting for the module(s)
|
||||
* that have holds to finish.
|
||||
*/
|
||||
void Dispatch();
|
||||
|
||||
static void ModuleUnload(Module *m);
|
||||
};
|
||||
|
||||
#endif // ACCOUNT_H
|
||||
|
||||
+224
-152
@@ -1,23 +1,24 @@
|
||||
/*
|
||||
* (C) 2003-2012 Anope Team
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ANOPE_H
|
||||
#define ANOPE_H
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#include "hashcomp.h"
|
||||
|
||||
namespace Anope
|
||||
{
|
||||
template<typename T> class map : public std::map<string, T> { };
|
||||
template<typename T> class insensitive_map : public std::map<string, T, ci::less> { };
|
||||
|
||||
/**
|
||||
* A wrapper string class around all the other string classes, this class will
|
||||
* allow us to only require one type of string everywhere that can be converted
|
||||
@@ -49,9 +50,10 @@ namespace Anope
|
||||
string(char chr) : _string() { _string = chr; }
|
||||
string(size_type n, char chr) : _string(n, chr) { }
|
||||
string(const char *_str) : _string(_str) { }
|
||||
string(const char *_str, size_type n) : _string(_str, n) { }
|
||||
string(const std::string &_str) : _string(_str) { }
|
||||
string(const ci::string &_str) : _string(_str.c_str()) { }
|
||||
string(const string &_str, size_type pos = 0, size_type n = npos) : _string(_str._string, pos, n) { }
|
||||
string(const string &_str, size_type pos, size_type n = npos) : _string(_str._string, pos, n) { }
|
||||
template <class InputIterator> string(InputIterator first, InputIterator last) : _string(first, last) { }
|
||||
|
||||
/**
|
||||
@@ -138,6 +140,9 @@ namespace Anope
|
||||
*/
|
||||
inline void push_back(char c) { return this->_string.push_back(c); }
|
||||
|
||||
inline string& append(const string &s) { this->_string.append(s.str()); return *this; }
|
||||
inline string& append(const char *s, size_t n) { this->_string.append(s, n); return *this; }
|
||||
|
||||
/**
|
||||
* Resizes the string content to n characters.
|
||||
*/
|
||||
@@ -153,12 +158,26 @@ namespace Anope
|
||||
/**
|
||||
* Trim leading and trailing white spaces from the string.
|
||||
*/
|
||||
inline void trim()
|
||||
|
||||
inline string& ltrim()
|
||||
{
|
||||
while (!this->_string.empty() && isspace(this->_string[0]))
|
||||
this->_string.erase(this->_string.begin());
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline string& rtrim()
|
||||
{
|
||||
while (!this->_string.empty() && isspace(this->_string[this->_string.length() - 1]))
|
||||
this->_string.erase(this->_string.length() - 1);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline string& trim()
|
||||
{
|
||||
this->ltrim();
|
||||
this->rtrim();
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -232,7 +251,7 @@ namespace Anope
|
||||
/**
|
||||
* Get the string in lowercase.
|
||||
*/
|
||||
inline string lower()
|
||||
inline string lower() const
|
||||
{
|
||||
Anope::string new_string = *this;
|
||||
for (size_type i = 0; i < new_string.length(); ++i)
|
||||
@@ -243,7 +262,7 @@ namespace Anope
|
||||
/**
|
||||
* Get the string in uppercase.
|
||||
*/
|
||||
inline string upper()
|
||||
inline string upper() const
|
||||
{
|
||||
Anope::string new_string = *this;
|
||||
for (size_type i = 0; i < new_string.length(); ++i)
|
||||
@@ -278,37 +297,94 @@ namespace Anope
|
||||
* Stream insertion operator, must be friend because they cannot be inside the class.
|
||||
*/
|
||||
friend std::ostream &operator<<(std::ostream &os, const string &_str);
|
||||
};
|
||||
|
||||
/** Hash an Anope::string for unorderd_map, passed as the third template arg to unordered_map
|
||||
*/
|
||||
struct hash
|
||||
{
|
||||
/* VS 2008 specific code */
|
||||
enum { bucket_size = 4, min_buckets = 8 };
|
||||
bool operator()(const string &s1, const string &s2) const;
|
||||
/* End of 2008 specific code */
|
||||
|
||||
/** Hash an Anope::string for unordered_map
|
||||
* @param s The string
|
||||
* @return A hash value for the string
|
||||
*/
|
||||
bool operator()(const string &s) const;
|
||||
friend std::istream &operator>>(std::istream &is, string &_str);
|
||||
};
|
||||
|
||||
inline std::ostream &operator<<(std::ostream &os, const string &_str) { return os << _str._string; }
|
||||
/* This is not standard to make operator>> behave like operator<< in that it will allow extracting a whole line, not just one word */
|
||||
inline std::istream &operator>>(std::istream &is, string &_str) { return std::getline(is, _str._string); }
|
||||
|
||||
inline const string operator+(char chr, const string &str) { string tmp(chr); tmp += str; return tmp; }
|
||||
inline const string operator+(const char *_str, const string &str) { string tmp(_str); tmp += str; return tmp; }
|
||||
inline const string operator+(const std::string &_str, const string &str) { string tmp(_str); tmp += str; return tmp; }
|
||||
|
||||
struct hash_ci
|
||||
{
|
||||
inline size_t operator()(const string &s) const
|
||||
{
|
||||
return std::tr1::hash<std::string>()(s.lower().str());
|
||||
}
|
||||
};
|
||||
|
||||
struct hash_cs
|
||||
{
|
||||
inline size_t operator()(const string &s) const
|
||||
{
|
||||
return std::tr1::hash<std::string>()(s.str());
|
||||
}
|
||||
};
|
||||
|
||||
struct compare
|
||||
{
|
||||
inline bool operator()(const string &s1, const string &s2) const
|
||||
{
|
||||
return s1.equals_ci(s2);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T> class map : public std::map<string, T, ci::less> { };
|
||||
template<typename T> class hash_map : public std::tr1::unordered_map<string, T, hash_ci, compare> { };
|
||||
|
||||
static const char *const compiled = __TIME__ " " __DATE__;
|
||||
|
||||
/** The time Anope started.
|
||||
*/
|
||||
extern CoreExport time_t StartTime;
|
||||
|
||||
/** The value to return from main()
|
||||
*/
|
||||
extern int ReturnValue;
|
||||
|
||||
extern sig_atomic_t Signal;
|
||||
extern CoreExport bool Quitting;
|
||||
extern CoreExport bool Restarting;
|
||||
extern CoreExport Anope::string QuitReason;
|
||||
|
||||
/** The current system time, which is pretty close to being accurate.
|
||||
* Use this unless you need very specific time checks
|
||||
*/
|
||||
extern CoreExport time_t CurTime;
|
||||
|
||||
/** The debug level we are running at.
|
||||
*/
|
||||
extern CoreExport int Debug;
|
||||
|
||||
/** Other comand line options.
|
||||
*/
|
||||
extern CoreExport bool ReadOnly, NoFork, NoThird, NoExpire, ProtocolDebug;
|
||||
|
||||
/** The root of the services installation. Usually ~/services
|
||||
*/
|
||||
extern CoreExport Anope::string ServicesDir;
|
||||
|
||||
/** Services binary name (eg services)
|
||||
*/
|
||||
extern CoreExport Anope::string ServicesBin;
|
||||
|
||||
/** Various directory paths. These can be set at runtime by command line args
|
||||
*/
|
||||
extern CoreExport Anope::string ConfigDir;
|
||||
extern CoreExport Anope::string DataDir;
|
||||
extern CoreExport Anope::string ModuleDir;
|
||||
extern CoreExport Anope::string LocaleDir;
|
||||
extern CoreExport Anope::string LogDir;
|
||||
|
||||
/** The uplink we are currently connected to
|
||||
*/
|
||||
extern CoreExport int CurrentUplink;
|
||||
|
||||
/** Various methods to determine the Anope version running
|
||||
*/
|
||||
extern CoreExport string Version();
|
||||
extern CoreExport string VersionShort();
|
||||
extern CoreExport string VersionBuildString();
|
||||
@@ -316,6 +392,33 @@ namespace Anope
|
||||
extern CoreExport int VersionMinor();
|
||||
extern CoreExport int VersionPatch();
|
||||
|
||||
/** Determines if we are still attached to the terminal, and can print
|
||||
* messages to the user via stderr/stdout.
|
||||
* @return true if still attached
|
||||
*/
|
||||
extern bool AtTerm();
|
||||
|
||||
/** Used to "fork" the process and go into the background during initial startup
|
||||
* while we are AtTerm(). The actual fork is not done here, but earlier, and this
|
||||
* simply notifys the parent via kill() to exit().
|
||||
*/
|
||||
extern void Fork();
|
||||
|
||||
/** Does something with the signal in Anope::Signal
|
||||
*/
|
||||
extern void HandleSignal();
|
||||
|
||||
/** One of the first functions called, does general initialization such as reading
|
||||
* command line args, loading the configuration, doing the initial fork() if necessary,
|
||||
* initializating language support, loading modules, and loading databases.
|
||||
* @throws CoreException if something bad went wrong
|
||||
*/
|
||||
extern void Init(int ac, char **av);
|
||||
|
||||
/** Calls the save database event
|
||||
*/
|
||||
extern CoreExport void SaveDatabases();
|
||||
|
||||
/** Check whether two strings match.
|
||||
* @param str The string to check against the pattern (e.g. foobar)
|
||||
* @param mask The pattern to check (e.g. foo*bar)
|
||||
@@ -324,12 +427,6 @@ namespace Anope
|
||||
*/
|
||||
extern CoreExport bool Match(const string &str, const string &mask, bool case_sensitive = false, bool use_regex = false);
|
||||
|
||||
/** Find a message in the message table
|
||||
* @param name The name of the message were looking for
|
||||
* @return NULL if we cant find it, or a pointer to the Message if we can
|
||||
*/
|
||||
extern CoreExport std::vector<Message *> FindMessage(const string &name);
|
||||
|
||||
/** Converts a string to hex
|
||||
* @param the data to be converted
|
||||
* @return a anope::string containing the hex value
|
||||
@@ -356,6 +453,20 @@ namespace Anope
|
||||
*/
|
||||
extern CoreExport void B64Decode(const string &src, string &target);
|
||||
|
||||
/** Encrypts what is in 'src' to 'dest'
|
||||
* @param src The source string to encrypt
|
||||
* @param dest The destination where the encrypted string is placed
|
||||
*/
|
||||
extern CoreExport void Encrypt(const Anope::string &src, Anope::string &dest);
|
||||
|
||||
/** Decrypts what is in 'src' to 'dest'.
|
||||
* @param src The source string to decrypt
|
||||
* @param dest The destination where the decrypted string is placed
|
||||
* @return true if decryption was successful. This is usually not the case
|
||||
* as most encryption methods we use are one way.
|
||||
*/
|
||||
extern CoreExport bool Decrypt(const Anope::string &src, Anope::string &dest);
|
||||
|
||||
/** Returns a sequence of data formatted as the format argument specifies.
|
||||
** After the format parameter, the function expects at least as many
|
||||
** additional arguments as specified in format.
|
||||
@@ -374,6 +485,55 @@ namespace Anope
|
||||
* @return An error message
|
||||
*/
|
||||
extern CoreExport const string LastError();
|
||||
|
||||
/** Determines if a path is a file
|
||||
*/
|
||||
extern CoreExport bool IsFile(const Anope::string &file);
|
||||
|
||||
/** Converts a string into seconds
|
||||
* @param s The string, eg 3d
|
||||
* @return The time represented by the string, eg 259,200
|
||||
*/
|
||||
extern CoreExport time_t DoTime(const Anope::string &s);
|
||||
|
||||
/** Retrieves a human readable string representing the time in seconds
|
||||
* @param seconds The time on seconds, eg 60
|
||||
* @param nc The account to use langauge settings for to translate this string, if applicable
|
||||
* @return A human readable string, eg "1 minute"
|
||||
*/
|
||||
extern CoreExport Anope::string Duration(time_t seconds, const NickCore *nc = NULL);
|
||||
|
||||
/** Generates a human readable string of type "expires in ..."
|
||||
* @param expires time in seconds
|
||||
* @param nc The account to use langauge settings for to translate this string, if applicable
|
||||
* @return A human readable string, eg "expires in 5 days"
|
||||
*/
|
||||
extern CoreExport Anope::string Expires(time_t seconds, const NickCore *nc = NULL);
|
||||
|
||||
/** Converts a time in seconds (epoch) to a human readable format.
|
||||
* @param t The time
|
||||
* @param nc The account to use langauge settings for to translate this string, if applicable
|
||||
* @param short_output If true, the output is just a date (eg, "Apr 12 20:18:22 2009 MSD"), else it includes the date and how long ago/from now that date is, (eg "Apr 12 20:18:22 2009 MSD (1313 days, 9 hours, 32 minutes ago)"
|
||||
*/
|
||||
extern CoreExport Anope::string strftime(time_t t, const NickCore *nc = NULL, bool short_output = false);
|
||||
|
||||
/** Normalize buffer, stripping control characters and colors
|
||||
* @param A string to be parsed for control and color codes
|
||||
* @return A string stripped of control and color codes
|
||||
*/
|
||||
extern CoreExport Anope::string NormalizeBuffer(const Anope::string &);
|
||||
|
||||
/** Main processing routine. Parses the message and takes the appropriate action.
|
||||
* @param Raw message from the uplink
|
||||
*/
|
||||
extern void Process(const Anope::string &);
|
||||
|
||||
/** Does a blocking dns query and returns the first IP.
|
||||
* @param host host to look up
|
||||
* @param type inet addr type
|
||||
* @return the IP if it was found, else the host
|
||||
*/
|
||||
extern Anope::string Resolve(const Anope::string &host, int type);
|
||||
}
|
||||
|
||||
/** sepstream allows for splitting token seperated lists.
|
||||
@@ -400,23 +560,52 @@ class CoreExport sepstream
|
||||
/** Create a sepstream and fill it with the provided data
|
||||
*/
|
||||
sepstream(const Anope::string &source, char seperator);
|
||||
virtual ~sepstream() { }
|
||||
|
||||
/** Fetch the next token from the stream
|
||||
* @param token The next token from the stream is placed here
|
||||
* @return True if tokens still remain, false if there are none left
|
||||
*/
|
||||
virtual bool GetToken(Anope::string &token);
|
||||
bool GetToken(Anope::string &token);
|
||||
|
||||
/** Gets token number 'num' from the stream
|
||||
* @param token The token is placed here
|
||||
* @param num The token number to featch
|
||||
* @return True if the token was able to be detched
|
||||
*/
|
||||
bool GetToken(Anope::string &token, int num);
|
||||
|
||||
/** Gets every token from this stream
|
||||
* @param token Tokens are pushed back here
|
||||
*/
|
||||
template<typename T> void GetTokens(T& token)
|
||||
{
|
||||
token.clear();
|
||||
Anope::string t;
|
||||
while (this->GetToken(t))
|
||||
token.push_back(t);
|
||||
}
|
||||
|
||||
/** Gets token number 'num' from the stream and all remaining tokens.
|
||||
* @param token The token is placed here
|
||||
* @param num The token number to featch
|
||||
* @return True if the token was able to be detched
|
||||
*/
|
||||
bool GetTokenRemainder(Anope::string &token, int num);
|
||||
|
||||
/** Determines the number of tokens in this stream.
|
||||
* @return The number of tokens in this stream
|
||||
*/
|
||||
int NumTokens();
|
||||
|
||||
/** Fetch the entire remaining stream, without tokenizing
|
||||
* @return The remaining part of the stream
|
||||
*/
|
||||
virtual const Anope::string GetRemaining();
|
||||
const Anope::string GetRemaining();
|
||||
|
||||
/** Returns true if the end of the stream has been reached
|
||||
* @return True if the end of the stream has been reached, otherwise false
|
||||
*/
|
||||
virtual bool StreamEnd();
|
||||
bool StreamEnd();
|
||||
};
|
||||
|
||||
/** A derived form of sepstream, which seperates on commas
|
||||
@@ -484,14 +673,6 @@ class CoreException : public std::exception
|
||||
}
|
||||
};
|
||||
|
||||
class FatalException : public CoreException
|
||||
{
|
||||
public:
|
||||
FatalException(const Anope::string &reason = "") : CoreException(reason) { }
|
||||
|
||||
virtual ~FatalException() throw() { }
|
||||
};
|
||||
|
||||
class ModuleException : public CoreException
|
||||
{
|
||||
public:
|
||||
@@ -571,7 +752,7 @@ template<typename T> inline T convertTo(const Anope::string &s, bool failIfLefto
|
||||
}
|
||||
|
||||
/** Casts to be used instead of dynamic_cast, this uses dynamic_cast
|
||||
* for debug builds and static_cast/reinterpret_cast on releass builds
|
||||
* for debug builds and static_cast on releass builds
|
||||
* to speed up the program because dynamic_cast relies on RTTI.
|
||||
*/
|
||||
#ifdef DEBUG_BUILD
|
||||
@@ -589,113 +770,4 @@ template<typename T, typename O> inline T anope_dynamic_static_cast(O ptr)
|
||||
#endif
|
||||
}
|
||||
|
||||
template<typename T, typename O> inline T anope_dynamic_reinterpret_cast(O ptr)
|
||||
{
|
||||
#ifdef DEBUG_BUILD
|
||||
T ret = dynamic_cast<T>(ptr);
|
||||
if (ptr != NULL && ret == NULL)
|
||||
throw CoreException(Anope::string("anope_dynamic_reinterpret_cast<") + typeid(T).name() + ">(" + typeid(O).name() + ") fail");
|
||||
return ret;
|
||||
#else
|
||||
return reinterpret_cast<T>(ptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/** Class with the ability to keep flags on items, they should extend from this
|
||||
* where T is an enum.
|
||||
*/
|
||||
template<typename T, size_t Size = 32> class Flags
|
||||
{
|
||||
protected:
|
||||
std::bitset<Size> Flag_Values;
|
||||
const Anope::string *Flag_Strings;
|
||||
|
||||
public:
|
||||
Flags() : Flag_Strings(NULL) { }
|
||||
Flags(const Anope::string *flag_strings) : Flag_Strings(flag_strings) { }
|
||||
|
||||
/** Add a flag to this item
|
||||
* @param Value The flag
|
||||
*/
|
||||
void SetFlag(T Value)
|
||||
{
|
||||
Flag_Values[Value] = true;
|
||||
}
|
||||
|
||||
/** Remove a flag from this item
|
||||
* @param Value The flag
|
||||
*/
|
||||
void UnsetFlag(T Value)
|
||||
{
|
||||
Flag_Values[Value] = false;
|
||||
}
|
||||
|
||||
/** Check if this item has a flag
|
||||
* @param Value The flag
|
||||
* @return true or false
|
||||
*/
|
||||
bool HasFlag(T Value) const
|
||||
{
|
||||
return Flag_Values.test(Value);
|
||||
}
|
||||
|
||||
/** Check how many flags are set
|
||||
* @return The number of flags set
|
||||
*/
|
||||
size_t FlagCount() const
|
||||
{
|
||||
return Flag_Values.count();
|
||||
}
|
||||
|
||||
/** Unset all of the flags
|
||||
*/
|
||||
void ClearFlags()
|
||||
{
|
||||
Flag_Values.reset();
|
||||
}
|
||||
|
||||
Anope::string ToString() const
|
||||
{
|
||||
std::vector<Anope::string> v = ToVector();
|
||||
Anope::string flag_buf;
|
||||
for (unsigned i = 0; i < v.size(); ++i)
|
||||
flag_buf += v[i] + " ";
|
||||
flag_buf.trim();
|
||||
return flag_buf;
|
||||
}
|
||||
|
||||
void FromString(const Anope::string &str)
|
||||
{
|
||||
spacesepstream sep(str);
|
||||
Anope::string buf;
|
||||
std::vector<Anope::string> v;
|
||||
|
||||
while (sep.GetToken(buf))
|
||||
v.push_back(buf);
|
||||
|
||||
FromVector(v);
|
||||
}
|
||||
|
||||
std::vector<Anope::string> ToVector() const
|
||||
{
|
||||
std::vector<Anope::string> ret;
|
||||
for (unsigned i = 0; this->Flag_Strings && !this->Flag_Strings[i].empty(); ++i)
|
||||
if (this->HasFlag(static_cast<T>(i)))
|
||||
ret.push_back(this->Flag_Strings[i]);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void FromVector(const std::vector<Anope::string> &strings)
|
||||
{
|
||||
this->ClearFlags();
|
||||
|
||||
for (unsigned i = 0; this->Flag_Strings && !this->Flag_Strings[i].empty(); ++i)
|
||||
for (unsigned j = 0; j < strings.size(); ++j)
|
||||
if (this->Flag_Strings[i] == strings[j])
|
||||
this->SetFlag(static_cast<T>(i));
|
||||
}
|
||||
};
|
||||
|
||||
#endif // ANOPE_H
|
||||
|
||||
+54
-24
@@ -1,9 +1,10 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2008-2011 Adam <Adam@anope.org>
|
||||
* Copyright (C) 2008-2012 Anope Team <team@anope.org>
|
||||
* Copyright (C) 2008-2013 Anope Team <team@anope.org>
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef BASE_H
|
||||
@@ -16,53 +17,78 @@
|
||||
class CoreExport Base
|
||||
{
|
||||
/* References to this base class */
|
||||
std::set<dynamic_reference_base *> References;
|
||||
std::set<ReferenceBase *> *references;
|
||||
public:
|
||||
Base();
|
||||
virtual ~Base();
|
||||
void AddReference(dynamic_reference_base *r);
|
||||
void DelReference(dynamic_reference_base *r);
|
||||
|
||||
/** Adds a reference to this object. Eg, when a Reference
|
||||
* is created referring to this object this is called. It is used to
|
||||
* cleanup references when this object is destructed.
|
||||
*/
|
||||
void AddReference(ReferenceBase *r);
|
||||
|
||||
void DelReference(ReferenceBase *r);
|
||||
};
|
||||
|
||||
class dynamic_reference_base
|
||||
class ReferenceBase
|
||||
{
|
||||
protected:
|
||||
bool invalid;
|
||||
public:
|
||||
dynamic_reference_base() : invalid(false) { }
|
||||
dynamic_reference_base(const dynamic_reference_base &other) : invalid(other.invalid) { }
|
||||
virtual ~dynamic_reference_base() { }
|
||||
ReferenceBase() : invalid(false) { }
|
||||
ReferenceBase(const ReferenceBase &other) : invalid(other.invalid) { }
|
||||
virtual ~ReferenceBase() { }
|
||||
inline void Invalidate() { this->invalid = true; }
|
||||
};
|
||||
|
||||
/** Used to hold pointers to objects that may be deleted. A Reference will
|
||||
* no longer be valid once the object it refers is destructed.
|
||||
*/
|
||||
template<typename T>
|
||||
class dynamic_reference : public dynamic_reference_base
|
||||
class Reference : public ReferenceBase
|
||||
{
|
||||
protected:
|
||||
T *ref;
|
||||
public:
|
||||
dynamic_reference() : ref(NULL)
|
||||
Reference() : ref(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
dynamic_reference(T *obj) : ref(obj)
|
||||
Reference(T *obj) : ref(obj)
|
||||
{
|
||||
if (ref)
|
||||
ref->AddReference(this);
|
||||
}
|
||||
|
||||
dynamic_reference(const dynamic_reference<T> &other) : dynamic_reference_base(other), ref(other.ref)
|
||||
Reference(const Reference<T> &other) : ReferenceBase(other), ref(other.ref)
|
||||
{
|
||||
if (operator bool())
|
||||
ref->AddReference(this);
|
||||
}
|
||||
|
||||
virtual ~dynamic_reference()
|
||||
virtual ~Reference()
|
||||
{
|
||||
if (operator bool())
|
||||
ref->DelReference(this);
|
||||
}
|
||||
|
||||
inline Reference<T>& operator=(const Reference<T> &other)
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
if (*this)
|
||||
this->ref->DelReference(this);
|
||||
|
||||
this->ref = other.ref;
|
||||
this->invalid = other.invalid;
|
||||
|
||||
if (*this)
|
||||
this->ref->AddReference(this);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* We explicitly call operator bool here in several places to prevent other
|
||||
* operators, such operator T*, from being called instead, which will mess
|
||||
* with any class inheriting from this that overloads this operator.
|
||||
@@ -88,22 +114,26 @@ class dynamic_reference : public dynamic_reference_base
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inline void operator=(T *newref)
|
||||
inline T* operator*()
|
||||
{
|
||||
if (operator bool())
|
||||
this->ref->DelReference(this);
|
||||
this->ref = newref;
|
||||
this->invalid = false;
|
||||
if (operator bool())
|
||||
this->ref->AddReference(this);
|
||||
return this->ref;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inline bool operator<(const dynamic_reference<T> &other) const
|
||||
{
|
||||
return this < &other;
|
||||
}
|
||||
/** Note that we can't have an operator< that returns this->ref < other.ref
|
||||
* because this function is used to sort objects in containers (such as set
|
||||
* or map), and if the references themselves can change if the object they
|
||||
* refer to is invalidated or changed, then this screws with the order that
|
||||
* the objects would be in the container without properly adjusting the
|
||||
* container, resulting in weird stuff.
|
||||
*
|
||||
* As such, we don't allow storing references in containers that require
|
||||
* operator<, because they would not be able to compare what the references
|
||||
* actually referred to.
|
||||
*/
|
||||
|
||||
inline bool operator==(const dynamic_reference<T> &other)
|
||||
inline bool operator==(const Reference<T> &other)
|
||||
{
|
||||
if (!this->invalid)
|
||||
return this->ref == other;
|
||||
|
||||
+34
-39
@@ -1,8 +1,10 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
|
||||
* Copyright (C) 2008-2012 Anope Team <team@anope.org>
|
||||
* Copyright (C) 2008-2013 Anope Team <team@anope.org>
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef BOTS_H
|
||||
@@ -14,40 +16,29 @@
|
||||
#include "commands.h"
|
||||
|
||||
|
||||
typedef Anope::insensitive_map<BotInfo *> botinfo_map;
|
||||
typedef Anope::map<BotInfo *> botinfouid_map;
|
||||
typedef Anope::map<BotInfo *> botinfo_map;
|
||||
|
||||
extern CoreExport serialize_checker<botinfo_map> BotListByNick;
|
||||
extern CoreExport serialize_checker<botinfouid_map> BotListByUID;
|
||||
extern CoreExport Serialize::Checker<botinfo_map> BotListByNick, BotListByUID;
|
||||
|
||||
/** Flags settable on a bot
|
||||
*/
|
||||
enum BotFlag
|
||||
{
|
||||
BI_BEGIN,
|
||||
|
||||
/* This bot is a core bot. NickServ, ChanServ, etc */
|
||||
BI_CORE,
|
||||
/* This bot can only be assigned by IRCops */
|
||||
BI_PRIVATE,
|
||||
/* This bot is defined in the config */
|
||||
BI_CONF,
|
||||
|
||||
BI_END
|
||||
};
|
||||
|
||||
static const Anope::string BotFlagString[] = { "BEGIN", "CORE", "PRIVATE", "CONF", "" };
|
||||
|
||||
class CoreExport BotInfo : public User, public Flags<BotFlag, BI_END>, public Serializable
|
||||
/* A service bot (NickServ, ChanServ, a BotServ bot, etc). */
|
||||
class CoreExport BotInfo : public User, public Serializable
|
||||
{
|
||||
public:
|
||||
time_t created; /* Birth date ;) */
|
||||
time_t lastmsg; /* Last time we said something */
|
||||
typedef Anope::insensitive_map<CommandInfo> command_map;
|
||||
command_map commands; /* Commands, actual name to service name */
|
||||
Anope::string botmodes; /* Modes the bot should have as configured in service:modes */
|
||||
std::vector<Anope::string> botchannels; /* Channels the bot should be in as configured in service:channels */
|
||||
bool introduced; /* Whether or not this bot is introduced */
|
||||
time_t created;
|
||||
/* Last time this bot said something (via privmsg) */
|
||||
time_t lastmsg;
|
||||
/* Map of actual command names -> service name/permission required */
|
||||
CommandInfo::map commands;
|
||||
/* Modes the bot should have as configured in service:modes */
|
||||
Anope::string botmodes;
|
||||
/* Channels the bot should be in as configured in service:channels */
|
||||
std::vector<Anope::string> botchannels;
|
||||
/* Whether or not this bot is introduced to the network */
|
||||
bool introduced;
|
||||
/* Bot can only be assigned by irc ops */
|
||||
bool oper_only;
|
||||
/* Bot is defined in the configuration file */
|
||||
bool conf;
|
||||
|
||||
/** Create a new bot.
|
||||
* @param nick The nickname to assign to the bot.
|
||||
@@ -62,9 +53,8 @@ class CoreExport BotInfo : public User, public Flags<BotFlag, BI_END>, public Se
|
||||
*/
|
||||
virtual ~BotInfo();
|
||||
|
||||
const Anope::string serialize_name() const;
|
||||
Serialize::Data serialize() const;
|
||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &);
|
||||
void Serialize(Serialize::Data &data) const;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
void GenerateUID();
|
||||
|
||||
@@ -122,19 +112,24 @@ class CoreExport BotInfo : public User, public Flags<BotFlag, BI_END>, public Se
|
||||
* @param cname The command name
|
||||
* @param sname The service name
|
||||
* @param permission Permission required to execute the command, if any
|
||||
* @return The commandinfo for the newly created command
|
||||
*/
|
||||
void SetCommand(const Anope::string &cname, const Anope::string &sname, const Anope::string &permission = "");
|
||||
CommandInfo& SetCommand(const Anope::string &cname, const Anope::string &sname, const Anope::string &permission = "");
|
||||
|
||||
/** Get command info for a command
|
||||
* @param cname The command name
|
||||
* @return A struct containing service name and permission
|
||||
*/
|
||||
CommandInfo *GetCommand(const Anope::string &cname);
|
||||
|
||||
/** Find a bot by nick
|
||||
* @param nick The nick
|
||||
* @param nick_only True to only look by nick, and not by UID
|
||||
* @return The bot, if it exists
|
||||
*/
|
||||
static BotInfo* Find(const Anope::string &nick, bool nick_only = false);
|
||||
};
|
||||
|
||||
extern CoreExport BotInfo *findbot(const Anope::string &nick);
|
||||
|
||||
extern CoreExport void bot_raw_ban(User *requester, ChannelInfo *ci, const Anope::string &nick, const Anope::string &reason);
|
||||
extern CoreExport void bot_raw_kick(User *requester, ChannelInfo *ci, const Anope::string &nick, const Anope::string &reason);
|
||||
extern CoreExport BotInfo *BotServ, *ChanServ, *Global, *HostServ, *MemoServ, *NickServ, *OperServ;
|
||||
|
||||
#endif // BOTS_H
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef BOTSERV_H
|
||||
#define BOTSERV_H
|
||||
|
||||
#include "anope.h"
|
||||
|
||||
/* BotServ SET flags */
|
||||
enum BotServFlag
|
||||
{
|
||||
BS_BEGIN,
|
||||
/* BotServ won't kick ops */
|
||||
BS_DONTKICKOPS,
|
||||
/* BotServ won't kick voices */
|
||||
BS_DONTKICKVOICES,
|
||||
/* BotServ bot accepts fantasy commands */
|
||||
BS_FANTASY,
|
||||
/* BotServ should show greets */
|
||||
BS_GREET,
|
||||
/* BotServ bots are not allowed to be in this channel */
|
||||
BS_NOBOT,
|
||||
/* BotServ kicks for bolds */
|
||||
BS_KICK_BOLDS,
|
||||
/* BotServ kicks for colors */
|
||||
BS_KICK_COLORS,
|
||||
/* BOtServ kicks for reverses */
|
||||
BS_KICK_REVERSES,
|
||||
/* BotServ kicks for underlines */
|
||||
BS_KICK_UNDERLINES,
|
||||
/* BotServ kicks for badwords */
|
||||
BS_KICK_BADWORDS,
|
||||
/* BotServ kicks for caps */
|
||||
BS_KICK_CAPS,
|
||||
/* BotServ kicks for flood */
|
||||
BS_KICK_FLOOD,
|
||||
/* BotServ kicks for repeating */
|
||||
BS_KICK_REPEAT,
|
||||
/* BotServ kicks for italics */
|
||||
BS_KICK_ITALICS,
|
||||
/* BotServ kicks for amsgs */
|
||||
BS_KICK_AMSGS,
|
||||
BS_END
|
||||
};
|
||||
|
||||
const Anope::string BotServFlagStrings[] = {
|
||||
"BEGIN", "DONTKICKOPS", "DONTKICKVOICES", "FANTASY", "GREET", "NOBOT",
|
||||
"KICK_BOLDs", "KICK_COLORS", "KICK_REVERSES", "KICK_UNDERLINES", "KICK_BADWORDS", "KICK_CAPS",
|
||||
"KICK_FLOOD", "KICK_REPEAT", "KICK_ITALICS", "KICK_AMSGS", "MSG_PRIVMSG", "MSG_NOTICE",
|
||||
"MSG_NOTICEOPS", ""
|
||||
};
|
||||
|
||||
/* Indices for TTB (Times To Ban) */
|
||||
enum
|
||||
{
|
||||
TTB_BOLDS,
|
||||
TTB_COLORS,
|
||||
TTB_REVERSES,
|
||||
TTB_UNDERLINES,
|
||||
TTB_BADWORDS,
|
||||
TTB_CAPS,
|
||||
TTB_FLOOD,
|
||||
TTB_REPEAT,
|
||||
TTB_ITALICS,
|
||||
TTB_AMSGS,
|
||||
TTB_SIZE
|
||||
};
|
||||
|
||||
#endif // BOTSERV_H
|
||||
+116
-80
@@ -1,9 +1,10 @@
|
||||
/* Channel support
|
||||
*
|
||||
* (C) 2008-2012 Anope Team
|
||||
* (C) 2008-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CHANNELS_H
|
||||
@@ -14,20 +15,21 @@
|
||||
#include "modes.h"
|
||||
#include "serialize.h"
|
||||
|
||||
typedef Anope::insensitive_map<Channel *> channel_map;
|
||||
typedef Anope::hash_map<Channel *> channel_map;
|
||||
|
||||
extern CoreExport channel_map ChannelList;
|
||||
|
||||
struct UserContainer : public Extensible
|
||||
/* A user container, there is one of these per user per channel. */
|
||||
struct ChanUserContainer : public Extensible
|
||||
{
|
||||
User *user;
|
||||
ChannelStatus *Status;
|
||||
Channel *chan;
|
||||
/* Status the user has in the channel */
|
||||
ChannelStatus status;
|
||||
|
||||
UserContainer(User *u) : user(u) { }
|
||||
virtual ~UserContainer() { }
|
||||
ChanUserContainer(User *u, Channel *c) : user(u), chan(c) { }
|
||||
};
|
||||
|
||||
typedef std::list<UserContainer *> CUserList;
|
||||
|
||||
enum ChannelFlag
|
||||
{
|
||||
/* ChanServ is currently holding the channel */
|
||||
@@ -38,38 +40,39 @@ enum ChannelFlag
|
||||
CH_SYNCING
|
||||
};
|
||||
|
||||
const Anope::string ChannelFlagString[] = { "CH_INABIT", "CH_PERSIST", "CH_SYNCING", "" };
|
||||
|
||||
class CoreExport Channel : public virtual Base, public Extensible, public Flags<ChannelFlag, 3>
|
||||
class CoreExport Channel : public Base, public Extensible
|
||||
{
|
||||
public:
|
||||
typedef std::multimap<ChannelModeName, Anope::string> ModeList;
|
||||
typedef std::multimap<Anope::string, Anope::string> ModeList;
|
||||
private:
|
||||
/** A map of channel modes with their parameters set on this channel
|
||||
*/
|
||||
ModeList modes;
|
||||
|
||||
public:
|
||||
/** Default constructor
|
||||
* @param name The channel name
|
||||
* @param ts The time the channel was created
|
||||
/* Channel name */
|
||||
Anope::string name;
|
||||
/* Set if this channel is registered. ci->c == this. Contains information relevant to the registered channel */
|
||||
Serialize::Reference<ChannelInfo> ci;
|
||||
/* When the channel was created */
|
||||
time_t creation_time;
|
||||
std::set<ChannelFlag> flags;
|
||||
|
||||
/* Users in the channel */
|
||||
typedef std::list<ChanUserContainer *> ChanUserList;
|
||||
ChanUserList users;
|
||||
|
||||
/* Current topic of the channel */
|
||||
Anope::string topic;
|
||||
/* Who set the topic */
|
||||
Anope::string topic_setter;
|
||||
/* The timestamp associated with the topic. Not necessarually anywhere close to Anope::CurTime.
|
||||
* This is the time the topic was *originally set*. When we restore the topic we want to change the TS back
|
||||
* to this, but we can only do this on certain IRCds.
|
||||
*/
|
||||
Channel(const Anope::string &nname, time_t ts = Anope::CurTime);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
~Channel();
|
||||
|
||||
Anope::string name; /* Channel name */
|
||||
serialize_obj<ChannelInfo> ci; /* Corresponding ChannelInfo */
|
||||
time_t creation_time; /* When channel was created */
|
||||
|
||||
/* List of users in the channel */
|
||||
CUserList users;
|
||||
|
||||
Anope::string topic; /* Current topic of the channel */
|
||||
Anope::string topic_setter; /* Who set the topic */
|
||||
time_t topic_time; /* When the topic was set*/
|
||||
time_t topic_ts;
|
||||
/* The actual time the topic was set, probably close to Anope::CurTime */
|
||||
time_t topic_time;
|
||||
|
||||
time_t server_modetime; /* Time of last server MODE */
|
||||
time_t chanserv_modetime; /* Time of last check_modes() */
|
||||
@@ -77,6 +80,16 @@ class CoreExport Channel : public virtual Base, public Extensible, public Flags<
|
||||
int16_t chanserv_modecount; /* Number of check_mode()'s this sec */
|
||||
int16_t bouncy_modes; /* Did we fail to set modes here? */
|
||||
|
||||
/** Constructor
|
||||
* @param name The channel name
|
||||
* @param ts The time the channel was created
|
||||
*/
|
||||
Channel(const Anope::string &nname, time_t ts = Anope::CurTime);
|
||||
|
||||
/** Destructor
|
||||
*/
|
||||
~Channel();
|
||||
|
||||
/** Call if we need to unset all modes and clear all user status (internally).
|
||||
* Only useful if we get a SJOIN with a TS older than what we have here
|
||||
*/
|
||||
@@ -92,8 +105,9 @@ class CoreExport Channel : public virtual Base, public Extensible, public Flags<
|
||||
|
||||
/** Join a user internally to the channel
|
||||
* @param u The user
|
||||
* @return The UserContainer for the user
|
||||
*/
|
||||
void JoinUser(User *u);
|
||||
ChanUserContainer* JoinUser(User *u);
|
||||
|
||||
/** Remove a user internally from the channel
|
||||
* @param u The user
|
||||
@@ -104,7 +118,7 @@ class CoreExport Channel : public virtual Base, public Extensible, public Flags<
|
||||
* @param u The user
|
||||
* @return A user container if found, else NULL
|
||||
*/
|
||||
UserContainer *FindUser(const User *u) const;
|
||||
ChanUserContainer *FindUser(const User *u) const;
|
||||
|
||||
/** Check if a user has a status on a channel
|
||||
* @param u The user
|
||||
@@ -116,101 +130,102 @@ class CoreExport Channel : public virtual Base, public Extensible, public Flags<
|
||||
/** Check if a user has a status on a channel
|
||||
* Use the overloaded function for ChannelModeStatus* to check for no status
|
||||
* @param u The user
|
||||
* @param Name The Mode name, eg CMODE_OP, CMODE_VOICE
|
||||
* @param name The mode name, eg CMODE_OP, CMODE_VOICE
|
||||
* @return true or false
|
||||
*/
|
||||
bool HasUserStatus(const User *u, ChannelModeName Name) const;
|
||||
bool HasUserStatus(const User *u, const Anope::string &name) const;
|
||||
|
||||
/** See if a channel has a mode
|
||||
* @param Name The mode name
|
||||
* @param name The mode name
|
||||
* @return The number of modes set
|
||||
* @param param The optional mode param
|
||||
*/
|
||||
size_t HasMode(ChannelModeName Name, const Anope::string ¶m = "");
|
||||
|
||||
/** Get a list of modes on a channel
|
||||
* @param Name A mode name to get the list of
|
||||
* @return a pair of iterators for the beginning and end of the list
|
||||
*/
|
||||
std::pair<ModeList::iterator, ModeList::iterator> GetModeList(ChannelModeName Name);
|
||||
size_t HasMode(const Anope::string &name, const Anope::string ¶m = "");
|
||||
|
||||
/** Set a mode internally on a channel, this is not sent out to the IRCd
|
||||
* @param setter The setter
|
||||
* @param cm The mode
|
||||
* @param param The param
|
||||
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
|
||||
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
|
||||
*/
|
||||
void SetModeInternal(User *setter, ChannelMode *cm, const Anope::string ¶m = "", bool EnforceMLock = true);
|
||||
void SetModeInternal(MessageSource &source, ChannelMode *cm, const Anope::string ¶m = "", bool enforce_mlock = true);
|
||||
|
||||
/** Remove a mode internally on a channel, this is not sent out to the IRCd
|
||||
* @param setter The Setter
|
||||
* @param cm The mode
|
||||
* @param param The param
|
||||
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
|
||||
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
|
||||
*/
|
||||
void RemoveModeInternal(User *setter, ChannelMode *cm, const Anope::string ¶m = "", bool EnforceMLock = true);
|
||||
void RemoveModeInternal(MessageSource &source, ChannelMode *cm, const Anope::string ¶m = "", bool enforce_mlock = true);
|
||||
|
||||
/** Set a mode on a channel
|
||||
* @param bi The client setting the modes
|
||||
* @param cm The mode
|
||||
* @param param Optional param arg for the mode
|
||||
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
|
||||
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
|
||||
*/
|
||||
void SetMode(BotInfo *bi, ChannelMode *cm, const Anope::string ¶m = "", bool EnforceMLock = true);
|
||||
void SetMode(BotInfo *bi, ChannelMode *cm, const Anope::string ¶m = "", bool enforce_mlock = true);
|
||||
|
||||
/**
|
||||
* Set a mode on a channel
|
||||
* @param bi The client setting the modes
|
||||
* @param Name The mode name
|
||||
* @param name The mode name
|
||||
* @param param Optional param arg for the mode
|
||||
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
|
||||
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
|
||||
*/
|
||||
void SetMode(BotInfo *bi, ChannelModeName Name, const Anope::string ¶m = "", bool EnforceMLock = true);
|
||||
void SetMode(BotInfo *bi, const Anope::string &name, const Anope::string ¶m = "", bool enforce_mlock = true);
|
||||
|
||||
/** Remove a mode from a channel
|
||||
* @param bi The client setting the modes
|
||||
* @param cm The mode
|
||||
* @param param Optional param arg for the mode
|
||||
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
|
||||
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
|
||||
*/
|
||||
void RemoveMode(BotInfo *bi, ChannelMode *cm, const Anope::string ¶m = "", bool EnforceMLock = true);
|
||||
void RemoveMode(BotInfo *bi, ChannelMode *cm, const Anope::string ¶m = "", bool enforce_mlock = true);
|
||||
|
||||
/**
|
||||
* Remove a mode from a channel
|
||||
* @param bi The client setting the modes
|
||||
* @param Name The mode name
|
||||
* @param name The mode name
|
||||
* @param param Optional param arg for the mode
|
||||
* @param EnforceMLock true if mlocks should be enforced, false to override mlock
|
||||
* @param enforce_mlock true if mlocks should be enforced, false to override mlock
|
||||
*/
|
||||
void RemoveMode(BotInfo *bi, ChannelModeName Name, const Anope::string ¶m = "", bool EnforceMLock = true);
|
||||
void RemoveMode(BotInfo *bi, const Anope::string &name, const Anope::string ¶m = "", bool enforce_mlock = true);
|
||||
|
||||
/** Get a param from the channel
|
||||
* @param Name The mode
|
||||
* @param Target a string to put the param into
|
||||
* @return true on success
|
||||
/** Get a modes parameter for the channel
|
||||
* @param name The mode
|
||||
* @param target a string to put the param into
|
||||
* @return true if the parameter was fetched, false if on error (mode not set) etc.
|
||||
*/
|
||||
bool GetParam(ChannelModeName Name, Anope::string &Target) const;
|
||||
bool GetParam(const Anope::string &name, Anope::string &target) const;
|
||||
|
||||
/** Set a string of modes on the channel
|
||||
* @param bi The client setting the modes
|
||||
* @param EnforceMLock Should mlock be enforced on this mode change
|
||||
* @param enforce_mlock Should mlock be enforced on this mode change
|
||||
* @param cmodes The modes to set
|
||||
*/
|
||||
void SetModes(BotInfo *bi, bool EnforceMLock, const char *cmodes, ...);
|
||||
void SetModes(BotInfo *bi, bool enforce_mlock, const char *cmodes, ...);
|
||||
|
||||
/** Set a string of modes internally on a channel
|
||||
* @param setter the setter (if it is a user)
|
||||
* @param source The setter
|
||||
* @param mode the modes
|
||||
* @param EnforceMLock true to enforce mlock
|
||||
* @param enforce_mlock true to enforce mlock
|
||||
*/
|
||||
void SetModesInternal(User *setter, const Anope::string &mode, bool EnforceMLock = true);
|
||||
void SetModesInternal(MessageSource &source, const Anope::string &mode, time_t ts = 0, bool enforce_mlock = true);
|
||||
|
||||
/** Does the given user match the given list? (CMODE_BAN, CMODE_EXCEPT, etc, a list mode)
|
||||
* @param u The user
|
||||
* @param list The mode of the list to check (eg CMODE_BAN)
|
||||
* @return true if the user matches the list
|
||||
*/
|
||||
bool MatchesList(User *u, const Anope::string &list);
|
||||
|
||||
/** Kick a user from a channel internally
|
||||
* @param source The sender of the kick
|
||||
* @param nick The nick being kicked
|
||||
* @param reason The reason for the kick
|
||||
*/
|
||||
void KickInternal(const Anope::string &source, const Anope::string &nick, const Anope::string &reason);
|
||||
void KickInternal(MessageSource &source, const Anope::string &nick, const Anope::string &reason);
|
||||
|
||||
/** Kick a user from the channel
|
||||
* @param bi The sender, can be NULL for the service bot for this channel
|
||||
@@ -220,6 +235,17 @@ class CoreExport Channel : public virtual Base, public Extensible, public Flags<
|
||||
*/
|
||||
bool Kick(BotInfo *bi, User *u, const char *reason = NULL, ...);
|
||||
|
||||
/** Get all modes set on this channel, excluding status modes.
|
||||
* @return a map of modes and their optional parameters.
|
||||
*/
|
||||
const ModeList &GetModes() const;
|
||||
|
||||
/** Get a list of modes on a channel
|
||||
* @param name A mode name to get the list of
|
||||
* @return a pair of iterators for the beginning and end of the list
|
||||
*/
|
||||
std::pair<ModeList::iterator, ModeList::iterator> GetModeList(const Anope::string &name);
|
||||
|
||||
/** Get a string of the modes set on this channel
|
||||
* @param complete Include mode parameters
|
||||
* @param plus If set to false (with complete), mode parameters will not be given for modes requring no parameters to be unset
|
||||
@@ -228,7 +254,7 @@ class CoreExport Channel : public virtual Base, public Extensible, public Flags<
|
||||
Anope::string GetModes(bool complete, bool plus);
|
||||
|
||||
/** Update the topic of the channel internally, and reset it if topiclock etc says to
|
||||
* @param user THe user setting the new topic
|
||||
* @param user The user setting the new topic
|
||||
* @param newtopic The new topic
|
||||
* @param ts The time the new topic is being set
|
||||
*/
|
||||
@@ -244,17 +270,27 @@ class CoreExport Channel : public virtual Base, public Extensible, public Flags<
|
||||
/** Hold the channel open using ChanServ
|
||||
*/
|
||||
void Hold();
|
||||
|
||||
/** Set the correct modes, or remove the ones granted without permission,
|
||||
* for the specified user.
|
||||
* @param user The user to give/remove modes to/from
|
||||
* @param give_modes if true modes may be given to the user
|
||||
* @param check_noop if true, CI_NOAUTOOP is checked before giving modes
|
||||
*/
|
||||
void SetCorrectModes(User *u, bool give_mode, bool check_noop);
|
||||
|
||||
/** Unbans a user from this channel.
|
||||
* @param u The user to unban
|
||||
* @param full Whether or not to match using the user's real host and IP
|
||||
* @return whether or not a ban was removed
|
||||
*/
|
||||
bool Unban(const User *u, bool full = false);
|
||||
|
||||
/** Finds a channel
|
||||
* @param name The channel to find
|
||||
* @return The channel, if found
|
||||
*/
|
||||
static Channel* Find(const Anope::string &name);
|
||||
};
|
||||
|
||||
extern CoreExport Channel *findchan(const Anope::string &chan);
|
||||
|
||||
extern CoreExport User *nc_on_chan(Channel *c, const NickCore *nc);
|
||||
|
||||
extern CoreExport void do_cmode(const Anope::string &source, const Anope::string &channel, const Anope::string &modes, const Anope::string &ts);
|
||||
extern CoreExport void do_join(const Anope::string &source, const Anope::string &channels, const Anope::string &ts);
|
||||
extern CoreExport void do_kick(const Anope::string &source, const Anope::string &channel, const Anope::string &users, const Anope::string &reason);
|
||||
extern CoreExport void do_part(const Anope::string &source, const Anope::string &channels, const Anope::string &reason);
|
||||
|
||||
extern CoreExport void chan_set_correct_modes(const User *user, Channel *c, int give_modes);
|
||||
|
||||
#endif // CHANNELS_H
|
||||
|
||||
+48
-25
@@ -1,6 +1,6 @@
|
||||
/* Declarations for command data.
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -14,27 +14,38 @@
|
||||
|
||||
#include "service.h"
|
||||
#include "anope.h"
|
||||
#include "channels.h"
|
||||
|
||||
enum CommandFlag
|
||||
struct CommandGroup
|
||||
{
|
||||
CFLAG_ALLOW_UNREGISTERED,
|
||||
CFLAG_STRIP_CHANNEL
|
||||
};
|
||||
|
||||
const Anope::string CommandFlagStrings[] = {
|
||||
"CFLAG_ALLOW_UNREGISTERED",
|
||||
"CFLAG_STRIP_CHANNEL",
|
||||
""
|
||||
Anope::string name, description;
|
||||
};
|
||||
|
||||
/* Used in BotInfo::commands */
|
||||
struct CommandInfo
|
||||
{
|
||||
typedef Anope::map<CommandInfo> map;
|
||||
|
||||
CommandInfo() : hide(false), prepend_channel(false) { }
|
||||
|
||||
/* Service name of the command */
|
||||
Anope::string name;
|
||||
/* Permission required to execute the command */
|
||||
Anope::string permission;
|
||||
/* Group this command is in */
|
||||
Anope::string group;
|
||||
/* whether or not to hide this command in help output */
|
||||
bool hide;
|
||||
/* Only used with fantasy */
|
||||
bool prepend_channel;
|
||||
};
|
||||
|
||||
struct CommandReply
|
||||
/* Where the replies from commands go to. User inheits from this and is the normal
|
||||
* source of a CommandReply
|
||||
*/
|
||||
struct CoreExport CommandReply
|
||||
{
|
||||
virtual ~CommandReply() { }
|
||||
virtual void SendMessage(const BotInfo *source, const Anope::string &msg) = 0;
|
||||
};
|
||||
|
||||
@@ -47,52 +58,56 @@ class CoreExport CommandSource
|
||||
User *u;
|
||||
public:
|
||||
/* The account executing the command */
|
||||
NickCore *nc;
|
||||
Reference<NickCore> nc;
|
||||
/* Where the reply should go */
|
||||
CommandReply *reply;
|
||||
/* Channel the command was executed on (fantasy) */
|
||||
Channel *c;
|
||||
Reference<Channel> c;
|
||||
/* The service this command is on */
|
||||
BotInfo *owner;
|
||||
/* The service the reply should come from, *not* necessarily the service the command is on */
|
||||
BotInfo *service;
|
||||
Reference<BotInfo> service;
|
||||
/* The actual name of the command being executed */
|
||||
Anope::string command;
|
||||
/* The permission of the command being executed */
|
||||
Anope::string permission;
|
||||
|
||||
CommandSource(const Anope::string &n, User *user, NickCore *core, CommandReply *reply);
|
||||
CommandSource(const Anope::string &n, User *user, NickCore *core, CommandReply *reply, BotInfo *bi);
|
||||
|
||||
const Anope::string &GetNick() const;
|
||||
User *GetUser() const;
|
||||
AccessGroup AccessFor(ChannelInfo *ci) const;
|
||||
bool IsFounder(ChannelInfo *ci) const;
|
||||
User *GetUser();
|
||||
NickCore *GetAccount();
|
||||
AccessGroup AccessFor(ChannelInfo *ci);
|
||||
bool IsFounder(ChannelInfo *ci);
|
||||
|
||||
void Reply(const char *message, ...);
|
||||
void Reply(const Anope::string &message);
|
||||
|
||||
bool HasCommand(const Anope::string &cmd);
|
||||
bool HasPriv(const Anope::string &cmd);
|
||||
bool IsServicesOper() const;
|
||||
bool IsOper() const;
|
||||
bool IsServicesOper();
|
||||
bool IsOper();
|
||||
};
|
||||
|
||||
/** Every services command is a class, inheriting from Command.
|
||||
*/
|
||||
class CoreExport Command : public Service, public Flags<CommandFlag>
|
||||
class CoreExport Command : public Service
|
||||
{
|
||||
Anope::string desc;
|
||||
std::vector<Anope::string> syntax;
|
||||
/* Allow unregistered users to use this command */
|
||||
bool allow_unregistered;
|
||||
/* Command requires that a user is executing it */
|
||||
bool require_user;
|
||||
|
||||
public:
|
||||
/* Maximum paramaters accepted by this command */
|
||||
size_t MaxParams;
|
||||
size_t max_params;
|
||||
/* Minimum parameters required to use this command */
|
||||
size_t MinParams;
|
||||
size_t min_params;
|
||||
|
||||
/* Module which owns us */
|
||||
Module *module;
|
||||
|
||||
protected:
|
||||
/** Create a new command.
|
||||
* @param owner The owner of the command
|
||||
* @param sname The command name
|
||||
@@ -102,6 +117,7 @@ class CoreExport Command : public Service, public Flags<CommandFlag>
|
||||
*/
|
||||
Command(Module *owner, const Anope::string &sname, size_t min_params, size_t max_params = 0);
|
||||
|
||||
public:
|
||||
virtual ~Command();
|
||||
|
||||
protected:
|
||||
@@ -111,7 +127,14 @@ class CoreExport Command : public Service, public Flags<CommandFlag>
|
||||
void SetSyntax(const Anope::string &s);
|
||||
void SendSyntax(CommandSource &);
|
||||
void SendSyntax(CommandSource &, const Anope::string &syntax);
|
||||
|
||||
void AllowUnregistered(bool b);
|
||||
void RequireUser(bool b);
|
||||
|
||||
public:
|
||||
bool AllowUnregistered() const;
|
||||
bool RequireUser() const;
|
||||
|
||||
/** Get the command description
|
||||
* @return The commands description
|
||||
*/
|
||||
|
||||
+35
-32
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -8,7 +8,6 @@
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
@@ -207,23 +206,6 @@ typedef bool (*MultiValidator)(ServerConfig *, const Anope::string &, const Anop
|
||||
*/
|
||||
typedef bool (*MultiNotify)(ServerConfig *, const Anope::string &);
|
||||
|
||||
bool ValidateNotEmpty(ServerConfig *, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateNotZero(ServerConfig *, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateEmailReg(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidatePort(ServerConfig *, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateGuestPrefix(ServerConfig *conf, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateBantype(ServerConfig *, const Anope::string &, const Anope::string &, ValueItem &data);
|
||||
bool ValidateChanServ(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateMemoServ(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateBotServ(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateHostServ(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateLimitSessions(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateOperServ(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateGlobal(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateNickLen(ServerConfig *, const Anope::string &, const Anope::string &, ValueItem &data);
|
||||
bool ValidateMail(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
bool ValidateGlobalOnCycle(ServerConfig *config, const Anope::string &tag, const Anope::string &value, ValueItem &data);
|
||||
|
||||
/** Represents a configuration file
|
||||
*/
|
||||
class ConfigurationFile
|
||||
@@ -391,6 +373,12 @@ class CoreExport ServerConfig
|
||||
unsigned UserLen;
|
||||
/* Max lenght of hostnames */
|
||||
unsigned HostLen;
|
||||
/* Max length of channel names */
|
||||
unsigned ChanLen;
|
||||
|
||||
/* User and group to run as */
|
||||
Anope::string User;
|
||||
Anope::string Group;
|
||||
|
||||
/* Casemapping to use */
|
||||
Anope::string CaseMap;
|
||||
@@ -453,10 +441,12 @@ class CoreExport ServerConfig
|
||||
Anope::string CSRequire;
|
||||
/* Use server side mlock */
|
||||
bool UseServerSideMLock;
|
||||
/* Use server side topic lock */
|
||||
bool UseServerSideTopicLock;
|
||||
/* The max length for reasons (cs_kick, cs_ban, etc) */
|
||||
unsigned CSReasonMax;
|
||||
/* Default botmodes on channels, defaults to ao */
|
||||
Anope::string BotModes;
|
||||
/* THe actual modes */
|
||||
ChannelStatus BotModeList;
|
||||
/* How long to wait between connection attempts */
|
||||
int RetryWait;
|
||||
/* If services should hide unprivileged commands */
|
||||
@@ -484,15 +474,9 @@ class CoreExport ServerConfig
|
||||
/* Mail messages to send */
|
||||
Anope::string MailRegistrationSubject, MailRegistrationMessage;
|
||||
Anope::string MailResetSubject, MailResetMessage;
|
||||
Anope::string MailSendpassSubject, MailSendpassMessage;
|
||||
Anope::string MailEmailchangeSubject, MailEmailchangeMessage;
|
||||
Anope::string MailMemoSubject, MailMemoMessage;
|
||||
|
||||
/* Nameserver to use for resolving hostnames */
|
||||
Anope::string NameServer;
|
||||
/* TIme before a DNS query is considered dead */
|
||||
time_t DNSTimeout;
|
||||
|
||||
/* Prefix of guest nicks when a user gets forced off of a nick */
|
||||
Anope::string NSGuestNickPrefix;
|
||||
/* Allow users to set kill immed on */
|
||||
@@ -500,7 +484,7 @@ class CoreExport ServerConfig
|
||||
/* Don't allow nicks to use /ns group to regroup nicks */
|
||||
bool NSNoGroupChange;
|
||||
/* Default flags for newly registered nicks */
|
||||
Flags<NickCoreFlag, NI_END> NSDefFlags;
|
||||
std::set<Anope::string> NSDefFlags;
|
||||
/* All languages Anope is aware about */
|
||||
Anope::string Languages;
|
||||
/* Default language used by services */
|
||||
@@ -548,11 +532,22 @@ class CoreExport ServerConfig
|
||||
bool NSAddAccessOnReg;
|
||||
/* Maximum number of channels on AJoin */
|
||||
unsigned AJoinMax;
|
||||
/* Kill & killquick delays before force changing off users */
|
||||
time_t NSKillQuick;
|
||||
time_t NSKill;
|
||||
/* Modes set on a user when they identify */
|
||||
Anope::string NSModesOnID;
|
||||
/* Restore nick/channels on recover */
|
||||
bool NSRestoreOnRecover;
|
||||
/* Whether or not to use SASL */
|
||||
bool NSSASL;
|
||||
/* If set, hides netsplits in the last_quit field of nicks */
|
||||
bool NSHideNetSplitQuit;
|
||||
|
||||
/* Core ChanServ modules */
|
||||
Anope::string ChanCoreModules;
|
||||
/* Default flags for newly registered channels */
|
||||
Flags<ChannelInfoFlag, CI_END> CSDefFlags;
|
||||
std::set<Anope::string> CSDefFlags;
|
||||
/* Max number of channels a user can own */
|
||||
unsigned CSMaxReg;
|
||||
/* Time before a channel expires */
|
||||
@@ -595,7 +590,7 @@ class CoreExport ServerConfig
|
||||
/* Core BotServ modules */
|
||||
Anope::string BotCoreModules;
|
||||
/* Default BotServ flags */
|
||||
Flags<BotServFlag> BSDefFlags;
|
||||
std::set<Anope::string> BSDefFlags;
|
||||
/* How long before botserv forgets a user. This is used for flood kickers etc */
|
||||
time_t BSKeepData;
|
||||
/* Min number of users to have in the channel before the service bot joins */
|
||||
@@ -656,6 +651,9 @@ class CoreExport ServerConfig
|
||||
unsigned MaxSessionLimit;
|
||||
/* How long session akills should last */
|
||||
time_t SessionAutoKillExpiry;
|
||||
/* Number of bits to use when comparing session IPs */
|
||||
unsigned SessionIPv4CIDR;
|
||||
unsigned SessionIPv6CIDR;
|
||||
/* Reason to use for session kills */
|
||||
Anope::string SessionLimitExceeded;
|
||||
/* Optional second reason */
|
||||
@@ -678,6 +676,11 @@ class CoreExport ServerConfig
|
||||
std::list<OperType *> MyOperTypes;
|
||||
/* List of pairs of opers and their opertype from the config */
|
||||
std::vector<Oper *> Opers;
|
||||
|
||||
/* Map of fantasy commands */
|
||||
CommandInfo::map Fantasy;
|
||||
|
||||
std::vector<CommandGroup> CommandGroups;
|
||||
};
|
||||
|
||||
/** This class can be used on its own to represent an exception, or derived to represent a module-specific exception.
|
||||
@@ -709,7 +712,7 @@ class ConfigException : public CoreException
|
||||
#define CONF_FILE_NOT_FOUND 0x000200
|
||||
|
||||
/** Allows reading of values from configuration files
|
||||
* This class allows a module to read from either the main configuration file (inspircd.conf) or from
|
||||
* This class allows a module to read from either the main configuration file (services.conf) or from
|
||||
* a module-specified configuration file. It may either be instantiated with one parameter or none.
|
||||
* Constructing the class using one parameter allows you to specify a path to your own configuration
|
||||
* file, otherwise, inspircd.conf is read.
|
||||
@@ -804,7 +807,7 @@ class CoreExport ConfigReader
|
||||
int EnumerateValues(const Anope::string &, int);
|
||||
};
|
||||
|
||||
extern ConfigurationFile services_conf;
|
||||
extern ConfigurationFile ServicesConf;
|
||||
extern CoreExport ServerConfig *Config;
|
||||
|
||||
#endif // CONFIG_H
|
||||
|
||||
+7
-5
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
class AccessGroup;
|
||||
class AutoKick;
|
||||
namespace Anope { class String; }
|
||||
class BotInfo;
|
||||
class CallBack;
|
||||
class ChanAccess;
|
||||
@@ -23,19 +24,21 @@ class ClientSocket;
|
||||
class Command;
|
||||
class CommandSource;
|
||||
class ConnectionSocket;
|
||||
class DNSPacket;
|
||||
class dynamic_reference_base;
|
||||
namespace DNS { class Packet; }
|
||||
class Entry;
|
||||
class IdentifyRequest;
|
||||
class InfoFormatter;
|
||||
class IRCDProto;
|
||||
class ListenSocket;
|
||||
class Log;
|
||||
class LogInfo;
|
||||
class Memo;
|
||||
class Message;
|
||||
class MessageSource;
|
||||
class Module;
|
||||
class NickAlias;
|
||||
class NickCore;
|
||||
class OperType;
|
||||
class ReferenceBase;
|
||||
class Regex;
|
||||
class Serializable;
|
||||
class Server;
|
||||
@@ -46,7 +49,6 @@ class User;
|
||||
class XLine;
|
||||
class XLineManager;
|
||||
struct BadWord;
|
||||
struct DNSQuery;
|
||||
struct Exception;
|
||||
struct MemoInfo;
|
||||
struct ModeLock;
|
||||
|
||||
-203
@@ -1,203 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DNS_H
|
||||
#define DNS_H
|
||||
|
||||
#include "sockets.h"
|
||||
#include "timers.h"
|
||||
#include "extern.h"
|
||||
#include "config.h"
|
||||
|
||||
/** Valid query types
|
||||
*/
|
||||
enum QueryType
|
||||
{
|
||||
/* Nothing */
|
||||
DNS_QUERY_NONE,
|
||||
/* A simple A lookup */
|
||||
DNS_QUERY_A = 1,
|
||||
/* A CNAME lookup */
|
||||
DNS_QUERY_CNAME = 5,
|
||||
/* Reverse DNS lookup */
|
||||
DNS_QUERY_PTR = 12,
|
||||
/* IPv6 AAAA lookup */
|
||||
DNS_QUERY_AAAA = 28
|
||||
};
|
||||
|
||||
/** Flags that can be AND'd into DNSPacket::flags to receive certain values
|
||||
*/
|
||||
enum
|
||||
{
|
||||
DNS_QUERYFLAGS_QR = 0x8000,
|
||||
DNS_QUERYFLAGS_OPCODE = 0x7800,
|
||||
DNS_QUERYFLAGS_AA = 0x400,
|
||||
DBS_QUERYFLAGS_TC = 0x200,
|
||||
DNS_QUERYFLAGS_RD = 0x100,
|
||||
DNS_QUERYFLAGS_RA = 0x80,
|
||||
DNS_QUERYFLAGS_Z = 0x70,
|
||||
DNS_QUERYFLAGS_RCODE = 0xF
|
||||
};
|
||||
|
||||
enum DNSError
|
||||
{
|
||||
DNS_ERROR_NONE,
|
||||
DNS_ERROR_UNKNOWN,
|
||||
DNS_ERROR_UNLOADED,
|
||||
DNS_ERROR_TIMEOUT,
|
||||
DNS_ERROR_NOT_AN_ANSWER,
|
||||
DNS_ERROR_NONSTANDARD_QUERY,
|
||||
DNS_ERROR_FORMAT_ERROR,
|
||||
DNS_ERROR_SERVER_FAILURE,
|
||||
DNS_ERROR_DOMAIN_NOT_FOUND,
|
||||
DNS_ERROR_NOT_IMPLEMENTED,
|
||||
DNS_ERROR_REFUSED,
|
||||
DNS_ERROR_NO_RECORDS,
|
||||
DNS_ERROR_INVALIDTYPE
|
||||
};
|
||||
|
||||
|
||||
struct CoreExport Question
|
||||
{
|
||||
Anope::string name;
|
||||
QueryType type;
|
||||
unsigned short qclass;
|
||||
|
||||
Question();
|
||||
Question(const Anope::string &, QueryType, unsigned short = 1);
|
||||
};
|
||||
|
||||
struct CoreExport ResourceRecord : public Question
|
||||
{
|
||||
unsigned int ttl;
|
||||
Anope::string rdata;
|
||||
time_t created;
|
||||
|
||||
ResourceRecord(const Anope::string &, QueryType, unsigned short = 1);
|
||||
ResourceRecord(const Question &);
|
||||
};
|
||||
|
||||
struct CoreExport DNSQuery
|
||||
{
|
||||
std::vector<Question> questions;
|
||||
std::vector<ResourceRecord> answers, authorities, additional;
|
||||
DNSError error;
|
||||
|
||||
DNSQuery();
|
||||
DNSQuery(const Question &q);
|
||||
DNSQuery(const DNSPacket &p);
|
||||
};
|
||||
|
||||
/** The request
|
||||
*/
|
||||
class CoreExport DNSRequest : public Timer, public Question
|
||||
{
|
||||
/* Use result cache if available */
|
||||
bool use_cache;
|
||||
|
||||
public:
|
||||
/* Request id */
|
||||
unsigned short id;
|
||||
/* Creator of this request */
|
||||
Module *creator;
|
||||
|
||||
DNSRequest(const Anope::string &addr, QueryType qt, bool cache = false, Module *c = NULL);
|
||||
|
||||
virtual ~DNSRequest();
|
||||
|
||||
void Process();
|
||||
|
||||
virtual void OnLookupComplete(const DNSQuery *r) = 0;
|
||||
|
||||
virtual void OnError(const DNSQuery *r);
|
||||
|
||||
void Tick(time_t) anope_override;
|
||||
};
|
||||
|
||||
/** A full packet sent or recieved to/from the nameserver, may contain multiple queries
|
||||
*/
|
||||
class DNSPacket : public DNSQuery
|
||||
{
|
||||
static const int DNS_POINTER = 0xC0;
|
||||
static const int DNS_LABEL = 0x3F;
|
||||
|
||||
void PackName(unsigned char *output, unsigned short output_size, unsigned short &pos, const Anope::string &name);
|
||||
Anope::string UnpackName(const unsigned char *input, unsigned short input_size, unsigned short &pos);
|
||||
|
||||
Question UnpackQuestion(const unsigned char *input, unsigned short input_size, unsigned short &pos);
|
||||
ResourceRecord UnpackResourceRecord(const unsigned char *input, unsigned short input_size, unsigned short &poss);
|
||||
public:
|
||||
static const int HEADER_LENGTH = 12;
|
||||
|
||||
/* Our 16-bit id for this header */
|
||||
unsigned short id;
|
||||
/* Flags on the query */
|
||||
unsigned short flags;
|
||||
|
||||
DNSPacket();
|
||||
void Fill(const unsigned char *input, const unsigned short len);
|
||||
unsigned short Pack(unsigned char *output, unsigned short output_size);
|
||||
};
|
||||
|
||||
/** DNS manager, manages all requests
|
||||
*/
|
||||
class CoreExport DNSManager : public Timer, public Socket
|
||||
{
|
||||
typedef std::multimap<Anope::string, ResourceRecord, ci::less> cache_map;
|
||||
cache_map cache;
|
||||
sockaddrs addrs;
|
||||
public:
|
||||
std::deque<DNSPacket *> packets;
|
||||
std::map<unsigned short, DNSRequest *> requests;
|
||||
|
||||
static const int DNSPort = 53;
|
||||
|
||||
DNSManager(const Anope::string &nameserver, int port);
|
||||
|
||||
~DNSManager();
|
||||
|
||||
bool ProcessRead();
|
||||
|
||||
bool ProcessWrite();
|
||||
|
||||
/** Add a record to the dns cache
|
||||
* @param r The record
|
||||
*/
|
||||
void AddCache(DNSQuery &r);
|
||||
|
||||
/** Check the DNS cache to see if request can be handled by a cached result
|
||||
* @return true if a cached result was found.
|
||||
*/
|
||||
bool CheckCache(DNSRequest *request);
|
||||
|
||||
/** Tick this timer, used to clear the DNS cache.
|
||||
*/
|
||||
void Tick(time_t now) anope_override;
|
||||
|
||||
/** Cleanup all pending DNS queries for a module
|
||||
* @param mod The module
|
||||
*/
|
||||
void Cleanup(Module *mod);
|
||||
|
||||
/** Does a BLOCKING DNS query and returns the first IP.
|
||||
* Only use this if you know what you are doing. Unless you specifically
|
||||
* need a blocking query use the DNSRequest system
|
||||
*/
|
||||
static DNSQuery BlockingQuery(const Anope::string &mask, QueryType qt);
|
||||
};
|
||||
|
||||
extern DNSManager *DNSEngine;
|
||||
|
||||
#endif // DNS_H
|
||||
|
||||
|
||||
+48
-53
@@ -1,48 +1,64 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2012 Anope Team <team@anope.org>
|
||||
*
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef EXTENSIBLE_H
|
||||
#define EXTENSIBLE_H
|
||||
|
||||
#include "anope.h"
|
||||
#include "serialize.h"
|
||||
|
||||
/* All items added to Extensible must inherit from this.
|
||||
*/
|
||||
class CoreExport ExtensibleItem
|
||||
{
|
||||
public:
|
||||
ExtensibleItem();
|
||||
virtual ~ExtensibleItem();
|
||||
virtual void OnDelete();
|
||||
virtual ~ExtensibleItem() { }
|
||||
|
||||
virtual const Anope::string *Serialize() { return NULL; }
|
||||
};
|
||||
|
||||
/** Common class used to Extensible::Extend as it inherits from both ExtensibleItem
|
||||
* and whatever basic object you're trying to store.
|
||||
* Eg, obj->Extend(key, new ExtensibleItemClass<Anope::string>(value));
|
||||
*/
|
||||
template<typename T> struct CoreExport ExtensibleItemClass : T, ExtensibleItem
|
||||
{
|
||||
ExtensibleItemClass(const T& t) : T(t) { }
|
||||
};
|
||||
|
||||
/* Used to attach metadata to this object that is automatically saved
|
||||
* when the object is saved (assuming the object's Serialize method
|
||||
* correcly calls Extensible::ExtensibleSerialize).
|
||||
*/
|
||||
struct CoreExport ExtensibleMetadata : ExtensibleItemClass<Anope::string>
|
||||
{
|
||||
ExtensibleMetadata(const Anope::string &t) : ExtensibleItemClass<Anope::string>(t) { }
|
||||
|
||||
const Anope::string *Serialize() anope_override { return this; }
|
||||
};
|
||||
|
||||
/* Used to attach arbitrary objects to this object using unique keys */
|
||||
class CoreExport Extensible
|
||||
{
|
||||
private:
|
||||
typedef Anope::map<ExtensibleItem *> extensible_map;
|
||||
extensible_map extension_items;
|
||||
typedef std::map<Anope::string, ExtensibleItem *> extensible_map;
|
||||
extensible_map *extension_items;
|
||||
|
||||
public:
|
||||
/** Default constructor, does nothing
|
||||
/** Default constructor
|
||||
*/
|
||||
Extensible() { }
|
||||
Extensible();
|
||||
|
||||
/** Default destructor, deletes all of the extensible items in this object
|
||||
/** Destructor, deletes all of the extensible items in this object
|
||||
* then clears the map
|
||||
*/
|
||||
virtual ~Extensible()
|
||||
{
|
||||
for (extensible_map::iterator it = extension_items.begin(), it_end = extension_items.end(); it != it_end; ++it)
|
||||
if (it->second)
|
||||
it->second->OnDelete();
|
||||
extension_items.clear();
|
||||
}
|
||||
virtual ~Extensible();
|
||||
|
||||
/** Extend an Extensible class.
|
||||
*
|
||||
@@ -50,16 +66,11 @@ class CoreExport Extensible
|
||||
* @param p This parameter is a pointer to an ExtensibleItem or ExtensibleItemBase derived class
|
||||
*
|
||||
* You must provide a key to store the data as via the parameter 'key'.
|
||||
* The data will be inserted into the map. If the data already exists, you may not insert it
|
||||
* twice, Extensible::Extend will return false in this case.
|
||||
*
|
||||
* @return Returns true on success, false if otherwise
|
||||
* The data will be inserted into the map. If the data already exists, it will be overwritten.
|
||||
*/
|
||||
void Extend(const Anope::string &key, ExtensibleItem *p)
|
||||
{
|
||||
this->Shrink(key);
|
||||
this->extension_items[key] = p;
|
||||
}
|
||||
void Extend(const Anope::string &key, ExtensibleItem *p = NULL);
|
||||
|
||||
void ExtendMetadata(const Anope::string &key, const Anope::string &value = "");
|
||||
|
||||
/** Shrink an Extensible class.
|
||||
*
|
||||
@@ -69,22 +80,7 @@ class CoreExport Extensible
|
||||
* you provide a nonexistent key (case is important) then the function will return false.
|
||||
* @return Returns true on success.
|
||||
*/
|
||||
bool Shrink(const Anope::string &key)
|
||||
{
|
||||
extensible_map::iterator it = this->extension_items.find(key);
|
||||
if (it != this->extension_items.end())
|
||||
{
|
||||
if (it->second != NULL)
|
||||
it->second->OnDelete();
|
||||
/* map::size_type map::erase( const key_type& key );
|
||||
* returns the number of elements removed, std::map
|
||||
* is single-associative so this should only be 0 or 1
|
||||
*/
|
||||
return this->extension_items.erase(key) > 0;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
bool Shrink(const Anope::string &key);
|
||||
|
||||
/** Get an extension item.
|
||||
*
|
||||
@@ -93,9 +89,12 @@ class CoreExport Extensible
|
||||
*/
|
||||
template<typename T> T GetExt(const Anope::string &key) const
|
||||
{
|
||||
extensible_map::const_iterator it = this->extension_items.find(key);
|
||||
if (it != this->extension_items.end())
|
||||
return anope_dynamic_reinterpret_cast<T>(it->second);
|
||||
if (this->extension_items)
|
||||
{
|
||||
extensible_map::const_iterator it = this->extension_items->find(key);
|
||||
if (it != this->extension_items->end())
|
||||
return anope_dynamic_static_cast<T>(it->second);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -105,21 +104,17 @@ class CoreExport Extensible
|
||||
* @param key The key parameter is an arbitary string which identifies the extension data
|
||||
* @return True if the item was found.
|
||||
*/
|
||||
bool HasExt(const Anope::string &key) const
|
||||
{
|
||||
return this->extension_items.count(key) > 0;
|
||||
}
|
||||
bool HasExt(const Anope::string &key) const;
|
||||
|
||||
/** Get a list of all extension items names.
|
||||
* @param list A deque of strings to receive the list
|
||||
* @return This function writes a list of all extension items stored
|
||||
* in this object by name into the given deque and returns void.
|
||||
*/
|
||||
void GetExtList(std::deque<Anope::string> &list) const
|
||||
{
|
||||
for (extensible_map::const_iterator it = extension_items.begin(), it_end = extension_items.end(); it != it_end; ++it)
|
||||
list.push_back(it->first);
|
||||
}
|
||||
void GetExtList(std::deque<Anope::string> &list) const;
|
||||
|
||||
void ExtensibleSerialize(Serialize::Data &data) const;
|
||||
void ExtensibleUnserialize(Serialize::Data &data);
|
||||
};
|
||||
|
||||
#endif // EXTENSIBLE_H
|
||||
|
||||
@@ -1,136 +0,0 @@
|
||||
/* Prototypes and external variable declarations.
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
#ifndef EXTERN_H
|
||||
#define EXTERN_H
|
||||
|
||||
#include "modes.h"
|
||||
|
||||
#define E extern CoreExport
|
||||
#define EI extern DllExport
|
||||
|
||||
|
||||
/**** actions.c ****/
|
||||
|
||||
E bool bad_password(User *u);
|
||||
E void common_unban(const ChannelInfo *ci, User *u, bool full = false);
|
||||
|
||||
/**** encrypt.c ****/
|
||||
|
||||
E void enc_encrypt(const Anope::string &src, Anope::string &dest);
|
||||
E bool enc_decrypt(const Anope::string &src, Anope::string &dest);
|
||||
|
||||
/**** init.c ****/
|
||||
|
||||
E Anope::string conf_dir, db_dir, modules_dir, locale_dir, log_dir;
|
||||
|
||||
E void introduce_user(const Anope::string &user);
|
||||
E bool GetCommandLineArgument(const Anope::string &name, char shortname = 0);
|
||||
E bool GetCommandLineArgument(const Anope::string &name, char shortname, Anope::string ¶m);
|
||||
E bool AtTerm();
|
||||
E void Fork();
|
||||
E void Init(int ac, char **av);
|
||||
|
||||
/**** language.cpp ****/
|
||||
|
||||
E std::vector<Anope::string> languages;
|
||||
E std::vector<Anope::string> domains;
|
||||
E void InitLanguages();
|
||||
E const char *translate(const char *string);
|
||||
E const char *translate(User *u, const char *string);
|
||||
E const char *translate(const NickCore *nc, const char *string);
|
||||
E const char *anope_gettext(const char *lang, const char *string);
|
||||
|
||||
/**** main.c ****/
|
||||
|
||||
E Anope::string services_dir;
|
||||
E Anope::string services_bin;
|
||||
E int debug;
|
||||
E bool readonly;
|
||||
E bool nofork;
|
||||
E bool nothird;
|
||||
E bool noexpire;
|
||||
E bool protocoldebug;
|
||||
|
||||
E bool quitting;
|
||||
E int return_code;
|
||||
E bool restarting;
|
||||
E Anope::string quitmsg;
|
||||
E time_t start_time;
|
||||
|
||||
E int CurrentUplink;
|
||||
|
||||
E void save_databases();
|
||||
E void sighandler(int signum);
|
||||
|
||||
/**** messages.cpp ****/
|
||||
|
||||
E void init_core_messages();
|
||||
|
||||
E bool OnStats(const Anope::string &source, const std::vector<Anope::string> &);
|
||||
E bool OnTime(const Anope::string &source, const std::vector<Anope::string> &);
|
||||
E bool OnVersion(const Anope::string &source, const std::vector<Anope::string> &);
|
||||
|
||||
E bool On436(const Anope::string &, const std::vector<Anope::string> &);
|
||||
E bool OnAway(const Anope::string &, const std::vector<Anope::string> &);
|
||||
E bool OnJoin(const Anope::string &, const std::vector<Anope::string> &);
|
||||
E bool OnKick(const Anope::string &, const std::vector<Anope::string> &);
|
||||
E bool OnKill(const Anope::string &, const std::vector<Anope::string> &);
|
||||
E bool OnMode(const Anope::string &, const std::vector<Anope::string> &);
|
||||
E bool OnNick(const Anope::string &, const std::vector<Anope::string> &);
|
||||
E bool OnUID(const Anope::string &, const std::vector<Anope::string> &);
|
||||
E bool OnPart(const Anope::string &, const std::vector<Anope::string> &);
|
||||
E bool OnPing(const Anope::string &, const std::vector<Anope::string> &);
|
||||
E bool OnPrivmsg(const Anope::string &, const std::vector<Anope::string> &);
|
||||
E bool OnQuit(const Anope::string &, const std::vector<Anope::string> &);
|
||||
E bool OnServer(const Anope::string &, const std::vector<Anope::string> &);
|
||||
E bool OnSQuit(const Anope::string &, const std::vector<Anope::string> &);
|
||||
E bool OnTopic(const Anope::string &, const std::vector<Anope::string> &);
|
||||
E bool OnWhois(const Anope::string &, const std::vector<Anope::string> &);
|
||||
E bool OnCapab(const Anope::string &, const std::vector<Anope::string> &);
|
||||
E bool OnSJoin(const Anope::string &, const std::vector<Anope::string> &);
|
||||
E bool OnError(const Anope::string &, const std::vector<Anope::string> &);
|
||||
|
||||
/**** misc.c ****/
|
||||
|
||||
E bool IsFile(const Anope::string &filename);
|
||||
|
||||
E time_t dotime(const Anope::string &s);
|
||||
E Anope::string duration(const time_t &seconds, const NickCore *nc = NULL);
|
||||
E Anope::string expire_left(const NickCore *nc, time_t expires);
|
||||
E Anope::string do_strftime(const time_t &t, const NickCore *nc = NULL, bool short_output = false);
|
||||
E bool IsValidIdent(const Anope::string &ident);
|
||||
E bool IsValidHost(const Anope::string &host);
|
||||
|
||||
E Anope::string myStrGetToken(const Anope::string &str, char dilim, int token_number);
|
||||
E Anope::string myStrGetTokenRemainder(const Anope::string &str, char dilim, int token_number);
|
||||
E int myNumToken(const Anope::string &str, char dilim);
|
||||
E bool nickIsServices(const Anope::string &nick, bool bot);
|
||||
|
||||
E std::list<Anope::string> BuildStringList(const Anope::string &, char = ' ');
|
||||
E std::vector<Anope::string> BuildStringVector(const Anope::string &, char = ' ');
|
||||
|
||||
E bool str_is_wildcard(const Anope::string &str);
|
||||
E bool str_is_pure_wildcard(const Anope::string &str);
|
||||
E Anope::string normalizeBuffer(const Anope::string &);
|
||||
|
||||
/**** modes.cpp ****/
|
||||
|
||||
/* Number of generic modes we support */
|
||||
E unsigned GenericChannelModes, GenericUserModes;
|
||||
E std::multimap<ChannelModeName, ModeLock *> def_mode_locks;
|
||||
E void SetDefaultMLock(ServerConfig *config);
|
||||
|
||||
/**** process.c ****/
|
||||
|
||||
E void process(const Anope::string &buf);
|
||||
|
||||
#endif /* EXTERN_H */
|
||||
+22
-16
@@ -1,13 +1,10 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2002-2011 InspIRCd Development Team
|
||||
* Copyright (C) 2009-2012 Anope Team <team@anope.org>
|
||||
* Copyright (C) 2009-2013 Anope Team <team@anope.org>
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* These classes have been copied from InspIRCd and modified
|
||||
* for use in Anope.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HASHCOMP_H
|
||||
@@ -16,19 +13,27 @@
|
||||
#include <string>
|
||||
#include <locale>
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <tr1/unordered_map>
|
||||
#else
|
||||
#include <unordered_map>
|
||||
#endif
|
||||
|
||||
#include "services.h"
|
||||
|
||||
namespace Anope
|
||||
{
|
||||
class string;
|
||||
|
||||
/* Casemap in use by Anope. ci::string's comparation functions use this (and thus Anope::string) */
|
||||
extern std::locale casemap;
|
||||
|
||||
template<typename charT>
|
||||
class ascii_ctype : public std::ctype<charT>
|
||||
/* ASCII case insensitive ctype. */
|
||||
template<typename char_type>
|
||||
class ascii_ctype : public std::ctype<char_type>
|
||||
{
|
||||
public:
|
||||
charT do_toupper(charT c) const anope_override
|
||||
char_type do_toupper(char_type c) const anope_override
|
||||
{
|
||||
if (c >= 'a' && c <= 'z')
|
||||
return c - 32;
|
||||
@@ -36,7 +41,7 @@ namespace Anope
|
||||
return c;
|
||||
}
|
||||
|
||||
charT do_tolower(charT c) const anope_override
|
||||
char_type do_tolower(char_type c) const anope_override
|
||||
{
|
||||
if (c >= 'A' && c <= 'Z')
|
||||
return c + 32;
|
||||
@@ -45,29 +50,30 @@ namespace Anope
|
||||
}
|
||||
};
|
||||
|
||||
template<typename charT>
|
||||
class rfc1459_ctype : public ascii_ctype<charT>
|
||||
/* rfc1459 case insensitive ctype, { = [, } = ], and | = \ */
|
||||
template<typename char_type>
|
||||
class rfc1459_ctype : public ascii_ctype<char_type>
|
||||
{
|
||||
public:
|
||||
charT do_toupper(charT c) const anope_override
|
||||
char_type do_toupper(char_type c) const anope_override
|
||||
{
|
||||
if (c == '{' || c == '}' || c == '|')
|
||||
return c - 32;
|
||||
else
|
||||
return ascii_ctype<charT>::do_toupper(c);
|
||||
return ascii_ctype<char_type>::do_toupper(c);
|
||||
}
|
||||
|
||||
charT do_tolower(charT c) const anope_override
|
||||
char_type do_tolower(char_type c) const anope_override
|
||||
{
|
||||
if (c == '[' || c == ']' || c == '\\')
|
||||
return c + 32;
|
||||
else
|
||||
return ascii_ctype<charT>::do_tolower(c);
|
||||
return ascii_ctype<char_type>::do_tolower(c);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/** The ci namespace contains a number of helper classes.
|
||||
/** The ci namespace contains a number of helper classes relevant to case insensitive strings.
|
||||
*/
|
||||
namespace ci
|
||||
{
|
||||
|
||||
+60
-2
@@ -1,11 +1,69 @@
|
||||
/* Commonly used language strings
|
||||
/*
|
||||
*
|
||||
* (C) 2008-2012 Anope Team
|
||||
* (C) 2008-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "anope.h"
|
||||
|
||||
namespace Language
|
||||
{
|
||||
|
||||
/* Languages we support as configured in services.conf. They are
|
||||
* added to this list if we detect a language exists in the correct
|
||||
* location for each language.
|
||||
*/
|
||||
extern CoreExport std::vector<Anope::string> Languages;
|
||||
|
||||
/* Domains to search when looking for translations other than the
|
||||
* default "anope domain. This is used by modules who add their own
|
||||
* language files (and thus domains) to Anope. If a module is loaded
|
||||
* and we detect a language file exists for at least one of the supported
|
||||
* languages for the module, then we add the module's domain (its name)
|
||||
* here.
|
||||
*
|
||||
* When strings are translated they are checked against all domains.
|
||||
*/
|
||||
extern std::vector<Anope::string> Domains;
|
||||
|
||||
/** Initialize the language system. Finds valid language files and
|
||||
* populates the Languages list.
|
||||
*/
|
||||
extern void InitLanguages();
|
||||
|
||||
/** Translates a string to the default language.
|
||||
* @param string A string to translate
|
||||
* @return The translated string if found, else the original string.
|
||||
*/
|
||||
extern CoreExport const char *Translate(const char *string);
|
||||
|
||||
/** Translates a string to the language of the given user.
|
||||
* @param u The user to transate the string for
|
||||
* @param string A string to translate
|
||||
* @return The translated string if found, else the original string.
|
||||
*/
|
||||
extern CoreExport const char *Translate(User *u, const char *string);
|
||||
|
||||
/** Translates a string to the language of the given account.
|
||||
* @param nc The account to translate the string for
|
||||
* @param string A string to translate
|
||||
* @return The translated string if count, else the original string
|
||||
*/
|
||||
extern CoreExport const char *Translate(const NickCore *nc, const char *string);
|
||||
|
||||
/** Translatesa string to the given language.
|
||||
* @param lang The language to trnalsate to
|
||||
* @param string The string to translate
|
||||
* @return The translated string if found, else the original string.
|
||||
*/
|
||||
extern CoreExport const char *Translate(const char *lang, const char *string);
|
||||
|
||||
} // namespace Language
|
||||
|
||||
/* Commonly used language strings */
|
||||
#define MORE_INFO _("\002%s%s HELP %s\002 for more information.")
|
||||
#define BAD_USERHOST_MASK _("Mask must be in the form \037user\037@\037host\037.")
|
||||
#define BAD_EXPIRY_TIME _("Invalid expiry time.")
|
||||
|
||||
+6
-7
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -8,7 +8,6 @@
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LISTS_H
|
||||
@@ -48,9 +47,9 @@ class CoreExport NumberList
|
||||
void Process();
|
||||
|
||||
/** Called with a number from the list
|
||||
* @param Number The number
|
||||
* @param number The number
|
||||
*/
|
||||
virtual void HandleNumber(unsigned Number);
|
||||
virtual void HandleNumber(unsigned number);
|
||||
|
||||
/** Called when there is an error with the numbered list
|
||||
* Return false to immediatly stop processing the list and return
|
||||
@@ -71,9 +70,9 @@ class CoreExport ListFormatter
|
||||
std::vector<Anope::string> columns;
|
||||
std::vector<ListEntry> entries;
|
||||
public:
|
||||
ListFormatter &addColumn(const Anope::string &name);
|
||||
void addEntry(const ListEntry &entry);
|
||||
bool isEmpty() const;
|
||||
ListFormatter &AddColumn(const Anope::string &name);
|
||||
void AddEntry(const ListEntry &entry);
|
||||
bool IsEmpty() const;
|
||||
void Process(std::vector<Anope::string> &);
|
||||
};
|
||||
|
||||
|
||||
+39
-21
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -18,12 +18,18 @@
|
||||
|
||||
enum LogType
|
||||
{
|
||||
/* Used whenever an administrator uses an administrative comand */
|
||||
LOG_ADMIN,
|
||||
/* Used whenever an administrator overides something, such as adding
|
||||
* access to a channel where they don't have permission to.
|
||||
*/
|
||||
LOG_OVERRIDE,
|
||||
/* Any other command usage */
|
||||
LOG_COMMAND,
|
||||
LOG_SERVER,
|
||||
LOG_CHANNEL,
|
||||
LOG_USER,
|
||||
LOG_MODULE,
|
||||
LOG_NORMAL,
|
||||
LOG_TERMINAL,
|
||||
LOG_RAWIO,
|
||||
@@ -36,36 +42,44 @@ enum LogType
|
||||
struct LogFile
|
||||
{
|
||||
Anope::string filename;
|
||||
|
||||
public:
|
||||
std::ofstream stream;
|
||||
|
||||
LogFile(const Anope::string &name);
|
||||
Anope::string GetName() const;
|
||||
};
|
||||
|
||||
|
||||
/* Represents a single log message */
|
||||
class CoreExport Log
|
||||
{
|
||||
public:
|
||||
/* Bot that should log this message */
|
||||
const BotInfo *bi;
|
||||
/* For commands, the user executing the command */
|
||||
Anope::string nick;
|
||||
/* For commands, the user executing the command, but might not always exist */
|
||||
const User *u;
|
||||
/* For commands, the account executing teh command, but will not always exist */
|
||||
const NickCore *nc;
|
||||
/* For commands, the command being executed */
|
||||
Command *c;
|
||||
/* Used for LOG_CHANNEL */
|
||||
Channel *chan;
|
||||
/* For commands, the channel the command was executed on, will not always exist */
|
||||
const ChannelInfo *ci;
|
||||
/* For LOG_SERVER */
|
||||
Server *s;
|
||||
LogType Type;
|
||||
Anope::string Category;
|
||||
std::list<Anope::string> Sources;
|
||||
/* For LOG_MODULE */
|
||||
Module *m;
|
||||
LogType type;
|
||||
Anope::string category;
|
||||
std::list<Anope::string> sources;
|
||||
|
||||
std::stringstream buf;
|
||||
|
||||
Log(LogType type = LOG_NORMAL, const Anope::string &category = "", const BotInfo *bi = NULL);
|
||||
|
||||
/* LOG_COMMAND/OVERRIDE/ADMIN */
|
||||
Log(LogType type, const CommandSource &source, Command *c, const ChannelInfo *ci = NULL);
|
||||
Log(LogType type, CommandSource &source, Command *c, const ChannelInfo *ci = NULL);
|
||||
|
||||
/* LOG_CHANNEL */
|
||||
Log(const User *u, Channel *c, const Anope::string &category = "");
|
||||
@@ -78,6 +92,8 @@ class CoreExport Log
|
||||
|
||||
explicit Log(const BotInfo *b, const Anope::string &category = "");
|
||||
|
||||
Log(Module *m, const Anope::string &category = "");
|
||||
|
||||
~Log();
|
||||
|
||||
Anope::string BuildPrefix() const;
|
||||
@@ -89,22 +105,23 @@ class CoreExport Log
|
||||
}
|
||||
};
|
||||
|
||||
/* Configured in the configuration file, actually does the message logging */
|
||||
class CoreExport LogInfo
|
||||
{
|
||||
public:
|
||||
std::list<Anope::string> Targets;
|
||||
std::map<Anope::string, LogFile *> Logfiles;
|
||||
std::list<Anope::string> Sources;
|
||||
int LogAge;
|
||||
std::list<Anope::string> Admin;
|
||||
std::list<Anope::string> Override;
|
||||
std::list<Anope::string> Commands;
|
||||
std::list<Anope::string> Servers;
|
||||
std::list<Anope::string> Users;
|
||||
std::list<Anope::string> Channels;
|
||||
std::list<Anope::string> Normal;
|
||||
bool RawIO;
|
||||
bool Debug;
|
||||
std::list<Anope::string> targets;
|
||||
std::map<Anope::string, LogFile *> logfiles;
|
||||
std::list<Anope::string> sources;
|
||||
int log_age;
|
||||
std::list<Anope::string> admin;
|
||||
std::list<Anope::string> override;
|
||||
std::list<Anope::string> commands;
|
||||
std::list<Anope::string> servers;
|
||||
std::list<Anope::string> users;
|
||||
std::list<Anope::string> channels;
|
||||
std::list<Anope::string> normal;
|
||||
bool raw_io;
|
||||
bool debug;
|
||||
|
||||
LogInfo(int logage, bool rawio, bool debug);
|
||||
|
||||
@@ -114,6 +131,7 @@ class CoreExport LogInfo
|
||||
|
||||
bool HasType(LogType ltype, const Anope::string &type) const;
|
||||
|
||||
/* Logs the message l if configured to */
|
||||
void ProcessMessage(const Log *l);
|
||||
};
|
||||
|
||||
|
||||
+33
-18
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -18,26 +18,41 @@
|
||||
#include "threadengine.h"
|
||||
#include "serialize.h"
|
||||
|
||||
extern CoreExport bool Mail(User *u, NickCore *nc, const BotInfo *service, const Anope::string &subject, const Anope::string &message);
|
||||
extern CoreExport bool Mail(NickCore *nc, const Anope::string &subject, const Anope::string &message);
|
||||
extern CoreExport bool MailValidate(const Anope::string &email);
|
||||
|
||||
class MailThread : public Thread
|
||||
namespace Mail
|
||||
{
|
||||
private:
|
||||
Anope::string MailTo;
|
||||
Anope::string Addr;
|
||||
Anope::string Subject;
|
||||
Anope::string Message;
|
||||
bool DontQuoteAddresses;
|
||||
extern CoreExport bool Send(User *from, NickCore *to, const BotInfo *service, const Anope::string &subject, const Anope::string &message);
|
||||
extern CoreExport bool Send(NickCore *to, const Anope::string &subject, const Anope::string &message);
|
||||
extern CoreExport bool Validate(const Anope::string &email);
|
||||
|
||||
bool Success;
|
||||
public:
|
||||
MailThread(const Anope::string &mailto, const Anope::string &addr, const Anope::string &subject, const Anope::string &message);
|
||||
/* A email message being sent */
|
||||
class Message : public Thread
|
||||
{
|
||||
private:
|
||||
Anope::string sendmail_path;
|
||||
Anope::string send_from;
|
||||
Anope::string mail_to;
|
||||
Anope::string addr;
|
||||
Anope::string subject;
|
||||
Anope::string message;
|
||||
bool dont_quote_addresses;
|
||||
|
||||
~MailThread();
|
||||
bool success;
|
||||
public:
|
||||
/** Construct this message. Once constructed call Thread::Start to launch the mail sending.
|
||||
* @param sf Config->SendFrom
|
||||
* @param mailto Name of person being mailed (u->nick, nc->display, etc)
|
||||
* @param addr Destination address to mail
|
||||
* @param subject Message subject
|
||||
* @param message The actual message
|
||||
*/
|
||||
Message(const Anope::string &sf, const Anope::string &mailto, const Anope::string &addr, const Anope::string &subject, const Anope::string &message);
|
||||
|
||||
void Run();
|
||||
};
|
||||
~Message();
|
||||
|
||||
/* Called from within the thread to actually send the mail */
|
||||
void Run() anope_override;
|
||||
};
|
||||
|
||||
} // namespace Mail
|
||||
|
||||
#endif // MAIL_H
|
||||
|
||||
+15
-25
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -8,7 +8,6 @@
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MEMO_H
|
||||
@@ -17,49 +16,40 @@
|
||||
#include "anope.h"
|
||||
#include "serialize.h"
|
||||
|
||||
/** Memo Flags
|
||||
*/
|
||||
enum MemoFlag
|
||||
{
|
||||
/* Memo is unread */
|
||||
MF_UNREAD,
|
||||
/* Sender requests a receipt */
|
||||
MF_RECEIPT
|
||||
};
|
||||
|
||||
const Anope::string MemoFlagStrings[] = {
|
||||
"MF_UNREAD", "MF_RECEIPT", ""
|
||||
};
|
||||
|
||||
/* Memo info structures. Since both nicknames and channels can have memos,
|
||||
* we encapsulate memo data in a MemoList to make it easier to handle. */
|
||||
class CoreExport Memo : public Flags<MemoFlag>, public Serializable
|
||||
class CoreExport Memo : public Serializable
|
||||
{
|
||||
public:
|
||||
bool unread;
|
||||
bool receipt;
|
||||
Memo();
|
||||
~Memo();
|
||||
|
||||
const Anope::string serialize_name() const anope_override;
|
||||
Serialize::Data serialize() const anope_override;
|
||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &);
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
Anope::string owner;
|
||||
time_t time; /* When it was sent */
|
||||
/* When it was sent */
|
||||
time_t time;
|
||||
Anope::string sender;
|
||||
Anope::string text;
|
||||
};
|
||||
|
||||
/* Memo info structures. Since both nicknames and channels can have memos,
|
||||
* we encapsulate memo data in a MemoInfo to make it easier to handle.
|
||||
*/
|
||||
struct CoreExport MemoInfo
|
||||
{
|
||||
int16_t memomax;
|
||||
serialize_checker<std::vector<Memo *> > memos;
|
||||
Serialize::Checker<std::vector<Memo *> > memos;
|
||||
std::vector<Anope::string> ignores;
|
||||
|
||||
MemoInfo();
|
||||
Memo *GetMemo(unsigned index) const;
|
||||
unsigned GetIndex(Memo *m) const;
|
||||
void Del(unsigned index);
|
||||
void Del(Memo *m);
|
||||
bool HasIgnore(User *u);
|
||||
|
||||
static MemoInfo *GetMemoInfo(const Anope::string &targ, bool &is_chan);
|
||||
};
|
||||
|
||||
#endif // MEMO_H
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2013 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 "protocol.h"
|
||||
|
||||
/* Common IRCD messages.
|
||||
* Protocol modules may chose to include some, none, or all of these handlers
|
||||
* as they see fit.
|
||||
*/
|
||||
|
||||
namespace Message
|
||||
{
|
||||
|
||||
struct CoreExport Away : IRCDMessage
|
||||
{
|
||||
Away(Module *creator, const Anope::string &mname = "AWAY") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Capab : IRCDMessage
|
||||
{
|
||||
Capab(Module *creator, const Anope::string &mname = "CAPAB") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Error : IRCDMessage
|
||||
{
|
||||
Error(Module *creator, const Anope::string &mname = "ERROR") : IRCDMessage(creator, mname, 1) { }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Join : IRCDMessage
|
||||
{
|
||||
Join(Module *creator, const Anope::string &mname = "JOIN") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
|
||||
typedef std::pair<ChannelStatus, User *> SJoinUser;
|
||||
|
||||
/** Handle a SJOIN.
|
||||
* @param source The source of the SJOIN
|
||||
* @param chan The channel the users are joining to
|
||||
* @param ts The TS for the channel
|
||||
* @param modes The modes sent with the SJOIN, if any
|
||||
* @param users The users and their status, if any
|
||||
*/
|
||||
static void SJoin(MessageSource &source, const Anope::string &chan, time_t ts, const Anope::string &modes, const std::list<SJoinUser> &users);
|
||||
};
|
||||
|
||||
struct CoreExport Kick : IRCDMessage
|
||||
{
|
||||
Kick(Module *creator, const Anope::string &mname = "KICK") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Kill : IRCDMessage
|
||||
{
|
||||
Kill(Module *creator, const Anope::string &mname = "KILL") : IRCDMessage(creator, mname, 2) { }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Mode : IRCDMessage
|
||||
{
|
||||
Mode(Module *creator, const Anope::string &mname = "MODE") : IRCDMessage(creator, mname, 2) { }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport MOTD : IRCDMessage
|
||||
{
|
||||
MOTD(Module *creator, const Anope::string &mname = "MOTD") : IRCDMessage(creator, mname, 1) { }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Part : IRCDMessage
|
||||
{
|
||||
Part(Module *creator, const Anope::string &mname = "PART") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Ping : IRCDMessage
|
||||
{
|
||||
Ping(Module *creator, const Anope::string &mname = "PING") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Privmsg : IRCDMessage
|
||||
{
|
||||
Privmsg(Module *creator, const Anope::string &mname = "PRIVMSG") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Quit : IRCDMessage
|
||||
{
|
||||
Quit(Module *creator, const Anope::string &mname = "QUIT") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport SQuit : IRCDMessage
|
||||
{
|
||||
SQuit(Module *creator, const Anope::string &mname = "SQUIT") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Stats : IRCDMessage
|
||||
{
|
||||
Stats(Module *creator, const Anope::string &mname = "STATS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Time : IRCDMessage
|
||||
{
|
||||
Time(Module *creator, const Anope::string &mname = "TIME") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Topic : IRCDMessage
|
||||
{
|
||||
Topic(Module *creator, const Anope::string &mname = "TOPIC") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Version : IRCDMessage
|
||||
{
|
||||
Version(Module *creator, const Anope::string &mname = "VERSION") : IRCDMessage(creator, mname, 0) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
struct CoreExport Whois : IRCDMessage
|
||||
{
|
||||
Whois(Module *creator, const Anope::string &mname = "WHOIS") : IRCDMessage(creator, mname, 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
|
||||
|
||||
void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override;
|
||||
};
|
||||
|
||||
} // namespace Message
|
||||
|
||||
+111
-186
@@ -1,7 +1,7 @@
|
||||
/* Mode support
|
||||
*
|
||||
* Copyright (C) 2008-2011 Adam <Adam@anope.org>
|
||||
* Copyright (C) 2008-2012 Anope Team <team@anope.org>
|
||||
* Copyright (C) 2008-2013 Anope Team <team@anope.org>
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*/
|
||||
@@ -12,81 +12,6 @@
|
||||
#include "anope.h"
|
||||
#include "base.h"
|
||||
|
||||
/** All of the valid user mode names
|
||||
*/
|
||||
enum UserModeName
|
||||
{
|
||||
UMODE_BEGIN,
|
||||
|
||||
UMODE_SERV_ADMIN, UMODE_BOT, UMODE_CO_ADMIN, UMODE_FILTER, UMODE_HIDEOPER, UMODE_NETADMIN,
|
||||
UMODE_REGPRIV, UMODE_PROTECTED, UMODE_NOCTCP, UMODE_WEBTV, UMODE_WEBIRC, UMODE_WHOIS, UMODE_ADMIN, UMODE_DEAF,
|
||||
UMODE_GLOBOPS, UMODE_HELPOP, UMODE_INVIS, UMODE_OPER, UMODE_PRIV, UMODE_GOD, UMODE_REGISTERED,
|
||||
UMODE_SNOMASK, UMODE_VHOST, UMODE_WALLOPS, UMODE_CLOAK, UMODE_SSL, UMODE_SOFTCALLERID, UMODE_CALLERID,
|
||||
UMODE_COMMONCHANS, UMODE_HIDDEN, UMODE_STRIPCOLOR, UMODE_INVISIBLE_OPER, UMODE_RESTRICTED, UMODE_HIDEIDLE,
|
||||
|
||||
UMODE_END
|
||||
};
|
||||
|
||||
const Anope::string UserModeNameStrings[] = {
|
||||
"UMODE_BEGIN",
|
||||
|
||||
"UMODE_SERV_ADMIN", "UMODE_BOT", "UMODE_CO_ADMIN", "UMODE_FILTER", "UMODE_HIDEOPER", "UMODE_NETADMIN",
|
||||
"UMODE_REGPRIV", "UMODE_PROTECTED", "UMODE_NOCTCP", "UMODE_WEBTV", "UMODE_WEBIRC", "UMODE_WHOIS", "UMODE_ADMIN", "UMODE_DEAF",
|
||||
"UMODE_GLOBOPS", "UMODE_HELPOP", "UMODE_INVIS", "UMODE_OPER", "UMODE_PRIV", "UMODE_GOD", "UMODE_REGISTERED",
|
||||
"UMODE_SNOMASK", "UMODE_VHOST", "UMODE_WALLOPS", "UMODE_CLOAK", "UMODE_SSL", "UMODE_SOFTCALLERID", "UMODE_CALLERID",
|
||||
"UMODE_COMMONCHANS", "UMODE_HIDDEN", "UMODE_STRIPCOLOR", "UMODE_INVISIBLE_OPER", "UMODE_RESTRICTED", "UMODE_HIDEIDLE",
|
||||
|
||||
""
|
||||
};
|
||||
|
||||
/** All of the valid channel mode names
|
||||
*/
|
||||
enum ChannelModeName
|
||||
{
|
||||
CMODE_BEGIN,
|
||||
|
||||
/* Channel modes */
|
||||
CMODE_BLOCKCOLOR, CMODE_FLOOD, CMODE_INVITE, CMODE_KEY, CMODE_LIMIT, CMODE_MODERATED, CMODE_NOEXTERNAL,
|
||||
CMODE_PRIVATE, CMODE_REGISTERED, CMODE_SECRET, CMODE_TOPIC, CMODE_AUDITORIUM, CMODE_SSL, CMODE_ADMINONLY,
|
||||
CMODE_NOCTCP, CMODE_FILTER, CMODE_NOKNOCK, CMODE_REDIRECT, CMODE_REGMODERATED, CMODE_NONICK, CMODE_OPERONLY,
|
||||
CMODE_NOKICK, CMODE_REGISTEREDONLY, CMODE_STRIPCOLOR, CMODE_NONOTICE, CMODE_NOINVITE, CMODE_ALLINVITE,
|
||||
CMODE_BLOCKCAPS, CMODE_PERM, CMODE_NICKFLOOD, CMODE_JOINFLOOD, CMODE_DELAYEDJOIN, CMODE_NOREJOIN,
|
||||
CMODE_BANDWIDTH,
|
||||
|
||||
/* b/e/I */
|
||||
CMODE_BAN, CMODE_EXCEPT,
|
||||
CMODE_INVITEOVERRIDE,
|
||||
|
||||
/* v/h/o/a/q */
|
||||
CMODE_VOICE, CMODE_HALFOP, CMODE_OP,
|
||||
CMODE_PROTECT, CMODE_OWNER,
|
||||
|
||||
CMODE_END
|
||||
};
|
||||
|
||||
const Anope::string ChannelModeNameStrings[] = {
|
||||
"CMODE_BEGIN",
|
||||
|
||||
/* Channel modes */
|
||||
"CMODE_BLOCKCOLOR", "CMODE_FLOOD", "CMODE_INVITE", "CMODE_KEY", "CMODE_LIMIT", "CMODE_MODERATED", "CMODE_NOEXTERNAL",
|
||||
"CMODE_PRIVATE", "CMODE_REGISTERED", "CMODE_SECRET", "CMODE_TOPIC", "CMODE_AUDITORIUM", "CMODE_SSL", "CMODE_ADMINONLY",
|
||||
"CMODE_NOCTCP", "CMODE_FILTER", "CMODE_NOKNOCK", "CMODE_REDIRECT", "CMODE_REGMODERATED", "CMODE_NONICK", "CMODE_OPERONLY",
|
||||
"CMODE_NOKICK", "CMODE_REGISTEREDONLY", "CMODE_STRIPCOLOR", "CMODE_NONOTICE", "CMODE_NOINVITE", "CMODE_ALLINVITE",
|
||||
"CMODE_BLOCKCAPS", "CMODE_PERM", "CMODE_NICKFLOOD", "CMODE_JOINFLOOD", "CMODE_DELAYEDJOIN", "CMODE_NOREJOIN",
|
||||
"CMODE_BANDWIDTH",
|
||||
|
||||
/* b/e/I */
|
||||
"CMODE_BAN", "CMODE_EXCEPT",
|
||||
"CMODE_INVITEOVERRIDE",
|
||||
|
||||
/* v/h/o/a/q */
|
||||
"CMODE_VOICE", "CMODE_HALFOP", "CMODE_OP",
|
||||
"CMODE_PROTECT", "CMODE_OWNER",
|
||||
|
||||
""
|
||||
};
|
||||
|
||||
|
||||
/** The different types of modes
|
||||
*/
|
||||
enum ModeType
|
||||
@@ -105,9 +30,7 @@ enum ModeType
|
||||
*/
|
||||
enum ModeClass
|
||||
{
|
||||
/* Channel mode */
|
||||
MC_CHANNEL,
|
||||
/* User mode */
|
||||
MC_USER
|
||||
};
|
||||
|
||||
@@ -116,22 +39,22 @@ enum ModeClass
|
||||
class CoreExport Mode : public Base
|
||||
{
|
||||
public:
|
||||
/* Class of mode this is */
|
||||
ModeClass Class;
|
||||
/* Mode char for this */
|
||||
char ModeChar;
|
||||
/* Type of mode this is */
|
||||
ModeType Type;
|
||||
/* Mode name */
|
||||
Anope::string name;
|
||||
/* Class of mode this is (user/channel) */
|
||||
ModeClass mclass;
|
||||
/* Mode char for this, eg 'b' */
|
||||
char mchar;
|
||||
/* Type of mode this is, eg MODE_LIST */
|
||||
ModeType type;
|
||||
|
||||
/** Default constructor
|
||||
* @param mClass The type of mode this is
|
||||
* @param modeChar The mode char
|
||||
/** constructor
|
||||
* @param mname The mode name
|
||||
* @param mclass The type of mode this is
|
||||
* @param mc The mode char
|
||||
* @param type The mode type
|
||||
*/
|
||||
Mode(ModeClass mClass, char modeChar, ModeType type);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
Mode(const Anope::string &mname, ModeClass mclass, char mc, ModeType type);
|
||||
virtual ~Mode();
|
||||
};
|
||||
|
||||
@@ -140,32 +63,22 @@ class CoreExport Mode : public Base
|
||||
class CoreExport UserMode : public Mode
|
||||
{
|
||||
public:
|
||||
/* Mode name */
|
||||
UserModeName Name;
|
||||
|
||||
/** Default constructor
|
||||
* @param nName The mode name
|
||||
* @param modeChar The mode char
|
||||
*/
|
||||
UserMode(UserModeName mName, char modeChar);
|
||||
|
||||
/** Default destructor
|
||||
/** constructor
|
||||
* @param name The mode name
|
||||
* @param mc The mode char
|
||||
*/
|
||||
UserMode(const Anope::string &name, char mc);
|
||||
virtual ~UserMode();
|
||||
|
||||
/** Returns the mode name as a string
|
||||
*/
|
||||
const Anope::string NameAsString();
|
||||
};
|
||||
|
||||
class CoreExport UserModeParam : public UserMode
|
||||
{
|
||||
public:
|
||||
/** Default constructor
|
||||
* @param mName The mode name
|
||||
* @param modeChar The mode char
|
||||
/** constructor
|
||||
* @param name The mode name
|
||||
* @param mc The mode char
|
||||
*/
|
||||
UserModeParam(UserModeName mName, char modeChar);
|
||||
UserModeParam(const Anope::string &name, char mc);
|
||||
|
||||
/** Check if the param is valid
|
||||
* @param value The param
|
||||
@@ -179,17 +92,11 @@ class CoreExport UserModeParam : public UserMode
|
||||
class CoreExport ChannelMode : public Mode
|
||||
{
|
||||
public:
|
||||
/* Mode name */
|
||||
ChannelModeName Name;
|
||||
|
||||
/** Default constructor
|
||||
* @param mName The mode name
|
||||
* @param modeChar The mode char
|
||||
*/
|
||||
ChannelMode(ChannelModeName mName, char modeChar);
|
||||
|
||||
/** Default destructor
|
||||
/** constructor
|
||||
* @param name The mode name
|
||||
* @param mc The mode char
|
||||
*/
|
||||
ChannelMode(const Anope::string &name, char mc);
|
||||
virtual ~ChannelMode();
|
||||
|
||||
/** Can a user set this mode, used for mlock
|
||||
@@ -197,10 +104,6 @@ class CoreExport ChannelMode : public Mode
|
||||
* @param u The user, or NULL
|
||||
*/
|
||||
virtual bool CanSet(User *u) const;
|
||||
|
||||
/** Returns the mode name as a string
|
||||
*/
|
||||
const Anope::string NameAsString();
|
||||
};
|
||||
|
||||
|
||||
@@ -209,13 +112,13 @@ class CoreExport ChannelMode : public Mode
|
||||
class CoreExport ChannelModeList : public ChannelMode
|
||||
{
|
||||
public:
|
||||
/** Default constructor
|
||||
* @param mName The mode name
|
||||
* @param modeChar The mode char
|
||||
/** constructor
|
||||
* @param name The mode name
|
||||
* @param mc The mode char
|
||||
*/
|
||||
ChannelModeList(ChannelModeName mName, char modeChar);
|
||||
ChannelModeList(const Anope::string &name, char mc);
|
||||
|
||||
/** Default destructor
|
||||
/** destructor
|
||||
*/
|
||||
virtual ~ChannelModeList();
|
||||
|
||||
@@ -251,19 +154,19 @@ class CoreExport ChannelModeList : public ChannelMode
|
||||
class CoreExport ChannelModeParam : public ChannelMode
|
||||
{
|
||||
public:
|
||||
/** Default constructor
|
||||
* @param mName The mode name
|
||||
* @param modeChar The mode char
|
||||
* @param MinusArg true if this mode sends no arg when unsetting
|
||||
/** constructor
|
||||
* @param name The mode name
|
||||
* @param mc The mode char
|
||||
* @param minus_no_arg true if this mode sends no arg when unsetting
|
||||
*/
|
||||
ChannelModeParam(ChannelModeName mName, char modeChar, bool MinusArg = false);
|
||||
ChannelModeParam(const Anope::string &name, char mc, bool minus_no_arg = false);
|
||||
|
||||
/** Default destructor
|
||||
/** destructor
|
||||
*/
|
||||
virtual ~ChannelModeParam();
|
||||
|
||||
/* Should we send an arg when unsetting this mode? */
|
||||
bool MinusNoArg;
|
||||
bool minus_no_arg;
|
||||
|
||||
/** Is the param valid
|
||||
* @param value The param
|
||||
@@ -282,27 +185,36 @@ class CoreExport ChannelModeStatus : public ChannelMode
|
||||
/* The "level" of the mode, used to compare with other modes.
|
||||
* Used so we know op > halfop > voice etc.
|
||||
*/
|
||||
unsigned short Level;
|
||||
short level;
|
||||
|
||||
/** Default constructor
|
||||
* @param mName The mode name
|
||||
* @param modeChar The mode char
|
||||
/** constructor
|
||||
* @param name The mode name
|
||||
* @param mc The mode char
|
||||
* @param mSymbol The symbol for the mode, eg @ %
|
||||
* @param mLevel A level for the mode, which is usually determined by the PREFIX capab
|
||||
* @param mlevel A level for the mode, which is usually determined by the PREFIX capab
|
||||
*/
|
||||
ChannelModeStatus(ChannelModeName mName, char modeChar, char mSymbol, unsigned short mLevel = 0);
|
||||
ChannelModeStatus(const Anope::string &name, char mc, char mSymbol, short mlevel = 0);
|
||||
|
||||
/** Default destructor
|
||||
/** destructor
|
||||
*/
|
||||
virtual ~ChannelModeStatus();
|
||||
};
|
||||
|
||||
/* The status a user has on a channel (+v, +h, +o) etc */
|
||||
class CoreExport ChannelStatus
|
||||
{
|
||||
public:
|
||||
std::set<Anope::string> modes;
|
||||
Anope::string BuildCharPrefixList() const;
|
||||
Anope::string BuildModePrefixList() const;
|
||||
};
|
||||
|
||||
/** Channel mode +k (key)
|
||||
*/
|
||||
class CoreExport ChannelModeKey : public ChannelModeParam
|
||||
{
|
||||
public:
|
||||
ChannelModeKey(char modeChar) : ChannelModeParam(CMODE_KEY, modeChar) { }
|
||||
ChannelModeKey(char mc) : ChannelModeParam("KEY", mc) { }
|
||||
|
||||
bool IsValid(const Anope::string &value) const anope_override;
|
||||
};
|
||||
@@ -313,7 +225,7 @@ class CoreExport ChannelModeKey : public ChannelModeParam
|
||||
class CoreExport ChannelModeAdmin : public ChannelMode
|
||||
{
|
||||
public:
|
||||
ChannelModeAdmin(char modeChar) : ChannelMode(CMODE_ADMINONLY, modeChar) { }
|
||||
ChannelModeAdmin(char mc) : ChannelMode("ADMINONLY", mc) { }
|
||||
|
||||
/* Opers only */
|
||||
bool CanSet(User *u) const anope_override;
|
||||
@@ -325,7 +237,7 @@ class CoreExport ChannelModeAdmin : public ChannelMode
|
||||
class CoreExport ChannelModeOper : public ChannelMode
|
||||
{
|
||||
public:
|
||||
ChannelModeOper(char modeChar) : ChannelMode(CMODE_OPERONLY, modeChar) { }
|
||||
ChannelModeOper(char mc) : ChannelMode("OPERONLY", mc) { }
|
||||
|
||||
/* Opers only */
|
||||
bool CanSet(User *u) const anope_override;
|
||||
@@ -337,7 +249,7 @@ class CoreExport ChannelModeOper : public ChannelMode
|
||||
class CoreExport ChannelModeRegistered : public ChannelMode
|
||||
{
|
||||
public:
|
||||
ChannelModeRegistered(char modeChar) : ChannelMode(CMODE_REGISTERED, modeChar) { }
|
||||
ChannelModeRegistered(char mc) : ChannelMode("REGISTERED", mc) { }
|
||||
|
||||
/* No one mlocks +r */
|
||||
bool CanSet(User *u) const anope_override;
|
||||
@@ -355,17 +267,17 @@ class StackerInfo
|
||||
|
||||
/** Add a mode to this object
|
||||
* @param mode The mode
|
||||
* @param Set true if setting, false if unsetting
|
||||
* @param Param The param for the mode
|
||||
* @param set true if setting, false if unsetting
|
||||
* @param param The param for the mode
|
||||
*/
|
||||
void AddMode(Mode *mode, bool Set, const Anope::string &Param);
|
||||
void AddMode(Mode *mode, bool set, const Anope::string ¶m);
|
||||
};
|
||||
|
||||
/** This is mode manager
|
||||
/** This is the mode manager
|
||||
* It contains functions for adding modes to Anope so Anope can track them
|
||||
* and do things such as MLOCK.
|
||||
* This also contains a mode stacker that will combine multiple modes and set
|
||||
* them on a channel all at once
|
||||
* them on a channel or user at once
|
||||
*/
|
||||
class CoreExport ModeManager
|
||||
{
|
||||
@@ -385,6 +297,15 @@ class CoreExport ModeManager
|
||||
static std::vector<ChannelMode *> ChannelModes;
|
||||
static std::vector<UserMode *> UserModes;
|
||||
|
||||
/* Number of generic channel and user modes we are tracking */
|
||||
static unsigned GenericChannelModes;
|
||||
static unsigned GenericUserModes;
|
||||
/* Default channel mode lock */
|
||||
static std::list<std::pair<Anope::string, Anope::string> > ModeLockOn;
|
||||
static std::list<Anope::string> ModeLockOff;
|
||||
/* Default modes bots have on channels */
|
||||
static ChannelStatus DefaultBotModes;
|
||||
|
||||
/** Add a user mode to Anope
|
||||
* @param um A UserMode or UserMode derived class
|
||||
* @return true on success, false on error
|
||||
@@ -397,81 +318,85 @@ class CoreExport ModeManager
|
||||
*/
|
||||
static bool AddChannelMode(ChannelMode *cm);
|
||||
|
||||
/** Find a channel mode
|
||||
* @param Mode The mode
|
||||
* @return The mode class
|
||||
/** Remove a user mode from Anope
|
||||
* @param um A UserMode to remove
|
||||
*/
|
||||
static ChannelMode *FindChannelModeByChar(char Mode);
|
||||
static void RemoveUserMode(UserMode *um);
|
||||
|
||||
/** Find a user mode
|
||||
* @param Mode The mode
|
||||
* @return The mode class
|
||||
/** Remove a channel mode from Anope
|
||||
* @param um A ChanneMode to remove
|
||||
*/
|
||||
static UserMode *FindUserModeByChar(char Mode);
|
||||
static void RemoveChannelMode(ChannelMode *cm);
|
||||
|
||||
/** Find a channel mode
|
||||
* @param Mode The modename
|
||||
* @param mode The mode
|
||||
* @return The mode class
|
||||
*/
|
||||
static ChannelMode *FindChannelModeByName(ChannelModeName Name);
|
||||
static ChannelMode *FindChannelModeByChar(char mode);
|
||||
|
||||
/** Find a user mode
|
||||
* @param Mode The modename
|
||||
* @param mode The mode
|
||||
* @return The mode class
|
||||
*/
|
||||
static UserMode *FindUserModeByName(UserModeName Name);
|
||||
static UserMode *FindUserModeByChar(char mode);
|
||||
|
||||
/** Find channel mode by string
|
||||
* @param name The mode name
|
||||
* @return The mode
|
||||
/** Find a channel mode
|
||||
* @param name The modename
|
||||
* @return The mode class
|
||||
*/
|
||||
static ChannelMode *FindChannelModeByString(const Anope::string &name);
|
||||
static ChannelMode *FindChannelModeByName(const Anope::string &name);
|
||||
|
||||
/** Find user mode by string
|
||||
* @param name The mode name
|
||||
* @return The mode
|
||||
/** Find a user mode
|
||||
* @param name The modename
|
||||
* @return The mode class
|
||||
*/
|
||||
static UserMode *FindUserModeByString(const Anope::string &name);
|
||||
static UserMode *FindUserModeByName(const Anope::string &name);
|
||||
|
||||
/** Gets the channel mode char for a symbol (eg + returns v)
|
||||
* @param Value The symbol
|
||||
* @param symbol The symbol
|
||||
* @return The char
|
||||
*/
|
||||
static char GetStatusChar(char Value);
|
||||
static char GetStatusChar(char symbol);
|
||||
|
||||
/** Add a mode to the stacker to be set on a channel
|
||||
* @param bi The client to set the modes from
|
||||
* @param c The channel
|
||||
* @param cm The channel mode
|
||||
* @param Set true for setting, false for removing
|
||||
* @param Param The param, if there is one
|
||||
* @param set true for setting, false for removing
|
||||
* @param param The param, if there is one
|
||||
*/
|
||||
static void StackerAdd(const BotInfo *bi, Channel *c, ChannelMode *cm, bool Set, const Anope::string &Param = "");
|
||||
static void StackerAdd(const BotInfo *bi, Channel *c, ChannelMode *cm, bool set, const Anope::string ¶m = "");
|
||||
|
||||
/** Add a mode to the stacker to be set on a user
|
||||
* @param bi The client to set the modes from
|
||||
* @param u The user
|
||||
* @param um The user mode
|
||||
* @param Set true for setting, false for removing
|
||||
* @param set true for setting, false for removing
|
||||
* @param param The param, if there is one
|
||||
*/
|
||||
static void StackerAdd(const BotInfo *bi, User *u, UserMode *um, bool Set, const Anope::string &Param = "");
|
||||
static void StackerAdd(const BotInfo *bi, User *u, UserMode *um, bool set, const Anope::string ¶m = "");
|
||||
|
||||
/** Process all of the modes in the stacker and send them to the IRCd to be set on channels/users
|
||||
*/
|
||||
static void ProcessModes();
|
||||
|
||||
/** Delete a user or channel from the stacker
|
||||
/** Delete a user, channel, or mode from the stacker
|
||||
*/
|
||||
static void StackerDel(User *u);
|
||||
static void StackerDel(Channel *c);
|
||||
static void StackerDel(Mode *m);
|
||||
|
||||
/** Updates the default mode locks and default bot modes
|
||||
* @param config The configuration to read from. This is often called
|
||||
* during a config reload.
|
||||
*/
|
||||
static void UpdateDefaultMLock(ServerConfig *config);
|
||||
};
|
||||
|
||||
/** Entry flags
|
||||
*/
|
||||
enum EntryType
|
||||
{
|
||||
ENTRYTYPE_NONE,
|
||||
ENTRYTYPE_CIDR,
|
||||
ENTRYTYPE_NICK_WILD,
|
||||
ENTRYTYPE_NICK,
|
||||
@@ -483,20 +408,20 @@ enum EntryType
|
||||
|
||||
/** Represents a mask set on a channel (b/e/I)
|
||||
*/
|
||||
class CoreExport Entry : public Flags<EntryType>
|
||||
class CoreExport Entry
|
||||
{
|
||||
ChannelModeName modename;
|
||||
|
||||
Anope::string name;
|
||||
public:
|
||||
std::set<EntryType> types;
|
||||
unsigned char cidr_len;
|
||||
Anope::string mask;
|
||||
Anope::string nick, user, host;
|
||||
|
||||
/** Constructor
|
||||
* @param _host A full nick!ident@host/cidr mask
|
||||
* @param mode What mode this host is for - can be CMODE_BEGIN for unknown/no mode
|
||||
* @param mode What mode this host is for, can be empty for unknown/no mode
|
||||
* @param host A full nick!ident@host/cidr mask
|
||||
*/
|
||||
Entry(ChannelModeName mode, const Anope::string &_host);
|
||||
Entry(const Anope::string &mode, const Anope::string &host);
|
||||
|
||||
/** Get the banned mask for this entry
|
||||
* @return The mask
|
||||
|
||||
+3
-6
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -18,22 +18,19 @@
|
||||
#include "anope.h"
|
||||
#include "base.h"
|
||||
#include "bots.h"
|
||||
#include "botserv.h"
|
||||
#include "channels.h"
|
||||
#include "commands.h"
|
||||
#include "config.h"
|
||||
#include "dns.h"
|
||||
#include "extensible.h"
|
||||
#include "extern.h"
|
||||
#include "hashcomp.h"
|
||||
#include "language.h"
|
||||
#include "lists.h"
|
||||
#include "logger.h"
|
||||
#include "mail.h"
|
||||
#include "memo.h"
|
||||
#include "messages.h"
|
||||
#include "modes.h"
|
||||
#include "modules.h"
|
||||
#include "oper.h"
|
||||
#include "opertype.h"
|
||||
#include "protocol.h"
|
||||
#include "regexpr.h"
|
||||
@@ -42,13 +39,13 @@
|
||||
#include "servers.h"
|
||||
#include "service.h"
|
||||
#include "services.h"
|
||||
#include "signals.h"
|
||||
#include "socketengine.h"
|
||||
#include "sockets.h"
|
||||
#include "threadengine.h"
|
||||
#include "timers.h"
|
||||
#include "uplink.h"
|
||||
#include "users.h"
|
||||
#include "xline.h"
|
||||
|
||||
#include "global.h"
|
||||
#include "memoserv.h"
|
||||
|
||||
+103
-78
@@ -1,12 +1,13 @@
|
||||
/* Modular support
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 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 "serialize.h"
|
||||
@@ -31,7 +32,7 @@
|
||||
{ \
|
||||
return new x(modname, creator); \
|
||||
} \
|
||||
BOOLEAN WINAPI DllMain(HINSTANCE, DWORD nReason, LPVOID) \
|
||||
BOOLEAN WINAPI DllMain(HINSTANCE, DWORD, LPVOID) \
|
||||
{ \
|
||||
return TRUE; \
|
||||
} \
|
||||
@@ -120,7 +121,6 @@ enum EventReturn
|
||||
EVENT_ALLOW
|
||||
};
|
||||
|
||||
|
||||
enum ModuleReturn
|
||||
{
|
||||
MOD_ERR_OK,
|
||||
@@ -141,29 +141,23 @@ enum Priority { PRIORITY_FIRST, PRIORITY_DONTCARE, PRIORITY_LAST, PRIORITY_BEFOR
|
||||
/* Module types, in the order in which they are unloaded. The order these are in is IMPORTANT */
|
||||
enum ModType { MT_BEGIN, THIRD, SUPPORTED, CORE, DATABASE, ENCRYPTION, PROTOCOL, MT_END };
|
||||
|
||||
typedef std::multimap<Anope::string, Message *> message_map;
|
||||
extern CoreExport message_map MessageMap;
|
||||
|
||||
extern CoreExport std::list<Module *> Modules;
|
||||
|
||||
/** Returned by Module::GetVersion, used to see what version of Anope
|
||||
* a module is compiled against.
|
||||
*/
|
||||
class ModuleVersion
|
||||
{
|
||||
private:
|
||||
int Major;
|
||||
int Minor;
|
||||
int Patch;
|
||||
int version_major;
|
||||
int version_minor;
|
||||
int version_patch;
|
||||
|
||||
public:
|
||||
/** Constructor
|
||||
* @param vMajor The major version numbber
|
||||
* @param vMinor The minor version numbber
|
||||
* @param vPatch The patch version numbber
|
||||
* @param major The major version numbber
|
||||
* @param minor The minor version numbber
|
||||
* @param patch The patch version numbber
|
||||
*/
|
||||
ModuleVersion(int vMajor, int vMinor, int vPatch);
|
||||
|
||||
/** Destructor
|
||||
*/
|
||||
virtual ~ModuleVersion();
|
||||
ModuleVersion(int major, int minor, int patch);
|
||||
|
||||
/** Get the major version of Anope this was built against
|
||||
* @return The major version
|
||||
@@ -203,7 +197,7 @@ class CoreExport Module : public Extensible
|
||||
|
||||
/** Callbacks used in this module
|
||||
*/
|
||||
std::list<CallBack *> CallBacks;
|
||||
std::list<CallBack *> callbacks;
|
||||
|
||||
/** Handle for this module, obtained from dlopen()
|
||||
*/
|
||||
@@ -262,13 +256,17 @@ class CoreExport Module : public Extensible
|
||||
*/
|
||||
ModuleVersion GetVersion() const;
|
||||
|
||||
/* Everything below here are events. Modules must ModuleManager::Attach to these events
|
||||
* before they will be called.
|
||||
*/
|
||||
|
||||
/** Called when the ircd notifies that a user has been kicked from a channel.
|
||||
* @param c The channel the user has been kicked from.
|
||||
* @param target The user that has been kicked.
|
||||
* @param source The nick of the sender.
|
||||
* @param kickmsg The reason for the kick.
|
||||
*/
|
||||
virtual void OnUserKicked(Channel *c, User *target, const Anope::string &source, const Anope::string &kickmsg) { }
|
||||
virtual void OnUserKicked(Channel *c, User *target, MessageSource &source, const Anope::string &kickmsg) { }
|
||||
|
||||
/** Called when Services' configuration has been loaded.
|
||||
*/
|
||||
@@ -293,7 +291,7 @@ class CoreExport Module : public Extensible
|
||||
* @param u The connecting user.
|
||||
* @param exempt set to true/is true if the user should be excepted from bans etc
|
||||
*/
|
||||
virtual void OnUserConnect(dynamic_reference<User> &u, bool &exempt) { }
|
||||
virtual void OnUserConnect(User *u, bool &exempt) { }
|
||||
|
||||
/** Called when a new server connects to the network.
|
||||
* @param s The server that has connected to the network
|
||||
@@ -351,20 +349,22 @@ class CoreExport Module : public Extensible
|
||||
virtual EventReturn OnDecrypt(const Anope::string &hashm, const Anope::string &src, Anope::string &dest) { return EVENT_CONTINUE; }
|
||||
|
||||
/** Called on fantasy command
|
||||
* @param command The command
|
||||
* @param u The user using the command
|
||||
* @param source The source of the command
|
||||
* @param c The command
|
||||
* @param ci The channel it's being used in
|
||||
* @param params The params
|
||||
* @return EVENT_STOP to halt processing and not run the command, EVENT_ALLOW to allow the command to be executed
|
||||
*/
|
||||
virtual void OnBotFantasy(const Anope::string &command, User *u, ChannelInfo *ci, const Anope::string ¶ms) { }
|
||||
virtual EventReturn OnBotFantasy(CommandSource &source, Command *c, ChannelInfo *ci, const std::vector<Anope::string> ¶ms) { return EVENT_CONTINUE; }
|
||||
|
||||
/** Called on fantasy command without access
|
||||
* @param command The command
|
||||
* @param u The user using the command
|
||||
* @param source The source of the command
|
||||
* @param c The command
|
||||
* @param ci The channel it's being used in
|
||||
* @param params The params
|
||||
* @return EVENT_STOP to halt processing and not run the command, EVENT_ALLOW to allow the command to be executed
|
||||
*/
|
||||
virtual void OnBotNoFantasyAccess(const Anope::string &command, User *u, ChannelInfo *ci, const Anope::string ¶ms) { }
|
||||
virtual EventReturn OnBotNoFantasyAccess(CommandSource &source, Command *c, ChannelInfo *ci, const std::vector<Anope::string> ¶ms) { return EVENT_CONTINUE; }
|
||||
|
||||
/** Called after a bot joins a channel
|
||||
* @param c The channel
|
||||
@@ -439,7 +439,7 @@ class CoreExport Module : public Extensible
|
||||
* @param setter The user who set the new topic
|
||||
* @param topic The new topic
|
||||
*/
|
||||
virtual void OnTopicUpdated(Channel *c, User *setter, const Anope::string &topic) { }
|
||||
virtual void OnTopicUpdated(Channel *c, const Anope::string &user, const Anope::string &topic) { }
|
||||
|
||||
/** Called before a channel expires
|
||||
* @param ci The channel
|
||||
@@ -536,10 +536,12 @@ class CoreExport Module : public Extensible
|
||||
*/
|
||||
virtual void OnUserQuit(User *u, const Anope::string &msg) { }
|
||||
|
||||
/** Called when a user disconnects
|
||||
/** Called when a user disconnects, before and after being internally removed from
|
||||
* all lists (channels, user list, etc)
|
||||
* @param u The user
|
||||
*/
|
||||
virtual void OnUserLogoff(User *u) { }
|
||||
virtual void OnPreUserLogoff(User *u) { }
|
||||
virtual void OnPostUserLogoff(User *u) { }
|
||||
|
||||
/** Called when a new bot is made
|
||||
* @param bi The bot
|
||||
@@ -642,17 +644,19 @@ class CoreExport Module : public Extensible
|
||||
* @param u The user
|
||||
* @param ci The channel
|
||||
* @param kick Set to true to kick
|
||||
* @return EVENT_ALLOW to stop processing immediatly
|
||||
* @param mask The mask to ban, if any
|
||||
* @param reason The reason for the kick
|
||||
* @return EVENT_STOP to prevent the user from joining by kicking/banning the user
|
||||
*/
|
||||
virtual EventReturn OnCheckKick(User *u, ChannelInfo *ci, bool &kick) { return EVENT_CONTINUE; }
|
||||
virtual EventReturn OnCheckKick(User *u, ChannelInfo *ci, Anope::string &mask, Anope::string &reason) { return EVENT_CONTINUE; }
|
||||
|
||||
/** Called when a user requests info for a channel
|
||||
* @param source The user requesting info
|
||||
* @param ci The channel the user is requesting info for
|
||||
* @param info Data to show the user requesting information
|
||||
* @param ShowHidden 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 ShowHidden) { }
|
||||
virtual void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_hidden) { }
|
||||
|
||||
/** Checks if access has the channel privilege 'priv'.
|
||||
* @param access THe access struct
|
||||
@@ -764,19 +768,15 @@ class CoreExport Module : public Extensible
|
||||
* @param source The user requesting info
|
||||
* @param na The nick the user is requesting info from
|
||||
* @param info Data to show the user requesting information
|
||||
* @param ShowHidden 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 ShowHidden) { }
|
||||
virtual void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) { }
|
||||
|
||||
/** Check whether a users password is correct.
|
||||
* @param u The user
|
||||
* @param command The command the user is doing
|
||||
* @param params Command params
|
||||
* @param account The account the password should be checked against
|
||||
* @param password The password
|
||||
* @return EVENT_ALLOW to allow the password, EVENT_STOP to stop processing completely
|
||||
/** Check whether a username and password is correct
|
||||
* @param u The user trying to identify, if applicable.
|
||||
* @param req The login request
|
||||
*/
|
||||
virtual EventReturn OnCheckAuthentication(Command *c, CommandSource *source, const std::vector<Anope::string> ¶ms, const Anope::string &account, const Anope::string &password) { return EVENT_CONTINUE; }
|
||||
virtual void OnCheckAuthentication(User *u, IdentifyRequest *req) { }
|
||||
|
||||
/** Called when a user does /ns update
|
||||
* @param u The user
|
||||
@@ -828,33 +828,33 @@ class CoreExport Module : public Extensible
|
||||
|
||||
/** Called when a mode is set on a channel
|
||||
* @param c The channel
|
||||
* @param setter The user who is setting the mode
|
||||
* @param Name The mode name
|
||||
* @param setter The user or server that is setting the mode
|
||||
* @param mname The mode name
|
||||
* @param param The mode param, if there is one
|
||||
* @return EVENT_STOP to make mlock/secureops etc checks not happen
|
||||
*/
|
||||
virtual EventReturn OnChannelModeSet(Channel *c, User *setter, ChannelModeName Name, const Anope::string ¶m) { return EVENT_CONTINUE; }
|
||||
virtual EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, const Anope::string &mname, const Anope::string ¶m) { return EVENT_CONTINUE; }
|
||||
|
||||
/** Called when a mode is unset on a channel
|
||||
* @param c The channel
|
||||
* @param setter the user who is unsetting the mode
|
||||
* @param Name The mode name
|
||||
* @param setter The user or server that is unsetting the mode
|
||||
* @param mname The mode name
|
||||
* @param param The mode param, if there is one
|
||||
* @return EVENT_STOP to make mlock/secureops etc checks not happen
|
||||
*/
|
||||
virtual EventReturn OnChannelModeUnset(Channel *c, User *setter, ChannelModeName Name, const Anope::string ¶m) { return EVENT_CONTINUE; }
|
||||
virtual EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, const Anope::string &mname, const Anope::string ¶m) { return EVENT_CONTINUE; }
|
||||
|
||||
/** Called when a mode is set on a user
|
||||
* @param u The user
|
||||
* @param Name The mode name
|
||||
* @param mname The mode name
|
||||
*/
|
||||
virtual void OnUserModeSet(User *u, UserModeName Name) { }
|
||||
virtual void OnUserModeSet(User *u, const Anope::string &mname) { }
|
||||
|
||||
/** Called when a mode is unset from a user
|
||||
* @param u The user
|
||||
* @param Name The mode name
|
||||
* @param mname The mode name
|
||||
*/
|
||||
virtual void OnUserModeUnset(User *u, UserModeName Name) { }
|
||||
virtual void OnUserModeUnset(User *u, const Anope::string &mname) { }
|
||||
|
||||
/** Called when a channel mode is introducted into Anope
|
||||
* @param cm The mode
|
||||
@@ -922,6 +922,12 @@ class CoreExport Module : public Extensible
|
||||
*/
|
||||
virtual void OnLog(Log *l) { }
|
||||
|
||||
/** Called when a DNS request (question) is recieved.
|
||||
* @param req The dns request
|
||||
* @param reply The reply that will be sent
|
||||
*/
|
||||
virtual void OnDnsRequest(DNS::Packet &req, DNS::Packet *reply) { }
|
||||
|
||||
/** Called when a channels modes are being checked to see if they are allowed,
|
||||
* mostly to ensure mlock/+r are set.
|
||||
* @param c The channel
|
||||
@@ -929,11 +935,37 @@ class CoreExport Module : public Extensible
|
||||
*/
|
||||
virtual EventReturn OnCheckModes(Channel *c) { return EVENT_CONTINUE; }
|
||||
|
||||
virtual void OnSerializeCheck(SerializeType *) { }
|
||||
virtual void OnSerializeCheck(Serialize::Type *) { }
|
||||
virtual void OnSerializableConstruct(Serializable *) { }
|
||||
virtual void OnSerializableDestruct(Serializable *) { }
|
||||
virtual void OnSerializePtrAssign(Serializable *) { }
|
||||
virtual void OnSerializableUpdate(Serializable *) { }
|
||||
virtual void OnSerializeTypeCreate(Serialize::Type *) { }
|
||||
|
||||
/** Called when a chanserv/set command is used
|
||||
* @param source The source of the command
|
||||
* @param cmd The command
|
||||
* @param ci The channel the command was used on
|
||||
* @param setting The setting passed to the command. Probably ON/OFF.
|
||||
* @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) { return EVENT_CONTINUE; }
|
||||
|
||||
/** Called when a nickserv/set command is used.
|
||||
* @param source The source of the command
|
||||
* @param cmd The command
|
||||
* @param nc The nickcore being modifed
|
||||
* @param setting The setting passed to the command. Probably ON/OFF.
|
||||
* @return EVENT_STOP to halt immediately
|
||||
*/
|
||||
virtual EventReturn OnSetNickOption(CommandSource &source, Command *cmd, NickCore *nc, const Anope::string &setting) { return EVENT_CONTINUE; }
|
||||
|
||||
/** Called whenever a message is received from the uplink
|
||||
* @param source The source of the message
|
||||
* @param command The command being executed
|
||||
* @param params Parameters
|
||||
* @return EVENT_STOP to prevent the protocol module from processing this message
|
||||
*/
|
||||
virtual EventReturn OnMessage(MessageSource &source, Anope::string &command, std::vector<Anope::string> ¶m) { return EVENT_CONTINUE; }
|
||||
};
|
||||
|
||||
/** Implementation-specific flags which may be set in ModuleManager::Attach()
|
||||
@@ -943,18 +975,15 @@ enum Implementation
|
||||
I_BEGIN,
|
||||
/* NickServ */
|
||||
I_OnPreNickExpire, I_OnNickExpire, I_OnNickForbidden, I_OnNickGroup, I_OnNickLogout, I_OnNickIdentify, I_OnNickDrop,
|
||||
I_OnNickRegister, I_OnNickSuspended, I_OnNickUnsuspended,
|
||||
I_OnDelNick, I_OnDelCore, I_OnChangeCoreDisplay,
|
||||
I_OnNickClearAccess, I_OnNickAddAccess, I_OnNickEraseAccess,
|
||||
I_OnNickClearCert, I_OnNickAddCert, I_OnNickEraseCert,
|
||||
I_OnNickInfo, I_OnCheckAuthentication,
|
||||
I_OnNickUpdate,
|
||||
I_OnNickRegister, I_OnNickSuspended, I_OnNickUnsuspended, I_OnDelNick, I_OnDelCore, I_OnChangeCoreDisplay,
|
||||
I_OnNickClearAccess, I_OnNickAddAccess, I_OnNickEraseAccess, I_OnNickClearCert, I_OnNickAddCert, I_OnNickEraseCert,
|
||||
I_OnNickInfo, I_OnCheckAuthentication, I_OnNickUpdate, I_OnSetNickOption,
|
||||
|
||||
/* ChanServ */
|
||||
I_OnChanSuspend, I_OnChanDrop, I_OnPreChanExpire, I_OnChanExpire, I_OnAccessAdd,
|
||||
I_OnAccessDel, I_OnAccessClear, I_OnLevelChange, I_OnChanRegistered, I_OnChanUnsuspend, I_OnCreateChan, I_OnDelChan, I_OnChannelCreate,
|
||||
I_OnChannelDelete, I_OnAkickAdd, I_OnAkickDel, I_OnCheckKick, I_OnCheckModes,
|
||||
I_OnChanInfo, I_OnCheckPriv, I_OnGroupCheckPriv,
|
||||
I_OnChanInfo, I_OnCheckPriv, I_OnGroupCheckPriv, I_OnSetChannelOption,
|
||||
|
||||
/* BotServ */
|
||||
I_OnBotJoin, I_OnBotKick, I_OnBotCreate, I_OnBotChange, I_OnBotDelete, I_OnBotAssign, I_OnBotUnAssign,
|
||||
@@ -967,7 +996,7 @@ enum Implementation
|
||||
I_OnMemoSend, I_OnMemoDel,
|
||||
|
||||
/* Users */
|
||||
I_OnUserConnect, I_OnUserNickChange, I_OnUserQuit, I_OnUserLogoff, I_OnPreJoinChannel,
|
||||
I_OnUserConnect, I_OnUserNickChange, I_OnUserQuit, I_OnPreUserLogoff, I_OnPostUserLogoff, I_OnPreJoinChannel,
|
||||
I_OnJoinChannel, I_OnPrePartChannel, I_OnPartChannel, I_OnLeaveChannel, I_OnFingerprint, I_OnUserAway,
|
||||
|
||||
/* OperServ */
|
||||
@@ -986,9 +1015,10 @@ enum Implementation
|
||||
I_OnServerQuit, I_OnTopicUpdated,
|
||||
I_OnEncrypt, I_OnDecrypt,
|
||||
I_OnChannelModeSet, I_OnChannelModeUnset, I_OnUserModeSet, I_OnUserModeUnset, I_OnChannelModeAdd, I_OnUserModeAdd,
|
||||
I_OnMLock, I_OnUnMLock, I_OnServerSync, I_OnUplinkSync, I_OnBotPrivmsg, I_OnPrivmsg, I_OnLog,
|
||||
I_OnMLock, I_OnUnMLock, I_OnServerSync, I_OnUplinkSync, I_OnBotPrivmsg, I_OnPrivmsg, I_OnLog, I_OnDnsRequest,
|
||||
I_OnMessage,
|
||||
|
||||
I_OnSerializeCheck, I_OnSerializableConstruct, I_OnSerializableDestruct, I_OnSerializePtrAssign, I_OnSerializableUpdate,
|
||||
I_OnSerializeCheck, I_OnSerializableConstruct, I_OnSerializableDestruct, I_OnSerializableUpdate, I_OnSerializeTypeCreate,
|
||||
I_END
|
||||
};
|
||||
|
||||
@@ -997,6 +1027,10 @@ enum Implementation
|
||||
class CoreExport ModuleManager
|
||||
{
|
||||
public:
|
||||
/** List of all modules loaded in Anope
|
||||
*/
|
||||
static std::list<Module *> Modules;
|
||||
|
||||
/** Event handler hooks.
|
||||
* This needs to be public to be used by FOREACH_MOD and friends.
|
||||
*/
|
||||
@@ -1109,7 +1143,8 @@ class CoreExport ModuleManager
|
||||
static ModuleReturn DeleteModule(Module *m);
|
||||
};
|
||||
|
||||
/** Class used for callbacks within modules
|
||||
/** Class used for callbacks within modules. These are identical to Timers hwoever
|
||||
* they will be cleaned up automatically when a module is unloaded, and Timers will not.
|
||||
*/
|
||||
class CoreExport CallBack : public Timer
|
||||
{
|
||||
@@ -1121,14 +1156,4 @@ class CoreExport CallBack : public Timer
|
||||
virtual ~CallBack();
|
||||
};
|
||||
|
||||
class CoreExport Message
|
||||
{
|
||||
public:
|
||||
Anope::string name;
|
||||
bool (*func)(const Anope::string &source, const std::vector<Anope::string> ¶ms);
|
||||
|
||||
Message(const Anope::string &n, bool (*f)(const Anope::string &, const std::vector<Anope::string> &));
|
||||
~Message();
|
||||
};
|
||||
|
||||
#endif // MODULES_H
|
||||
|
||||
+11
-3
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
|
||||
* Copyright (C) 2008-2012 Anope Team <team@anope.org>
|
||||
* Copyright (C) 2008-2013 Anope Team <team@anope.org>
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef OPERTYPE_H
|
||||
@@ -11,19 +12,26 @@
|
||||
#include "services.h"
|
||||
#include "account.h"
|
||||
|
||||
/* A services operator. Usually made by the configuration file, but not always.
|
||||
* NickAlias::Find(name)->nc->o == this
|
||||
*/
|
||||
struct CoreExport Oper
|
||||
{
|
||||
/* The oper's nick */
|
||||
Anope::string name;
|
||||
/* The type of operator this operator is */
|
||||
OperType *ot;
|
||||
/* Whether the user must be an IRC operator (umode +o) to be considered a services operator */
|
||||
bool require_oper;
|
||||
Anope::string password;
|
||||
Anope::string certfp;
|
||||
/* True if this operator is set in the config */
|
||||
bool config;
|
||||
|
||||
/* Hosts allowed to use this operator block */
|
||||
std::vector<Anope::string> hosts;
|
||||
Anope::string vhost;
|
||||
|
||||
Oper(const Anope::string &n, OperType *o) : name(n), ot(o) { this->config = false; }
|
||||
Oper(const Anope::string &n, OperType *o) : name(n), ot(o), require_oper(false), config(false) { }
|
||||
|
||||
virtual ~Oper() { }
|
||||
|
||||
|
||||
+194
-83
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -8,7 +8,6 @@
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef PROTOCOL_H
|
||||
@@ -16,40 +15,19 @@
|
||||
|
||||
#include "services.h"
|
||||
#include "anope.h"
|
||||
#include "service.h"
|
||||
|
||||
/* Protocol tweaks */
|
||||
|
||||
struct IRCDVar
|
||||
/* Encapsultes the IRCd protocol we are speaking. */
|
||||
class CoreExport IRCDProto : public Service
|
||||
{
|
||||
const char *name; /* Name of the IRCd command */
|
||||
const char *pseudoclient_mode; /* Mode used by BotServ Bots */
|
||||
int svsnick; /* Supports SVSNICK */
|
||||
int vhost; /* Supports vhost */
|
||||
int snline; /* Supports SNline */
|
||||
int sqline; /* Supports SQline */
|
||||
int szline; /* Supports SZline */
|
||||
int join2msg; /* Join 2 Message */
|
||||
int chansqline; /* Supports Channel Sqlines */
|
||||
int quitonkill; /* IRCD sends QUIT when kill */
|
||||
int vident; /* Supports vidents */
|
||||
int svshold; /* Supports svshold */
|
||||
int tsonmode; /* Timestamp on mode changes */
|
||||
int omode; /* On the fly o:lines */
|
||||
int umode; /* change user modes */
|
||||
int knock_needs_i; /* Check if we needed +i when setting NOKNOCK */
|
||||
int svsmode_ucmode; /* Can remove User Channel Modes with SVSMODE */
|
||||
int sglineenforce;
|
||||
int ts6; /* ircd is TS6 */
|
||||
const char *globaltldprefix; /* TLD prefix used for Global */
|
||||
unsigned maxmodes; /* Max modes to send per line */
|
||||
int certfp; /* IRCd sends a SSL users certificate fingerprint */
|
||||
};
|
||||
Anope::string proto_name;
|
||||
|
||||
|
||||
class CoreExport IRCDProto
|
||||
{
|
||||
protected:
|
||||
virtual void SendSVSKillInternal(const BotInfo *, const User *, const Anope::string &);
|
||||
IRCDProto(Module *creator, const Anope::string &proto_name);
|
||||
public:
|
||||
virtual ~IRCDProto();
|
||||
|
||||
virtual void SendSVSKillInternal(const BotInfo *, User *, const Anope::string &);
|
||||
virtual void SendModeInternal(const BotInfo *, const Channel *, const Anope::string &);
|
||||
virtual void SendModeInternal(const BotInfo *, const User *, const Anope::string &) = 0;
|
||||
virtual void SendKickInternal(const BotInfo *, const Channel *, const User *, const Anope::string &);
|
||||
@@ -61,56 +39,172 @@ class CoreExport IRCDProto
|
||||
virtual void SendGlobopsInternal(const BotInfo *source, const Anope::string &buf);
|
||||
virtual void SendCTCPInternal(const BotInfo *bi, const Anope::string &dest, const Anope::string &buf);
|
||||
virtual void SendNumericInternal(int numeric, const Anope::string &dest, const Anope::string &buf);
|
||||
public:
|
||||
virtual ~IRCDProto() { }
|
||||
|
||||
virtual void SendSVSNOOP(const Server *, bool) { }
|
||||
const Anope::string &GetProtocolName();
|
||||
/* Modes used by default by our clients */
|
||||
Anope::string DefaultPseudoclientModes;
|
||||
/* Can we force change a users's nick? */
|
||||
bool CanSVSNick;
|
||||
/* Can we force join or part users? */
|
||||
bool CanSVSJoin;
|
||||
/* Can we set vhosts/vidents on users? */
|
||||
bool CanSetVHost, CanSetVIdent;
|
||||
/* Can we ban specific gecos from being used? */
|
||||
bool CanSNLine;
|
||||
/* Can we ban specific nicknames from being used? */
|
||||
bool CanSQLine;
|
||||
/* Can we ban sepcific channel names from being used? */
|
||||
bool CanSQLineChannel;
|
||||
/* Can we ban by IP? */
|
||||
bool CanSZLine;
|
||||
/* Can we place temporary holds on specific nicknames? */
|
||||
bool CanSVSHold;
|
||||
/* See os_oline */
|
||||
bool CanSVSO;
|
||||
/* See ns_cert */
|
||||
bool CanCertFP;
|
||||
/* Whether this IRCd requires unique IDs for each user or server. See TS6/P10. */
|
||||
bool RequiresID;
|
||||
/* The maximum number of modes we are allowed to set with one MODE command */
|
||||
unsigned MaxModes;
|
||||
|
||||
/** Sets the server in NOOP mode. If NOOP mode is enabled, no users
|
||||
* will be able to oper on the server.
|
||||
* @param s The server
|
||||
* @param mode Whether to turn NOOP on or off
|
||||
*/
|
||||
virtual void SendSVSNOOP(const Server *s, bool mode) { }
|
||||
|
||||
/** Sets the topic on a channel
|
||||
* @param bi The bot to set the topic from
|
||||
* @param c The channel to set the topic on. The topic being set is Channel::topic
|
||||
*/
|
||||
virtual void SendTopic(BotInfo *, Channel *);
|
||||
|
||||
/** Sets a vhost on a user.
|
||||
* @param u The user
|
||||
* @param vident The ident to set
|
||||
* @param vhost The vhost to set
|
||||
*/
|
||||
virtual void SendVhost(User *u, const Anope::string &vident, const Anope::string &vhost) { }
|
||||
virtual void SendVhostDel(User *) { }
|
||||
|
||||
/** Sets an akill. This is a recursive function that can be called multiple times
|
||||
* for the same xline, but for different users, if the xline is not one that can be
|
||||
* enforced by the IRCd, such as a nick/user/host/realname combination ban.
|
||||
* @param u The user affected by the akill, if known
|
||||
* @param x The akill
|
||||
*/
|
||||
virtual void SendAkill(User *, XLine *) = 0;
|
||||
virtual void SendAkillDel(const XLine *) = 0;
|
||||
virtual void SendSVSKill(const BotInfo *source, const User *user, const char *fmt, ...);
|
||||
|
||||
/* Realname ban */
|
||||
virtual void SendSGLine(User *, const XLine *) { }
|
||||
virtual void SendSGLineDel(const XLine *) { }
|
||||
|
||||
/* IP ban */
|
||||
virtual void SendSZLine(User *u, const XLine *) { }
|
||||
virtual void SendSZLineDel(const XLine *) { }
|
||||
|
||||
/* Nick ban (and sometimes channel) */
|
||||
virtual void SendSQLine(User *, const XLine *x) { }
|
||||
virtual void SendSQLineDel(const XLine *x) { }
|
||||
|
||||
/** Kills a user
|
||||
* @param source The client used to kill the user, if any
|
||||
* @param user The user to be killed
|
||||
* @param fmt Kill reason
|
||||
*/
|
||||
virtual void SendSVSKill(const BotInfo *source, User *user, const char *fmt, ...);
|
||||
|
||||
virtual void SendMode(const BotInfo *bi, const Channel *dest, const char *fmt, ...);
|
||||
virtual void SendMode(const BotInfo *bi, const User *u, const char *fmt, ...);
|
||||
|
||||
/** Introduces a client to the rest of the network
|
||||
* @param u The client to introduce
|
||||
*/
|
||||
virtual void SendClientIntroduction(const User *u) = 0;
|
||||
|
||||
virtual void SendKick(const BotInfo *bi, const Channel *chan, const User *user, const char *fmt, ...);
|
||||
|
||||
/* Sends a message using SendPrivmsg or SendNotice, depending on the default message method. */
|
||||
virtual void SendMessage(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
|
||||
virtual void SendNotice(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
|
||||
virtual void SendAction(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
|
||||
virtual void SendPrivmsg(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
|
||||
virtual void SendGlobalNotice(const BotInfo *bi, const Server *dest, const Anope::string &msg);
|
||||
virtual void SendGlobalPrivmsg(const BotInfo *bi, const Server *desc, const Anope::string &msg);
|
||||
virtual void SendAction(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
|
||||
virtual void SendCTCP(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
|
||||
|
||||
virtual void SendGlobalNotice(const BotInfo *bi, const Server *dest, const Anope::string &msg) = 0;
|
||||
virtual void SendGlobalPrivmsg(const BotInfo *bi, const Server *desc, const Anope::string &msg) = 0;
|
||||
|
||||
virtual void SendQuit(const User *u, const char *fmt, ...);
|
||||
virtual void SendPing(const Anope::string &servname, const Anope::string &who);
|
||||
virtual void SendPong(const Anope::string &servname, const Anope::string &who);
|
||||
virtual void SendJoin(const User *, Channel *, const ChannelStatus *) = 0;
|
||||
virtual void SendSQLineDel(const XLine *x) { }
|
||||
virtual void SendInvite(const BotInfo *bi, const Channel *c, const User *u);
|
||||
|
||||
/** Joins one of our users to a channel.
|
||||
* @param u The user to join
|
||||
* @param c The channel to join the user to
|
||||
* @param status The status to set on the user after joining. This may or may not already internally
|
||||
* be set on the user. This may include the modes in the join, but will usually place them on the mode
|
||||
* stacker to be set "soon".
|
||||
*/
|
||||
virtual void SendJoin(const User *u, Channel *c, const ChannelStatus *status) = 0;
|
||||
virtual void SendPart(const BotInfo *bi, const Channel *chan, const char *fmt, ...);
|
||||
|
||||
/** Force joins a user that isn't ours to a channel.
|
||||
* @param bi The source of the message
|
||||
* @param u The user to join
|
||||
* @param chan The channel to join the user to
|
||||
* @param param Channel key?
|
||||
*/
|
||||
virtual void SendSVSJoin(const BotInfo *bi, const User *u, const Anope::string &chan, const Anope::string ¶m) { }
|
||||
|
||||
/** Force parts a user that isn't ours from a channel.
|
||||
* @param bi The source of the message
|
||||
* @param u The user to part
|
||||
* @param chan The channel to part the user from
|
||||
* @param param part reason, some IRCds don't support this
|
||||
*/
|
||||
virtual void SendSVSPart(const BotInfo *bi, const User *u, const Anope::string &chan, const Anope::string ¶m) { }
|
||||
|
||||
virtual void SendInvite(const BotInfo *bi, const Channel *c, const User *u);
|
||||
virtual void SendGlobops(const BotInfo *source, const char *fmt, ...);
|
||||
virtual void SendSQLine(User *, const XLine *x) { }
|
||||
virtual void SendSquit(Server *, const Anope::string &message);
|
||||
|
||||
/** Sets oper flags on a user, currently only supported by Unreal
|
||||
*/
|
||||
virtual void SendSVSO(const BotInfo *, const Anope::string &, const Anope::string &) { }
|
||||
virtual void SendChangeBotNick(const BotInfo *bi, const Anope::string &newnick);
|
||||
|
||||
/** Sends a nick change of one of our clients.
|
||||
*/
|
||||
virtual void SendNickChange(const User *u, const Anope::string &newnick);
|
||||
|
||||
/** Forces a nick change of a user that isn't ours (SVSNICK)
|
||||
*/
|
||||
virtual void SendForceNickChange(const User *u, const Anope::string &newnick, time_t when);
|
||||
virtual void SendVhost(User *, const Anope::string &, const Anope::string &) { }
|
||||
|
||||
/** Used to introduce ourselves to our uplink. Usually will SendServer(Me) and any other
|
||||
* initial handshake requirements.
|
||||
*/
|
||||
virtual void SendConnect() = 0;
|
||||
virtual void SendSVSHold(const Anope::string &) { }
|
||||
virtual void SendSVSHoldDel(const Anope::string &) { }
|
||||
virtual void SendSGLineDel(const XLine *) { }
|
||||
virtual void SendSZLineDel(const XLine *) { }
|
||||
virtual void SendSZLine(User *u, const XLine *) { }
|
||||
virtual void SendSGLine(User *, const XLine *) { }
|
||||
virtual void SendCTCP(const BotInfo *bi, const Anope::string &dest, const char *fmt, ...);
|
||||
virtual void SendSVSJoin(const BotInfo *bi, const Anope::string &, const Anope::string &, const Anope::string &) { }
|
||||
virtual void SendSWhois(const BotInfo *bi, const Anope::string &, const Anope::string &) { }
|
||||
|
||||
/** Called right before we begin our burst, after we have handshaked successfully with the uplink/
|
||||
* At this point none of our servesr, users, or channels exist on the uplink
|
||||
*/
|
||||
virtual void SendBOB() { }
|
||||
virtual void SendEOB() { }
|
||||
|
||||
virtual void SendSVSHold(const Anope::string &) { }
|
||||
virtual void SendSVSHoldDel(const Anope::string &) { }
|
||||
|
||||
virtual void SendSWhois(const BotInfo *bi, const Anope::string &, const Anope::string &) { }
|
||||
|
||||
/** Introduces a server to the uplink
|
||||
*/
|
||||
virtual void SendServer(const Server *) = 0;
|
||||
virtual bool IsNickValid(const Anope::string &) { return true; }
|
||||
virtual bool IsChannelValid(const Anope::string &);
|
||||
virtual void SendSquit(Server *, const Anope::string &message);
|
||||
|
||||
virtual void SendNumeric(int numeric, const Anope::string &dest, const char *fmt, ...);
|
||||
|
||||
virtual void SendLogin(User *u) = 0;
|
||||
virtual void SendLogout(User *u) = 0;
|
||||
|
||||
@@ -118,38 +212,55 @@ class CoreExport IRCDProto
|
||||
* On most TS6 IRCds this is a SJOIN with no nick
|
||||
*/
|
||||
virtual void SendChannel(Channel *c) { }
|
||||
|
||||
/** Make the user an IRC operator
|
||||
* Normally this is a simple +o, though some IRCds require us to send the oper type
|
||||
*/
|
||||
virtual void SendOper(User *u);
|
||||
|
||||
virtual bool IsNickValid(const Anope::string &);
|
||||
virtual bool IsChannelValid(const Anope::string &);
|
||||
virtual bool IsIdentValid(const Anope::string &);
|
||||
virtual bool IsHostValid(const Anope::string &);
|
||||
};
|
||||
|
||||
class CoreExport IRCdMessage
|
||||
class CoreExport MessageSource
|
||||
{
|
||||
Anope::string source;
|
||||
User *u;
|
||||
Server *s;
|
||||
|
||||
public:
|
||||
virtual bool On436(const Anope::string &, const std::vector<Anope::string> &);
|
||||
virtual bool OnAway(const Anope::string &, const std::vector<Anope::string> &);
|
||||
virtual bool OnJoin(const Anope::string &, const std::vector<Anope::string> &);
|
||||
virtual bool OnKick(const Anope::string &, const std::vector<Anope::string> &);
|
||||
virtual bool OnKill(const Anope::string &, const std::vector<Anope::string> &);
|
||||
virtual bool OnMode(const Anope::string &, const std::vector<Anope::string> &) = 0;
|
||||
virtual bool OnUID(const Anope::string &, const std::vector<Anope::string> &);
|
||||
virtual bool OnNick(const Anope::string &, const std::vector<Anope::string> &) = 0;
|
||||
virtual bool OnPart(const Anope::string &, const std::vector<Anope::string> &);
|
||||
virtual bool OnPing(const Anope::string &, const std::vector<Anope::string> &);
|
||||
virtual bool OnPrivmsg(const Anope::string &, const std::vector<Anope::string> &);
|
||||
virtual bool OnQuit(const Anope::string &, const std::vector<Anope::string> &);
|
||||
virtual bool OnServer(const Anope::string &, const std::vector<Anope::string> &) = 0;
|
||||
virtual bool OnSQuit(const Anope::string &, const std::vector<Anope::string> &);
|
||||
virtual bool OnTopic(const Anope::string &, const std::vector<Anope::string> &) = 0;
|
||||
virtual bool OnWhois(const Anope::string &, const std::vector<Anope::string> &);
|
||||
virtual bool OnCapab(const Anope::string &, const std::vector<Anope::string> &);
|
||||
virtual bool OnSJoin(const Anope::string &, const std::vector<Anope::string> &) = 0;
|
||||
virtual bool OnError(const Anope::string &, const std::vector<Anope::string> &);
|
||||
MessageSource(const Anope::string &);
|
||||
MessageSource(User *u);
|
||||
MessageSource(Server *s);
|
||||
const Anope::string GetName();
|
||||
const Anope::string &GetSource();
|
||||
User *GetUser();
|
||||
Server *GetServer();
|
||||
};
|
||||
|
||||
extern CoreExport IRCDVar *ircd;
|
||||
extern CoreExport IRCDProto *ircdproto;
|
||||
extern CoreExport IRCdMessage *ircdmessage;
|
||||
enum IRCDMessageFlag
|
||||
{
|
||||
IRCDMESSAGE_SOFT_LIMIT,
|
||||
IRCDMESSAGE_REQUIRE_SERVER,
|
||||
IRCDMESSAGE_REQUIRE_USER
|
||||
};
|
||||
|
||||
extern CoreExport void pmodule_ircd_proto(IRCDProto *);
|
||||
extern CoreExport void pmodule_ircd_var(IRCDVar *ircdvar);
|
||||
extern CoreExport void pmodule_ircd_message(IRCdMessage *message);
|
||||
class CoreExport IRCDMessage : public Service
|
||||
{
|
||||
Anope::string name;
|
||||
unsigned param_count;
|
||||
std::set<IRCDMessageFlag> flags;
|
||||
public:
|
||||
IRCDMessage(Module *owner, const Anope::string &n, unsigned p = 0);
|
||||
unsigned GetParamCount() const;
|
||||
virtual void Run(MessageSource &, const std::vector<Anope::string> ¶ms) = 0;
|
||||
|
||||
void SetFlag(IRCDMessageFlag f) { flags.insert(f); }
|
||||
bool HasFlag(IRCDMessageFlag f) const { return flags.count(f); }
|
||||
};
|
||||
|
||||
extern CoreExport IRCDProto *IRCD;
|
||||
|
||||
#endif // PROTOCOL_H
|
||||
|
||||
+141
-137
@@ -1,15 +1,15 @@
|
||||
/* Modular support
|
||||
/*
|
||||
*
|
||||
* (C) 2008-2012 Anope Team
|
||||
* (C) 2008-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef REGCHANNEL_H
|
||||
#define REGCHANNEL_H
|
||||
|
||||
#include "botserv.h"
|
||||
#include "memo.h"
|
||||
#include "modes.h"
|
||||
#include "extensible.h"
|
||||
@@ -18,58 +18,24 @@
|
||||
#include "serialize.h"
|
||||
#include "bots.h"
|
||||
|
||||
typedef Anope::insensitive_map<ChannelInfo *> registered_channel_map;
|
||||
typedef Anope::hash_map<ChannelInfo *> registered_channel_map;
|
||||
|
||||
extern CoreExport serialize_checker<registered_channel_map> RegisteredChannelList;
|
||||
extern CoreExport Serialize::Checker<registered_channel_map> RegisteredChannelList;
|
||||
|
||||
/** Flags used for the ChannelInfo class
|
||||
*/
|
||||
enum ChannelInfoFlag
|
||||
/* Indices for TTB (Times To Ban) */
|
||||
enum
|
||||
{
|
||||
CI_BEGIN,
|
||||
|
||||
/* Retain the topic even after the channel is emptied */
|
||||
CI_KEEPTOPIC,
|
||||
/* Don't allow non-authorized users to be opped */
|
||||
CI_SECUREOPS,
|
||||
/* Hide channel from ChanServ LIST command */
|
||||
CI_PRIVATE,
|
||||
/* Topic can only be changed by SET TOPIC */
|
||||
CI_TOPICLOCK,
|
||||
/* Only users on the access list may join */
|
||||
CI_RESTRICTED,
|
||||
/* Don't allow ChanServ and BotServ commands to do bad things to users with higher access levels */
|
||||
CI_PEACE,
|
||||
/* Don't allow any privileges unless a user is IDENTIFIED with NickServ */
|
||||
CI_SECURE,
|
||||
/* Channel does not expire */
|
||||
CI_NO_EXPIRE,
|
||||
/* Channel memo limit may not be changed */
|
||||
CI_MEMO_HARDMAX,
|
||||
/* Stricter control of channel founder status */
|
||||
CI_SECUREFOUNDER,
|
||||
/* Sign kicks with the user who did the kick */
|
||||
CI_SIGNKICK,
|
||||
/* Sign kicks if level is < than the one defined by the SIGNKIGK level */
|
||||
CI_SIGNKICK_LEVEL,
|
||||
/* Channel is suspended */
|
||||
CI_SUSPENDED,
|
||||
/* Channel still exists when emptied, this can be caused by setting a perm
|
||||
* channel mode (+P on InspIRCd) or /cs set #chan persist on.
|
||||
* This keeps the service bot in the channel regardless if a +P type mode
|
||||
* is set or not
|
||||
*/
|
||||
CI_PERSIST,
|
||||
/* Chanstats are enabled */
|
||||
CI_STATS,
|
||||
|
||||
CI_END
|
||||
};
|
||||
|
||||
const Anope::string ChannelInfoFlagStrings[] = {
|
||||
"BEGIN", "KEEPTOPIC", "SECUREOPS", "PRIVATE", "TOPICLOCK", "RESTRICTED",
|
||||
"PEACE", "SECURE", "NO_EXPIRE", "MEMO_HARDMAX", "SECUREFOUNDER",
|
||||
"SIGNKICK", "SIGNKICK_LEVEL", "SUSPENDED", "PERSIST", "STATS", ""
|
||||
TTB_BOLDS,
|
||||
TTB_COLORS,
|
||||
TTB_REVERSES,
|
||||
TTB_UNDERLINES,
|
||||
TTB_BADWORDS,
|
||||
TTB_CAPS,
|
||||
TTB_FLOOD,
|
||||
TTB_REPEAT,
|
||||
TTB_ITALICS,
|
||||
TTB_AMSGS,
|
||||
TTB_SIZE
|
||||
};
|
||||
|
||||
/** Flags for badwords
|
||||
@@ -89,65 +55,57 @@ enum BadWordType
|
||||
/* Structure used to contain bad words. */
|
||||
struct CoreExport BadWord : Serializable
|
||||
{
|
||||
ChannelInfo *ci;
|
||||
Serialize::Reference<ChannelInfo> ci;
|
||||
Anope::string word;
|
||||
BadWordType type;
|
||||
|
||||
const Anope::string serialize_name() const anope_override;
|
||||
Serialize::Data serialize() const anope_override;
|
||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &);
|
||||
BadWord();
|
||||
~BadWord();
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
};
|
||||
|
||||
/** Flags for auto kick
|
||||
*/
|
||||
enum AutoKickFlag
|
||||
{
|
||||
/* Is by nick core, not mask */
|
||||
AK_ISNICK
|
||||
};
|
||||
|
||||
const Anope::string AutoKickFlagString[] = { "AK_ISNICK", "" };
|
||||
|
||||
/* AutoKick data. */
|
||||
class CoreExport AutoKick : public Flags<AutoKickFlag>, public Serializable
|
||||
class CoreExport AutoKick : public Serializable
|
||||
{
|
||||
public:
|
||||
AutoKick();
|
||||
serialize_obj<ChannelInfo> ci;
|
||||
/* Only one of these can be in use */
|
||||
/* Channel this autokick is on */
|
||||
Serialize::Reference<ChannelInfo> ci;
|
||||
|
||||
Anope::string mask;
|
||||
serialize_obj<NickCore> nc;
|
||||
Serialize::Reference<NickCore> nc;
|
||||
|
||||
Anope::string reason;
|
||||
Anope::string creator;
|
||||
time_t addtime;
|
||||
time_t last_used;
|
||||
|
||||
const Anope::string serialize_name() const anope_override;
|
||||
Serialize::Data serialize() const anope_override;
|
||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &);
|
||||
AutoKick();
|
||||
~AutoKick();
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
};
|
||||
|
||||
struct CoreExport ModeLock : Serializable
|
||||
{
|
||||
public:
|
||||
serialize_obj<ChannelInfo> ci;
|
||||
Serialize::Reference<ChannelInfo> ci;
|
||||
bool set;
|
||||
ChannelModeName name;
|
||||
Anope::string name;
|
||||
Anope::string param;
|
||||
Anope::string setter;
|
||||
time_t created;
|
||||
|
||||
ModeLock(ChannelInfo *ch, bool s, ChannelModeName n, const Anope::string &p, const Anope::string &se = "", time_t c = Anope::CurTime);
|
||||
ModeLock(ChannelInfo *ch, bool s, const Anope::string &n, const Anope::string &p, const Anope::string &se = "", time_t c = Anope::CurTime);
|
||||
~ModeLock();
|
||||
|
||||
const Anope::string serialize_name() const anope_override;
|
||||
Serialize::Data serialize() const anope_override;
|
||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &);
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
};
|
||||
|
||||
struct CoreExport LogSetting : Serializable
|
||||
{
|
||||
serialize_obj<ChannelInfo> ci;
|
||||
Serialize::Reference<ChannelInfo> ci;
|
||||
/* Our service name of the command */
|
||||
Anope::string service_name;
|
||||
/* The name of the client the command is on */
|
||||
@@ -158,26 +116,89 @@ struct CoreExport LogSetting : Serializable
|
||||
Anope::string creator;
|
||||
time_t created;
|
||||
|
||||
const Anope::string serialize_name() const anope_override;
|
||||
Serialize::Data serialize() const anope_override;
|
||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &);
|
||||
LogSetting() : Serializable("LogSetting") { }
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
};
|
||||
|
||||
class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag, CI_END>, public Serializable
|
||||
/* It matters that Base is here before Extensible (it is inherited by Serializable)
|
||||
*
|
||||
* Possible flags:
|
||||
* TOPICLOCK - Topic can only be changed by TOPIC SET
|
||||
* RESTRICTED - Only users on the access list may join
|
||||
* PEACE - Don't allow ChanServ and BotServ commands to do bad things to users with higher access levels
|
||||
* SECURE - Don't allow any privileges
|
||||
* NO_EXPIRE - Channel does not expire
|
||||
* MEMO_HARDMAX - Channel memo limit may not be changed
|
||||
* SECUREFOUNDER - Stricter control of channel founder status
|
||||
* SIGNKICK - Sign kicks with the user who did the kick
|
||||
* SIGNKICK_LEVEL - Sign kicks if level is < than the one defined by the SIGNKICK level
|
||||
* SUSPENDED - Channel is suepended
|
||||
* PERSIST - Channel still exists when empited (perm channel mode or leaving a botserv bot).
|
||||
* STATS - Chanstats are enabled
|
||||
* NOAUTOOP - If set users are not auto given any status on join
|
||||
*
|
||||
* BotServ flags:
|
||||
* BS_DONTKICKOPS - BotServ won't kick ops
|
||||
* BS_DONTKICKVOICES - BotServ won't kick voices
|
||||
* BS_FANTASY - BotServ bot accepts fantasy commands
|
||||
* BS_GREET - BotServ should show greets
|
||||
* BS_NOBOT - BotServ bots are not allowed to be in this channel
|
||||
* BS_KICK_BOLDS - BotServ kicks for bolds
|
||||
* BS_KICK_COLORS - BotServ kicks for colors
|
||||
* BS_KICK_REVERSES - BotServ kicks for reverses
|
||||
* BS_KICK_UNDERLINES - BotServ kicks for underlines
|
||||
* BS_KICK_BADWORD - BotServ kicks for badwords
|
||||
* BS_KICK_CAPS - BotServ kicks for caps
|
||||
* BS_KICK_FLOOD - BotServ kicks for flood
|
||||
* BS_KICK_REPEAT - BotServ kicks for repeating
|
||||
* BS_KICK_ITALICS - BotServ kicks for italics
|
||||
* BS_KICK_AMSGS - BotServ kicks for amsgs
|
||||
*/
|
||||
class CoreExport ChannelInfo : public Serializable, public Extensible
|
||||
{
|
||||
private:
|
||||
serialize_obj<NickCore> founder; /* Channel founder */
|
||||
serialize_checker<std::vector<ChanAccess *> > access; /* List of authorized users */
|
||||
serialize_checker<std::vector<AutoKick *> > akick; /* List of users to kickban */
|
||||
serialize_checker<std::vector<BadWord *> > badwords; /* List of badwords */
|
||||
Serialize::Reference<NickCore> founder; /* Channel founder */
|
||||
Serialize::Reference<NickCore> successor; /* Who gets the channel if the founder nick is dropped or expires */
|
||||
Serialize::Checker<std::vector<ChanAccess *> > access; /* List of authorized users */
|
||||
Serialize::Checker<std::vector<AutoKick *> > akick; /* List of users to kickban */
|
||||
Serialize::Checker<std::vector<BadWord *> > badwords; /* List of badwords */
|
||||
std::map<Anope::string, int16_t> levels;
|
||||
|
||||
public:
|
||||
typedef std::multimap<ChannelModeName, ModeLock *> ModeList;
|
||||
serialize_checker<ModeList> mode_locks;
|
||||
serialize_checker<std::vector<LogSetting *> > log_settings;
|
||||
friend class ChanAccess;
|
||||
friend class AutoKick;
|
||||
friend struct BadWord;
|
||||
|
||||
/** Default constructor
|
||||
typedef std::multimap<Anope::string, ModeLock *> ModeList;
|
||||
Serialize::Checker<ModeList> mode_locks;
|
||||
Serialize::Checker<std::vector<LogSetting *> > log_settings;
|
||||
|
||||
Anope::string name; /* Channel name */
|
||||
Anope::string desc;
|
||||
|
||||
time_t time_registered;
|
||||
time_t last_used;
|
||||
|
||||
Anope::string last_topic; /* The last topic that was set on this channel */
|
||||
Anope::string last_topic_setter; /* Setter */
|
||||
time_t last_topic_time; /* Time */
|
||||
|
||||
int16_t bantype;
|
||||
|
||||
MemoInfo memos;
|
||||
|
||||
Channel *c; /* Pointer to channel, if the channel exists */
|
||||
|
||||
/* For BotServ */
|
||||
Serialize::Reference<BotInfo> bi; /* Bot used on this channel */
|
||||
int16_t ttb[TTB_SIZE]; /* Times to ban for each kicker */
|
||||
|
||||
int16_t capsmin, capspercent; /* For CAPS kicker */
|
||||
int16_t floodlines, floodsecs; /* For FLOOD kicker */
|
||||
int16_t repeattimes; /* For REPEAT kicker */
|
||||
|
||||
/** Constructor
|
||||
* @param chname The channel name
|
||||
*/
|
||||
ChannelInfo(const Anope::string &chname);
|
||||
@@ -187,39 +208,10 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
|
||||
*/
|
||||
ChannelInfo(const ChannelInfo &ci);
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
~ChannelInfo();
|
||||
|
||||
Anope::string name; /* Channel name */
|
||||
serialize_obj<NickCore> successor; /* Who gets the channel if the founder nick is dropped or expires */
|
||||
Anope::string desc;
|
||||
|
||||
time_t time_registered;
|
||||
time_t last_used;
|
||||
|
||||
Anope::string last_topic; /* The last topic that was set on this channel */
|
||||
Anope::string last_topic_setter; /* Setter */
|
||||
time_t last_topic_time; /* Time */
|
||||
|
||||
int16_t bantype;
|
||||
|
||||
MemoInfo memos;
|
||||
|
||||
Channel *c; /* Pointer to channel record (if channel is currently in use) */
|
||||
|
||||
/* For BotServ */
|
||||
serialize_obj<BotInfo> bi; /* Bot used on this channel */
|
||||
Flags<BotServFlag> botflags;
|
||||
int16_t ttb[TTB_SIZE]; /* Times to ban for each kicker */
|
||||
|
||||
int16_t capsmin, capspercent; /* For CAPS kicker */
|
||||
int16_t floodlines, floodsecs; /* For FLOOD kicker */
|
||||
int16_t repeattimes; /* For REPEAT kicker */
|
||||
|
||||
const Anope::string serialize_name() const anope_override;
|
||||
Serialize::Data serialize() const anope_override;
|
||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &);
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
|
||||
|
||||
/** Change the founder of the channek
|
||||
* @params nc The new founder
|
||||
@@ -231,6 +223,9 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
|
||||
*/
|
||||
NickCore *GetFounder() const;
|
||||
|
||||
void SetSuccessor(NickCore *nc);
|
||||
NickCore *GetSuccessor() const;
|
||||
|
||||
/** Find which bot should send mode/topic/etc changes for this channel
|
||||
* @return The bot
|
||||
*/
|
||||
@@ -269,14 +264,6 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
|
||||
*/
|
||||
void EraseAccess(unsigned index);
|
||||
|
||||
/** Erase an entry from the channel access list
|
||||
*
|
||||
* @param taccess The access to remove
|
||||
*
|
||||
* Clears the memory used by the given access entry and removes it from the vector.
|
||||
*/
|
||||
void EraseAccess(const ChanAccess *taccess);
|
||||
|
||||
/** Clear the entire channel access list
|
||||
*
|
||||
* Clears the entire access list by deleting every item and then clearing the vector.
|
||||
@@ -374,6 +361,8 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
|
||||
*/
|
||||
bool RemoveMLock(ChannelMode *mode, bool status, const Anope::string ¶m = "");
|
||||
|
||||
void RemoveMLock(ModeLock *mlock);
|
||||
|
||||
/** Clear all mlocks on the channel
|
||||
*/
|
||||
void ClearMLock();
|
||||
@@ -387,14 +376,14 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
|
||||
* @param Name The mode name to get a list of
|
||||
* @return a pair of iterators for the beginning and end of the list
|
||||
*/
|
||||
std::pair<ModeList::iterator, ModeList::iterator> GetModeList(ChannelModeName Name);
|
||||
std::pair<ModeList::iterator, ModeList::iterator> GetModeList(const Anope::string &name);
|
||||
|
||||
/** Get details for a specific mlock
|
||||
* @param mname The mode name
|
||||
* @param An optional param to match with
|
||||
* @return The MLock, if any
|
||||
*/
|
||||
const ModeLock *GetMLock(ChannelModeName mname, const Anope::string ¶m = "");
|
||||
const ModeLock *GetMLock(const Anope::string &mname, const Anope::string ¶m = "");
|
||||
|
||||
/** Get the current mode locks as a string
|
||||
* @param complete True to show mlock parameters aswell
|
||||
@@ -440,11 +429,26 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
|
||||
/** Clear all privileges from the channel
|
||||
*/
|
||||
void ClearLevels();
|
||||
|
||||
/** Gets a ban mask for the given user based on the bantype
|
||||
* of the channel.
|
||||
* @param u The user
|
||||
* @return A ban mask that affects the user
|
||||
*/
|
||||
Anope::string GetIdealBan(User *u) const;
|
||||
|
||||
/** Finds a ChannelInfo
|
||||
* @param name channel name to lookup
|
||||
* @return the ChannelInfo associated with the channel
|
||||
*/
|
||||
static ChannelInfo* Find(const Anope::string &name);
|
||||
};
|
||||
|
||||
extern CoreExport ChannelInfo *cs_findchan(const Anope::string &chan);
|
||||
/** Is the user the real founder?
|
||||
* @param user The user
|
||||
* @param ci The channel
|
||||
* @return true or false
|
||||
*/
|
||||
extern CoreExport bool IsFounder(const User *user, const ChannelInfo *ci);
|
||||
extern CoreExport void update_cs_lastseen(User *user, ChannelInfo *ci);
|
||||
extern CoreExport int get_idealban(const ChannelInfo *ci, User *u, Anope::string &ret);
|
||||
|
||||
#endif // REGCHANNEL_H
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
|
||||
+164
-112
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -20,219 +20,274 @@
|
||||
|
||||
namespace Serialize
|
||||
{
|
||||
enum DataType
|
||||
class Data
|
||||
{
|
||||
DT_TEXT,
|
||||
DT_INT
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
DT_TEXT,
|
||||
DT_INT
|
||||
};
|
||||
|
||||
virtual ~Data() { }
|
||||
|
||||
virtual std::iostream& operator[](const Anope::string &key) = 0;
|
||||
virtual std::set<Anope::string> KeySet() const { throw CoreException("Not supported"); }
|
||||
virtual size_t Hash() const { throw CoreException("Not supported"); }
|
||||
|
||||
virtual void SetType(const Anope::string &key, Type t) { }
|
||||
virtual Type GetType(const Anope::string &key) const { return DT_TEXT; }
|
||||
};
|
||||
|
||||
extern void RegisterTypes();
|
||||
extern void CheckTypes();
|
||||
|
||||
class Type;
|
||||
template<typename T> class Checker;
|
||||
template<typename T> class Reference;
|
||||
}
|
||||
|
||||
class CoreExport stringstream : public std::stringstream
|
||||
{
|
||||
private:
|
||||
Serialize::DataType type;
|
||||
unsigned _max;
|
||||
|
||||
public:
|
||||
stringstream();
|
||||
stringstream(const stringstream &ss);
|
||||
Anope::string astr() const;
|
||||
|
||||
template<typename T> std::istream &operator>>(T &val)
|
||||
{
|
||||
std::istringstream is(this->str());
|
||||
is >> val;
|
||||
return *this;
|
||||
}
|
||||
std::istream &operator>>(Anope::string &val);
|
||||
|
||||
bool operator==(const stringstream &other) const;
|
||||
bool operator!=(const stringstream &other) const;
|
||||
|
||||
stringstream &setType(Serialize::DataType t);
|
||||
Serialize::DataType getType() const;
|
||||
stringstream &setMax(unsigned m);
|
||||
unsigned getMax() const;
|
||||
};
|
||||
|
||||
namespace Serialize
|
||||
{
|
||||
typedef std::map<Anope::string, stringstream> Data;
|
||||
}
|
||||
|
||||
extern void RegisterTypes();
|
||||
|
||||
/** A serialziable object. Serializable objects can be serialized into
|
||||
* abstract data types (Serialize::Data), and then reconstructed or
|
||||
* updated later at any time.
|
||||
*/
|
||||
class CoreExport Serializable : public virtual Base
|
||||
{
|
||||
private:
|
||||
static std::list<Serializable *> *serializable_items;
|
||||
|
||||
/* A list of every serializable item in Anope.
|
||||
* Some of these are static and constructed at runtime,
|
||||
* so this list must be on the heap, as it is not always
|
||||
* constructed before other objects are if it isn't.
|
||||
*/
|
||||
static std::list<Serializable *> *SerializableItems;
|
||||
/* The type of item this object is */
|
||||
Serialize::Type *s_type;
|
||||
private:
|
||||
/* Iterator into serializable_items */
|
||||
std::list<Serializable *>::iterator s_iter;
|
||||
Serialize::Data last_commit;
|
||||
/* The hash of the last serialized form of this object commited to the database */
|
||||
size_t last_commit;
|
||||
/* The last time this object was commited to the database */
|
||||
time_t last_commit_time;
|
||||
|
||||
protected:
|
||||
Serializable();
|
||||
Serializable(const Anope::string &serialize_type);
|
||||
Serializable(const Serializable &);
|
||||
|
||||
virtual ~Serializable();
|
||||
|
||||
Serializable &operator=(const Serializable &);
|
||||
|
||||
public:
|
||||
virtual ~Serializable();
|
||||
|
||||
/* Unique ID (per type, not globally) for this object */
|
||||
unsigned int id;
|
||||
|
||||
void destroy();
|
||||
|
||||
/** Marks the object as potentially being updated "soon".
|
||||
*/
|
||||
void QueueUpdate();
|
||||
|
||||
bool IsCached();
|
||||
void UpdateCache();
|
||||
bool IsCached(Serialize::Data &);
|
||||
void UpdateCache(Serialize::Data &);
|
||||
|
||||
bool IsTSCached();
|
||||
void UpdateTS();
|
||||
|
||||
virtual const Anope::string serialize_name() const = 0;
|
||||
virtual Serialize::Data serialize() const = 0;
|
||||
/** Get the type of serializable object this is
|
||||
* @return The serializable object type
|
||||
*/
|
||||
Serialize::Type* GetSerializableType() const { return this->s_type; }
|
||||
|
||||
virtual void Serialize(Serialize::Data &data) const = 0;
|
||||
|
||||
static const std::list<Serializable *> &GetItems();
|
||||
};
|
||||
|
||||
class CoreExport SerializeType
|
||||
/* A serializable type. There should be one of these classes for each type
|
||||
* of class that inherits from Serialiable. Used for unserializing objects
|
||||
* of this type, as it requires a function pointer to a static member function.
|
||||
*/
|
||||
class CoreExport Serialize::Type
|
||||
{
|
||||
typedef Serializable* (*unserialize_func)(Serializable *obj, Serialize::Data &);
|
||||
|
||||
static std::vector<Anope::string> type_order;
|
||||
static Anope::map<SerializeType *> types;
|
||||
static std::vector<Anope::string> TypeOrder;
|
||||
static std::map<Anope::string, Serialize::Type *> Types;
|
||||
|
||||
/* The name of this type, should be a class name */
|
||||
Anope::string name;
|
||||
unserialize_func unserialize;
|
||||
/* Owner of this type. Used for placing objects of this type in separate databases
|
||||
* based on what module, if any, owns it.
|
||||
*/
|
||||
Module *owner;
|
||||
|
||||
/* The timesatmp for this type. All objects of this type are as up to date as
|
||||
* this timestamp. if curtime == timestamp then we have the most up to date
|
||||
* version of every object of this type.
|
||||
*/
|
||||
time_t timestamp;
|
||||
|
||||
public:
|
||||
/* Map of Serializable::id to Serializable objects */
|
||||
std::map<unsigned int, Serializable *> objects;
|
||||
|
||||
SerializeType(const Anope::string &n, unserialize_func f);
|
||||
~SerializeType();
|
||||
/** Creates a new serializable type
|
||||
* @param n Type name
|
||||
* @param f Func to unserialize objects
|
||||
* @param owner Owner of this type. Leave NULL for the core.
|
||||
*/
|
||||
Type(const Anope::string &n, unserialize_func f, Module *owner = NULL);
|
||||
~Type();
|
||||
|
||||
const Anope::string &GetName();
|
||||
/** Gets the name for this type
|
||||
* @return The name, eg "NickAlias"
|
||||
*/
|
||||
const Anope::string &GetName() { return this->name; }
|
||||
|
||||
/** Unserialized an object.
|
||||
* @param obj NULL if this object doesn't yet exist. If this isn't NULL, instead
|
||||
* update the contents of this object.
|
||||
* @param data The data to unserialize
|
||||
* @return The unserialized object. If obj != NULL this should be obj.
|
||||
*/
|
||||
Serializable *Unserialize(Serializable *obj, Serialize::Data &data);
|
||||
|
||||
/** Check if this object type has any pending changes and update them.
|
||||
*/
|
||||
void Check();
|
||||
|
||||
/** Gets the timestamp for the object type. That is, the time we know
|
||||
* all objects of this type are updated at least to.
|
||||
*/
|
||||
time_t GetTimestamp() const;
|
||||
|
||||
/** Bumps object type timestamp to current time
|
||||
*/
|
||||
void UpdateTimestamp();
|
||||
|
||||
static SerializeType *Find(const Anope::string &name);
|
||||
Module* GetOwner() const { return this->owner; }
|
||||
|
||||
static Serialize::Type *Find(const Anope::string &name);
|
||||
|
||||
static const std::vector<Anope::string> &GetTypeOrder();
|
||||
|
||||
static const std::map<Anope::string, Serialize::Type *>& GetTypes();
|
||||
};
|
||||
|
||||
/** Should be used to hold lists and other objects of a specific type,
|
||||
* but not a specific object. Used for ensuring that any access to
|
||||
* this object type is always up to date. These are usually constructed
|
||||
* at run time, before main is called, so no types are registered. This
|
||||
* is why there are static Serialize::Type* variables in every function.
|
||||
*/
|
||||
template<typename T>
|
||||
class serialize_checker
|
||||
class Serialize::Checker
|
||||
{
|
||||
Anope::string name;
|
||||
T obj;
|
||||
mutable Serialize::Type *type;
|
||||
|
||||
inline void Check() const
|
||||
{
|
||||
if (!type)
|
||||
type = Serialize::Type::Find(this->name);
|
||||
if (type)
|
||||
type->Check();
|
||||
}
|
||||
|
||||
public:
|
||||
serialize_checker(const Anope::string &n) : name(n) { }
|
||||
Checker(const Anope::string &n) : name(n), type(NULL) { }
|
||||
|
||||
inline const T* operator->() const
|
||||
{
|
||||
static SerializeType *type = SerializeType::Find(this->name);
|
||||
if (type)
|
||||
type->Check();
|
||||
this->Check();
|
||||
return &this->obj;
|
||||
}
|
||||
inline T* operator->()
|
||||
{
|
||||
static SerializeType *type = SerializeType::Find(this->name);
|
||||
if (type)
|
||||
type->Check();
|
||||
this->Check();
|
||||
return &this->obj;
|
||||
}
|
||||
|
||||
inline const T& operator*() const
|
||||
{
|
||||
static SerializeType *type = SerializeType::Find(this->name);
|
||||
if (type)
|
||||
type->Check();
|
||||
this->Check();
|
||||
return this->obj;
|
||||
}
|
||||
inline T& operator*()
|
||||
{
|
||||
static SerializeType *type = SerializeType::Find(this->name);
|
||||
if (type)
|
||||
type->Check();
|
||||
this->Check();
|
||||
return this->obj;
|
||||
}
|
||||
|
||||
inline operator const T&() const
|
||||
{
|
||||
static SerializeType *type = SerializeType::Find(this->name);
|
||||
if (type)
|
||||
type->Check();
|
||||
this->Check();
|
||||
return this->obj;
|
||||
}
|
||||
inline operator T&()
|
||||
{
|
||||
static SerializeType *type = SerializeType::Find(this->name);
|
||||
if (type)
|
||||
type->Check();
|
||||
this->Check();
|
||||
return this->obj;
|
||||
}
|
||||
};
|
||||
|
||||
#include "modules.h"
|
||||
|
||||
/** Used to hold references to serializable objects. Reference should always be
|
||||
* used when holding references to serializable objects for extended periods of time
|
||||
* to ensure that the object it refers to it always up to date. This also behaves like
|
||||
* Reference in that it will invalidate itself if the object it refers to is
|
||||
* destructed.
|
||||
*/
|
||||
template<typename T>
|
||||
class serialize_obj : public dynamic_reference_base
|
||||
class Serialize::Reference : public ReferenceBase
|
||||
{
|
||||
protected:
|
||||
T *ref;
|
||||
|
||||
public:
|
||||
serialize_obj() : ref(NULL)
|
||||
Reference() : ref(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
serialize_obj(T *obj) : ref(obj)
|
||||
Reference(T *obj) : ref(obj)
|
||||
{
|
||||
if (obj)
|
||||
obj->AddReference(this);
|
||||
}
|
||||
|
||||
serialize_obj(const serialize_obj<T> &other) : ref(other.ref)
|
||||
Reference(const Reference<T> &other) : ReferenceBase(other), ref(other.ref)
|
||||
{
|
||||
if (*this)
|
||||
if (ref && !invalid)
|
||||
this->ref->AddReference(this);
|
||||
}
|
||||
|
||||
~serialize_obj()
|
||||
~Reference()
|
||||
{
|
||||
if (*this)
|
||||
if (ref && !invalid)
|
||||
this->ref->DelReference(this);
|
||||
}
|
||||
|
||||
inline Reference<T>& operator=(const Reference<T> &other)
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
if (ref && !invalid)
|
||||
this->ref->DelReference(this);
|
||||
|
||||
this->ref = other.ref;
|
||||
this->invalid = other.invalid;
|
||||
|
||||
if (ref && !invalid)
|
||||
this->ref->AddReference(this);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline operator bool() const
|
||||
{
|
||||
if (!this->invalid)
|
||||
return this->ref != NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inline void operator=(T *newref)
|
||||
{
|
||||
if (*this)
|
||||
this->ref->DelReference(this);
|
||||
|
||||
this->ref = newref;
|
||||
this->invalid = false;
|
||||
|
||||
if (newref)
|
||||
this->ref->AddReference(this);
|
||||
return false;
|
||||
}
|
||||
|
||||
inline operator T*() const
|
||||
@@ -240,11 +295,10 @@ class serialize_obj : public dynamic_reference_base
|
||||
if (!this->invalid)
|
||||
{
|
||||
if (this->ref)
|
||||
{
|
||||
FOREACH_MOD(I_OnSerializePtrAssign, OnSerializePtrAssign(this->ref));
|
||||
// This can invalidate me
|
||||
this->ref->QueueUpdate();
|
||||
}
|
||||
return this->ref;
|
||||
if (!this->invalid)
|
||||
return this->ref;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -254,11 +308,10 @@ class serialize_obj : public dynamic_reference_base
|
||||
if (!this->invalid)
|
||||
{
|
||||
if (this->ref)
|
||||
{
|
||||
FOREACH_MOD(I_OnSerializePtrAssign, OnSerializePtrAssign(this->ref));
|
||||
// This can invalidate me
|
||||
this->ref->QueueUpdate();
|
||||
}
|
||||
return this->ref;
|
||||
if (!this->invalid)
|
||||
return this->ref;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -268,11 +321,10 @@ class serialize_obj : public dynamic_reference_base
|
||||
if (!this->invalid)
|
||||
{
|
||||
if (this->ref)
|
||||
{
|
||||
FOREACH_MOD(I_OnSerializePtrAssign, OnSerializePtrAssign(this->ref));
|
||||
// This can invalidate me
|
||||
this->ref->QueueUpdate();
|
||||
}
|
||||
return this->ref;
|
||||
if (!this->invalid)
|
||||
return this->ref;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+59
-31
@@ -1,52 +1,66 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SERVERS_H
|
||||
#define SERVERS_H
|
||||
|
||||
#include "services.h"
|
||||
#include "anope.h"
|
||||
#include "extensible.h"
|
||||
|
||||
/* Anope */
|
||||
/* Anope. We are at the top of the server tree, our uplink is
|
||||
* almost always me->GetLinks()[0]. We never have an uplink. */
|
||||
extern CoreExport Server *Me;
|
||||
|
||||
extern CoreExport void do_server(const Anope::string &source, const Anope::string &servername, unsigned int hops, const Anope::string &descript, const Anope::string &numeric);
|
||||
|
||||
extern CoreExport const Anope::string ts6_uid_retrieve();
|
||||
extern CoreExport const Anope::string ts6_sid_retrieve();
|
||||
|
||||
extern CoreExport std::set<Anope::string> Capab;
|
||||
|
||||
/** Flags set on servers
|
||||
*/
|
||||
enum ServerFlag
|
||||
namespace Servers
|
||||
{
|
||||
SERVER_NONE,
|
||||
/* Server is syncing */
|
||||
SERVER_SYNCING,
|
||||
/* This server was juped */
|
||||
SERVER_JUPED
|
||||
};
|
||||
/* Retrieves the next free TS6 UID or SID */
|
||||
extern CoreExport const Anope::string TS6_UID_Retrieve();
|
||||
extern CoreExport const Anope::string TS6_SID_Retrieve();
|
||||
|
||||
const Anope::string ServerFlagStrings[] = { "SERVER_NONE", "SERVER_SYNCING", "SERVER_JUPED", "" };
|
||||
/* Gets our uplink. Note we don't actually have an "uplink", this is just
|
||||
* the only server whose uplink *is* Me that is not a juped server.
|
||||
* @return Our uplink, or NULL if not uplinked to anything
|
||||
*/
|
||||
extern CoreExport Server* GetUplink();
|
||||
|
||||
/* CAPAB/PROTOCTL given by the uplink */
|
||||
extern CoreExport std::set<Anope::string> Capab;
|
||||
}
|
||||
|
||||
/** Class representing a server
|
||||
*/
|
||||
class CoreExport Server : public Flags<ServerFlag>
|
||||
class CoreExport Server : public Extensible
|
||||
{
|
||||
private:
|
||||
/* Server name */
|
||||
Anope::string Name;
|
||||
Anope::string name;
|
||||
/* Hops between services and server */
|
||||
unsigned int Hops;
|
||||
unsigned int hops;
|
||||
/* Server description */
|
||||
Anope::string Description;
|
||||
Anope::string description;
|
||||
/* Server ID */
|
||||
Anope::string SID;
|
||||
Anope::string sid;
|
||||
/* Links for this server */
|
||||
std::vector<Server *> Links;
|
||||
std::vector<Server *> links;
|
||||
/* Uplink for this server */
|
||||
Server *UplinkServer;
|
||||
Server *uplink;
|
||||
/* Server is syncing */
|
||||
bool syncing;
|
||||
/* The server is juped */
|
||||
bool juped;
|
||||
|
||||
/* Reason this server was quit */
|
||||
Anope::string QReason;
|
||||
Anope::string quit_reason;
|
||||
|
||||
public:
|
||||
/** Constructor
|
||||
@@ -55,14 +69,19 @@ class CoreExport Server : public Flags<ServerFlag>
|
||||
* @param hops Hops from services server
|
||||
* @param description Server rdescription
|
||||
* @param sid Server sid/numeric
|
||||
* @param flag An optional server flag
|
||||
* @param jupe If the server is juped
|
||||
*/
|
||||
Server(Server *uplink, const Anope::string &name, unsigned hops, const Anope::string &description, const Anope::string &sid, ServerFlag flag = SERVER_NONE);
|
||||
Server(Server *uplink, const Anope::string &name, unsigned hops, const Anope::string &description, const Anope::string &sid = "", bool jupe = false);
|
||||
|
||||
private:
|
||||
/** Destructor
|
||||
*/
|
||||
~Server();
|
||||
|
||||
public:
|
||||
/* Number of users on the server */
|
||||
unsigned users;
|
||||
|
||||
/** Delete this server with a reason
|
||||
* @param reason The reason
|
||||
*/
|
||||
@@ -93,7 +112,7 @@ class CoreExport Server : public Flags<ServerFlag>
|
||||
*/
|
||||
void SetSID(const Anope::string &sid);
|
||||
|
||||
/** Get the server numeric/SID
|
||||
/** Get the server numeric/SID, else the server name
|
||||
* @return The numeric/SID
|
||||
*/
|
||||
const Anope::string &GetSID() const;
|
||||
@@ -119,20 +138,29 @@ class CoreExport Server : public Flags<ServerFlag>
|
||||
void DelLink(Server *s);
|
||||
|
||||
/** Finish syncing this server and optionally all links to it
|
||||
* @param SyncLinks True to sync the links for this server too (if any)
|
||||
* @param sync_links True to sync the links for this server too (if any)
|
||||
*/
|
||||
void Sync(bool SyncLinks);
|
||||
void Sync(bool sync_links);
|
||||
|
||||
/** Check if this server is synced
|
||||
* @return true or false
|
||||
*/
|
||||
bool IsSynced() const;
|
||||
|
||||
/** Unsync the server. Only used for Me->Unsync()
|
||||
*/
|
||||
void Unsync();
|
||||
|
||||
/** Check if this server is ULined
|
||||
* @return true or false
|
||||
*/
|
||||
bool IsULined() const;
|
||||
|
||||
/** Check if this server is juped (a pseudoserver other than us)
|
||||
* @return true if this server is a juped server
|
||||
*/
|
||||
bool IsJuped() const;
|
||||
|
||||
/** Send a message to alll users on this server
|
||||
* @param source The source of the message
|
||||
* @param message The message
|
||||
|
||||
+81
-16
@@ -1,11 +1,13 @@
|
||||
/*
|
||||
* (C) 2003-2012 Anope Team
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SERVICE_H
|
||||
@@ -15,35 +17,74 @@
|
||||
#include "anope.h"
|
||||
#include "modules.h"
|
||||
|
||||
/** Anything that inherits from this class can be referred to
|
||||
* using ServiceReference. Any interfaces provided by modules,
|
||||
* such as commands, use this. This is also used for modules
|
||||
* that publish a service (m_ssl, etc).
|
||||
*/
|
||||
class CoreExport Service : public virtual Base
|
||||
{
|
||||
static Anope::map<Anope::map<Service *> > services;
|
||||
public:
|
||||
static Service *FindService(const Anope::string &t, const Anope::string &n)
|
||||
static std::map<Anope::string, std::map<Anope::string, Service *> > Services;
|
||||
static std::map<Anope::string, std::map<Anope::string, Anope::string> > Aliases;
|
||||
|
||||
static Service *FindService(const std::map<Anope::string, Service *> &services, const std::map<Anope::string, Anope::string> *aliases, const Anope::string &n)
|
||||
{
|
||||
Anope::map<Anope::map<Service *> >::iterator it = services.find(t);
|
||||
std::map<Anope::string, Service *>::const_iterator it = services.find(n);
|
||||
if (it != services.end())
|
||||
return it->second;
|
||||
|
||||
if (aliases != NULL)
|
||||
{
|
||||
Anope::map<Service *>::iterator it2 = it->second.find(n);
|
||||
if (it2 != it->second.end())
|
||||
return it2->second;
|
||||
std::map<Anope::string, Anope::string>::const_iterator it2 = aliases->find(n);
|
||||
if (it2 != aliases->end())
|
||||
return FindService(services, aliases, it2->second);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
public:
|
||||
static Service *FindService(const Anope::string &t, const Anope::string &n)
|
||||
{
|
||||
std::map<Anope::string, std::map<Anope::string, Service *> >::const_iterator it = Services.find(t);
|
||||
if (it == Services.end())
|
||||
return NULL;
|
||||
|
||||
std::map<Anope::string, std::map<Anope::string, Anope::string> >::const_iterator it2 = Aliases.find(t);
|
||||
if (it2 != Aliases.end())
|
||||
return FindService(it->second, &it2->second, n);
|
||||
|
||||
return FindService(it->second, NULL, n);
|
||||
}
|
||||
|
||||
static std::vector<Anope::string> GetServiceKeys(const Anope::string &t)
|
||||
{
|
||||
std::vector<Anope::string> keys;
|
||||
Anope::map<Anope::map<Service *> >::iterator it = services.find(t);
|
||||
if (it != services.end())
|
||||
for (Anope::map<Service *>::iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2)
|
||||
std::map<Anope::string, std::map<Anope::string, Service *> >::iterator it = Services.find(t);
|
||||
if (it != Services.end())
|
||||
for (std::map<Anope::string, Service *>::iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2)
|
||||
keys.push_back(it2->first);
|
||||
return keys;
|
||||
}
|
||||
|
||||
static void AddAlias(const Anope::string &t, const Anope::string &n, const Anope::string &v)
|
||||
{
|
||||
std::map<Anope::string, Anope::string> &smap = Aliases[t];
|
||||
smap[n] = v;
|
||||
}
|
||||
|
||||
static void DelAlias(const Anope::string &t, const Anope::string &n)
|
||||
{
|
||||
std::map<Anope::string, Anope::string> &smap = Aliases[t];
|
||||
smap.erase(n);
|
||||
if (smap.empty())
|
||||
Aliases.erase(t);
|
||||
}
|
||||
|
||||
Module *owner;
|
||||
/* Service type, which should be the class name (eg "Command") */
|
||||
Anope::string type;
|
||||
/* Service name, commands are usually named service/command */
|
||||
Anope::string name;
|
||||
|
||||
Service(Module *o, const Anope::string &t, const Anope::string &n) : owner(o), type(t), name(n)
|
||||
@@ -58,7 +99,7 @@ class CoreExport Service : public virtual Base
|
||||
|
||||
void Register()
|
||||
{
|
||||
Anope::map<Service *> &smap = services[this->type];
|
||||
std::map<Anope::string, Service *> &smap = Services[this->type];
|
||||
if (smap.find(this->name) != smap.end())
|
||||
throw ModuleException("Service " + this->type + " with name " + this->name + " already exists");
|
||||
smap[this->name] = this;
|
||||
@@ -66,27 +107,32 @@ class CoreExport Service : public virtual Base
|
||||
|
||||
void Unregister()
|
||||
{
|
||||
Anope::map<Service *> &smap = services[this->type];
|
||||
std::map<Anope::string, Service *> &smap = Services[this->type];
|
||||
smap.erase(this->name);
|
||||
if (smap.empty())
|
||||
services.erase(this->type);
|
||||
Services.erase(this->type);
|
||||
}
|
||||
};
|
||||
|
||||
/** Like Reference, but used to refer to Services.
|
||||
*/
|
||||
template<typename T>
|
||||
class service_reference : public dynamic_reference<T>
|
||||
class ServiceReference : public Reference<T>
|
||||
{
|
||||
Anope::string type;
|
||||
Anope::string name;
|
||||
|
||||
public:
|
||||
service_reference(const Anope::string &t, const Anope::string &n) : dynamic_reference<T>(NULL), type(t), name(n)
|
||||
ServiceReference() { }
|
||||
|
||||
ServiceReference(const Anope::string &t, const Anope::string &n) : type(t), name(n)
|
||||
{
|
||||
}
|
||||
|
||||
inline void operator=(const Anope::string &n)
|
||||
{
|
||||
this->name = n;
|
||||
this->invalid = true;
|
||||
}
|
||||
|
||||
operator bool() anope_override
|
||||
@@ -98,6 +144,10 @@ class service_reference : public dynamic_reference<T>
|
||||
}
|
||||
if (!this->ref)
|
||||
{
|
||||
/* This really could be dynamic_cast in every case, except for when a module
|
||||
* creates its own service type (that other modules must include the header file
|
||||
* for), as the core is not compiled with it so there is no RTTI for it.
|
||||
*/
|
||||
this->ref = static_cast<T *>(Service::FindService(this->type, this->name));
|
||||
if (this->ref)
|
||||
this->ref->AddReference(this);
|
||||
@@ -106,5 +156,20 @@ class service_reference : public dynamic_reference<T>
|
||||
}
|
||||
};
|
||||
|
||||
class ServiceAlias
|
||||
{
|
||||
Anope::string t, f;
|
||||
public:
|
||||
ServiceAlias(const Anope::string &type, const Anope::string &from, const Anope::string &to) : t(type), f(from)
|
||||
{
|
||||
Service::AddAlias(type, from, to);
|
||||
}
|
||||
|
||||
~ServiceAlias()
|
||||
{
|
||||
Service::DelAlias(t, f);
|
||||
}
|
||||
};
|
||||
|
||||
#endif // SERVICE_H
|
||||
|
||||
|
||||
+1
-11
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -8,7 +8,6 @@
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SERVICES_H
|
||||
@@ -66,13 +65,4 @@
|
||||
# include "anope_windows.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* RFC: defination of a valid nick
|
||||
* nickname = ( letter / special ) *8( letter / digit / special / "-" )
|
||||
* letter = %x41-5A / %x61-7A ; A-Z / a-z
|
||||
* digit = %x30-39 ; 0-9
|
||||
* special = %x5B-60 / %x7B-7D ; "[", "]", "\", "`", "_", "^", "{", "|", "}"
|
||||
**/
|
||||
#define isvalidnick(c) (isalnum(c) || ((c) >= '\x5B' && (c) <= '\x60') || ((c) >= '\x7B' && (c) <= '\x7D') || (c) == '-')
|
||||
|
||||
#endif // SERVICES_H
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SIGNAL_H
|
||||
#define SIGNAL_H
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#include "sockets.h"
|
||||
|
||||
/** Represents a signal handler
|
||||
*/
|
||||
class Signal : public Pipe
|
||||
{
|
||||
static std::vector<Signal *> SignalHandlers;
|
||||
static void SignalHandler(int signal);
|
||||
|
||||
struct sigaction action, old;
|
||||
public:
|
||||
int signal;
|
||||
|
||||
/** Constructor
|
||||
* @param s The signal to listen for
|
||||
*/
|
||||
Signal(int s);
|
||||
~Signal();
|
||||
|
||||
/**
|
||||
* Called when the signal is received.
|
||||
* Note this is not *immediatly* called when the signal is received,
|
||||
* but it is saved and called at a later time when we are not doing something
|
||||
* important. This is always called on the main thread, even on systems that
|
||||
* spawn threads for signals, like Windows.
|
||||
*/
|
||||
virtual void OnNotify() anope_override = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+8
-18
@@ -1,21 +1,24 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SOCKETENGINE_H
|
||||
#define SOCKETENGINE_H
|
||||
|
||||
#include "services.h"
|
||||
#include "sockets.h"
|
||||
|
||||
class CoreExport SocketEngine
|
||||
{
|
||||
static const int DefaultSize = 2; // Uplink, mode stacker
|
||||
public:
|
||||
/* Map of sockets */
|
||||
static std::map<int, Socket *> Sockets;
|
||||
@@ -28,25 +31,12 @@ class CoreExport SocketEngine
|
||||
*/
|
||||
static void Shutdown();
|
||||
|
||||
/** Add a socket to the internal list
|
||||
/** Set a flag on a socket
|
||||
* @param s The socket
|
||||
* @param set Whether setting or unsetting
|
||||
* @param flag The flag to set or unset
|
||||
*/
|
||||
static void AddSocket(Socket *s);
|
||||
|
||||
/** Delete a socket from the internal list
|
||||
* @param s The socket
|
||||
*/
|
||||
static void DelSocket(Socket *s);
|
||||
|
||||
/** Mark a socket as writeable
|
||||
* @param s The socket
|
||||
*/
|
||||
static void MarkWritable(Socket *s);
|
||||
|
||||
/** Unmark a socket as writeable
|
||||
* @param s The socket
|
||||
*/
|
||||
static void ClearWritable(Socket *s);
|
||||
static void Change(Socket *s, bool set, SocketFlag flag);
|
||||
|
||||
/** Read from sockets and do things
|
||||
*/
|
||||
|
||||
+68
-57
@@ -1,12 +1,13 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SOCKETS_H
|
||||
@@ -90,17 +91,26 @@ class CoreExport cidr
|
||||
cidr(const Anope::string &ip, unsigned char len);
|
||||
Anope::string mask() const;
|
||||
bool match(sockaddrs &other);
|
||||
|
||||
bool operator<(const cidr &other) const;
|
||||
bool operator==(const cidr &other) const;
|
||||
bool operator!=(const cidr &other) const;
|
||||
|
||||
struct CoreExport hash
|
||||
{
|
||||
size_t operator()(const cidr &s) const;
|
||||
};
|
||||
};
|
||||
|
||||
class SocketException : public CoreException
|
||||
{
|
||||
public:
|
||||
/** Default constructor for socket exceptions
|
||||
/** Constructor for socket exceptions
|
||||
* @param message Error message
|
||||
*/
|
||||
SocketException(const Anope::string &message) : CoreException(message) { }
|
||||
|
||||
/** Default destructor
|
||||
/** Destructor
|
||||
* @throws Nothing
|
||||
*/
|
||||
virtual ~SocketException() throw() { }
|
||||
@@ -108,20 +118,21 @@ class SocketException : public CoreException
|
||||
|
||||
enum SocketFlag
|
||||
{
|
||||
SF_DEAD,
|
||||
SF_DEAD = 1,
|
||||
SF_READABLE,
|
||||
SF_WRITABLE,
|
||||
SF_CONNECTING,
|
||||
SF_CONNECTED,
|
||||
SF_ACCEPTING,
|
||||
SF_ACCEPTED
|
||||
SF_ACCEPTED,
|
||||
SF_SIZE
|
||||
};
|
||||
|
||||
static const Anope::string SocketFlagStrings[] = { "SF_DEAD", "SF_WRITABLE", "SF_CONNECTING", "SF_CONNECTED", "SF_ACCEPTING", "SF_ACCEPTED", "" };
|
||||
|
||||
|
||||
class CoreExport SocketIO
|
||||
{
|
||||
public:
|
||||
virtual ~SocketIO() { }
|
||||
|
||||
/** Receive something from the buffer
|
||||
* @param s The socket
|
||||
* @param buf The buf to read to
|
||||
@@ -175,33 +186,35 @@ class CoreExport SocketIO
|
||||
virtual void Destroy() { }
|
||||
};
|
||||
|
||||
class CoreExport Socket : public Flags<SocketFlag>
|
||||
class CoreExport Socket
|
||||
{
|
||||
protected:
|
||||
/* Socket FD */
|
||||
int Sock;
|
||||
int sock;
|
||||
/* Is this an IPv6 socket? */
|
||||
bool IPv6;
|
||||
bool ipv6;
|
||||
|
||||
public:
|
||||
std::bitset<SF_SIZE> flags;
|
||||
|
||||
/* Sockaddrs for bind() (if it's bound) */
|
||||
sockaddrs bindaddr;
|
||||
|
||||
/* I/O functions used for this socket */
|
||||
SocketIO *IO;
|
||||
SocketIO *io;
|
||||
|
||||
/** Empty constructor, should not be called.
|
||||
*/
|
||||
Socket();
|
||||
|
||||
/** Default constructor
|
||||
/** Constructor, possibly creates the socket and adds it to the engine
|
||||
* @param sock The socket to use, -1 if we need to create our own
|
||||
* @param ipv6 true if using ipv6
|
||||
* @param type The socket type, defaults to SOCK_STREAM
|
||||
*/
|
||||
Socket(int sock, bool ipv6 = false, int type = SOCK_STREAM);
|
||||
|
||||
/** Default destructor
|
||||
/** Destructor, closes the socket and removes it from the engine
|
||||
*/
|
||||
virtual ~Socket();
|
||||
|
||||
@@ -215,15 +228,11 @@ class CoreExport Socket : public Flags<SocketFlag>
|
||||
*/
|
||||
bool IsIPv6() const;
|
||||
|
||||
/** Mark a socket as blockig
|
||||
/** Mark a socket as (non)blocking
|
||||
* @param state true to enable blocking, false to disable blocking
|
||||
* @return true if the socket is now blocking
|
||||
*/
|
||||
bool SetBlocking();
|
||||
|
||||
/** Mark a socket as non-blocking
|
||||
* @return true if the socket is now non-blocking
|
||||
*/
|
||||
bool SetNonBlocking();
|
||||
bool SetBlocking(bool state);
|
||||
|
||||
/** Bind the socket to an ip and port
|
||||
* @param ip The ip
|
||||
@@ -255,20 +264,15 @@ class CoreExport Socket : public Flags<SocketFlag>
|
||||
class CoreExport BufferedSocket : public virtual Socket
|
||||
{
|
||||
protected:
|
||||
/* Things read from the socket */
|
||||
Anope::string read_buffer;
|
||||
/* Things to be written to the socket */
|
||||
Anope::string WriteBuffer;
|
||||
/* Part of a message sent from the server, but not totally received */
|
||||
Anope::string extrabuf;
|
||||
/* How much data was received from this socket */
|
||||
int RecvLen;
|
||||
Anope::string write_buffer;
|
||||
/* How much data was received from this socket on this recv() */
|
||||
int recv_len;
|
||||
|
||||
public:
|
||||
/** Constructor
|
||||
*/
|
||||
BufferedSocket();
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
virtual ~BufferedSocket();
|
||||
|
||||
/** Called when there is something to be received for this socket
|
||||
@@ -281,11 +285,9 @@ class CoreExport BufferedSocket : public virtual Socket
|
||||
*/
|
||||
bool ProcessWrite() anope_override;
|
||||
|
||||
/** Called with a line received from the socket
|
||||
* @param buf The line
|
||||
* @return true to continue reading, false to drop the socket
|
||||
/** Gets the new line from the input buffer, if any
|
||||
*/
|
||||
virtual bool Read(const Anope::string &buf);
|
||||
const Anope::string GetLine();
|
||||
|
||||
/** Write to the socket
|
||||
* @param message The message
|
||||
@@ -320,15 +322,11 @@ class CoreExport BinarySocket : public virtual Socket
|
||||
~DataBlock();
|
||||
};
|
||||
|
||||
std::deque<DataBlock *> WriteBuffer;
|
||||
/* Data to be written out */
|
||||
std::deque<DataBlock *> write_buffer;
|
||||
|
||||
public:
|
||||
/** Constructor
|
||||
*/
|
||||
BinarySocket();
|
||||
|
||||
/** Default destructor
|
||||
*/
|
||||
virtual ~BinarySocket();
|
||||
|
||||
/** Called when there is something to be received for this socket
|
||||
@@ -357,7 +355,7 @@ class CoreExport BinarySocket : public virtual Socket
|
||||
virtual bool Read(const char *buffer, size_t l);
|
||||
};
|
||||
|
||||
class CoreExport ListenSocket : public Socket
|
||||
class CoreExport ListenSocket : public virtual Socket
|
||||
{
|
||||
public:
|
||||
/** Constructor
|
||||
@@ -366,9 +364,6 @@ class CoreExport ListenSocket : public Socket
|
||||
* @param ipv6 true for ipv6
|
||||
*/
|
||||
ListenSocket(const Anope::string &bindip, int port, bool ipv6);
|
||||
|
||||
/** Destructor
|
||||
*/
|
||||
virtual ~ListenSocket();
|
||||
|
||||
/** Process what has come in from the connection
|
||||
@@ -425,7 +420,7 @@ class CoreExport ClientSocket : public virtual Socket
|
||||
{
|
||||
public:
|
||||
/* Listen socket this connection came from */
|
||||
ListenSocket *LS;
|
||||
ListenSocket *ls;
|
||||
/* Clients address */
|
||||
sockaddrs clientaddr;
|
||||
|
||||
@@ -458,34 +453,50 @@ class CoreExport ClientSocket : public virtual Socket
|
||||
class CoreExport Pipe : public Socket
|
||||
{
|
||||
public:
|
||||
/** The FD of the write pipe (if this isn't evenfd)
|
||||
* this->Sock is the readfd
|
||||
/** The FD of the write pipe
|
||||
* this->sock is the readfd
|
||||
*/
|
||||
int WritePipe;
|
||||
int write_pipe;
|
||||
|
||||
/** Constructor
|
||||
*/
|
||||
Pipe();
|
||||
|
||||
/** Destructor
|
||||
*/
|
||||
~Pipe();
|
||||
|
||||
/** Called when data is to be read
|
||||
/** Called when data is to be read, reads the data then calls OnNotify
|
||||
*/
|
||||
bool ProcessRead() anope_override;
|
||||
|
||||
/** Write data to this pipe
|
||||
* @param data The data to write
|
||||
* @param sz The amount of data to wirite
|
||||
*/
|
||||
void Write(const char *data, size_t sz);
|
||||
inline void Write(const Anope::string &data) { this->Write(data.c_str(), data.length() + 1); }
|
||||
|
||||
/** Read data from this pipe
|
||||
* @param data A buffer to read data into
|
||||
* @param sz The size of the buffer
|
||||
* @return The amount of data read
|
||||
*/
|
||||
int Read(char *data, size_t sz);
|
||||
|
||||
/** Mark the write end of this pipe (non)blocking
|
||||
* @param state true to enable blocking, false to disable blocking
|
||||
* @return true if the socket is now blocking
|
||||
*/
|
||||
bool SetWriteBlocking(bool state);
|
||||
|
||||
/** Called when this pipe needs to be woken up
|
||||
* Is the same as Write("\0", 1)
|
||||
*/
|
||||
void Notify();
|
||||
|
||||
/** Overload to do something useful
|
||||
/** Called after ProcessRead comes back from Notify(), overload to do something useful
|
||||
*/
|
||||
virtual void OnNotify() = 0;
|
||||
};
|
||||
|
||||
extern CoreExport uint32_t TotalRead;
|
||||
extern CoreExport uint32_t TotalWritten;
|
||||
extern CoreExport SocketIO normalSocketIO;
|
||||
extern CoreExport SocketIO NormalSocketIO;
|
||||
|
||||
#endif // SOCKET_H
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#cmakedefine HAVE_CSTDINT 1
|
||||
#cmakedefine HAVE_STDINT_H 1
|
||||
#cmakedefine HAVE_STDDEF_H 1
|
||||
#cmakedefine HAVE_SETGRENT 1
|
||||
#cmakedefine HAVE_STRCASECMP 1
|
||||
#cmakedefine HAVE_STRICMP 1
|
||||
#cmakedefine HAVE_STRINGS_H 1
|
||||
@@ -16,7 +15,6 @@
|
||||
#cmakedefine HAVE_EPOLL 1
|
||||
#cmakedefine HAVE_POLL 1
|
||||
#cmakedefine GETTEXT_FOUND 1
|
||||
#cmakedefine RUNGROUP "@RUNGROUP@"
|
||||
|
||||
#ifdef HAVE_CSTDINT
|
||||
# include <cstdint>
|
||||
|
||||
+13
-1
@@ -1,3 +1,15 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef THREADENGINE_H
|
||||
#define THREADENGINE_H
|
||||
|
||||
@@ -12,7 +24,7 @@ class CoreExport Thread : public Pipe, public Extensible
|
||||
|
||||
public:
|
||||
/* Handle for this thread */
|
||||
pthread_t Handle;
|
||||
pthread_t handle;
|
||||
|
||||
/** Threads constructor
|
||||
*/
|
||||
|
||||
+9
-7
@@ -1,11 +1,13 @@
|
||||
/* Timer include stuff.
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TIMERS_H
|
||||
@@ -33,14 +35,14 @@ class CoreExport Timer
|
||||
bool repeat;
|
||||
|
||||
public:
|
||||
/** Default constructor, initializes the triggering time
|
||||
/** Constructor, initializes the triggering time
|
||||
* @param time_from_now The number of seconds from now to trigger the timer
|
||||
* @param now The time now
|
||||
* @param repeating Repeat this timer every time_from_now if this is true
|
||||
*/
|
||||
Timer(long time_from_now, time_t now = Anope::CurTime, bool repeating = false);
|
||||
|
||||
/** Default destructor, removes the timer from the list
|
||||
/** Destructor, removes the timer from the list
|
||||
*/
|
||||
virtual ~Timer();
|
||||
|
||||
@@ -91,14 +93,14 @@ class CoreExport TimerManager
|
||||
static std::vector<Timer *> Timers;
|
||||
public:
|
||||
/** Add a timer to the list
|
||||
* @param T A Timer derived class to add
|
||||
* @param t A Timer derived class to add
|
||||
*/
|
||||
static void AddTimer(Timer *T);
|
||||
static void AddTimer(Timer *t);
|
||||
|
||||
/** Deletes a timer
|
||||
* @param T A Timer derived class to delete
|
||||
* @param t A Timer derived class to delete
|
||||
*/
|
||||
static void DelTimer(Timer *T);
|
||||
static void DelTimer(Timer *t);
|
||||
|
||||
/** Tick all pending timers
|
||||
* @param ctime The current time
|
||||
|
||||
+14
-5
@@ -1,12 +1,13 @@
|
||||
/*
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef UPLINK_H
|
||||
@@ -14,18 +15,26 @@
|
||||
|
||||
#include "sockets.h"
|
||||
|
||||
namespace Uplink
|
||||
{
|
||||
extern void Connect();
|
||||
}
|
||||
|
||||
/* This is the socket to our uplink */
|
||||
class UplinkSocket : public ConnectionSocket, public BufferedSocket
|
||||
{
|
||||
public:
|
||||
UplinkSocket();
|
||||
~UplinkSocket();
|
||||
bool Read(const Anope::string &);
|
||||
void OnConnect();
|
||||
void OnError(const Anope::string &);
|
||||
|
||||
bool ProcessRead() anope_override;
|
||||
void OnConnect() anope_override;
|
||||
void OnError(const Anope::string &) anope_override;
|
||||
|
||||
/* A message sent over the uplink socket */
|
||||
class CoreExport Message
|
||||
{
|
||||
private:
|
||||
/* The source of the message, can be a server (Me), or any user (one of our bots) */
|
||||
const Server *server;
|
||||
const User *user;
|
||||
std::stringstream buffer;
|
||||
|
||||
+125
-79
@@ -1,8 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
|
||||
* Copyright (C) 2008-2012 Anope Team <team@anope.org>
|
||||
*
|
||||
* (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
|
||||
* (C) 2003-2013 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef USERS_H
|
||||
@@ -15,66 +21,73 @@
|
||||
#include "commands.h"
|
||||
#include "account.h"
|
||||
|
||||
extern CoreExport Anope::insensitive_map<User *> UserListByNick;
|
||||
extern CoreExport Anope::map<User *> UserListByUID;
|
||||
typedef Anope::hash_map<User *> user_map;
|
||||
|
||||
class CoreExport ChannelStatus : public Flags<ChannelModeName, CMODE_END * 2>
|
||||
{
|
||||
public:
|
||||
ChannelStatus();
|
||||
Anope::string BuildCharPrefixList() const;
|
||||
Anope::string BuildModePrefixList() const;
|
||||
};
|
||||
|
||||
struct ChannelContainer
|
||||
{
|
||||
Channel *chan;
|
||||
ChannelStatus *Status;
|
||||
|
||||
ChannelContainer(Channel *c) : chan(c) { }
|
||||
virtual ~ChannelContainer() { }
|
||||
};
|
||||
|
||||
typedef std::list<ChannelContainer *> UChannelList;
|
||||
extern CoreExport user_map UserListByNick, UserListByUID;
|
||||
|
||||
extern CoreExport int OperCount;
|
||||
extern CoreExport unsigned MaxUserCount;
|
||||
extern CoreExport time_t MaxUserTime;
|
||||
|
||||
/* Online user and channel data. */
|
||||
class CoreExport User : public virtual Base, public Extensible, public CommandReply
|
||||
{
|
||||
/* true if the user was quit or killed */
|
||||
bool quit;
|
||||
/* Users that are in the process of quitting */
|
||||
static std::list<User *> quitting_users;
|
||||
protected:
|
||||
Anope::string vident;
|
||||
Anope::string ident;
|
||||
Anope::string uid;
|
||||
bool OnAccess; /* If the user is on the access list of the nick theyre on */
|
||||
Flags<UserModeName, UMODE_END * 2> modes; /* Bitset of mode names the user has set on them */
|
||||
std::map<UserModeName, Anope::string> Params; /* Map of user modes and the params this user has */
|
||||
serialize_obj<NickCore> nc; /* NickCore account the user is currently loggged in as */
|
||||
/* If the user is on the access list of the nick theyre on */
|
||||
bool on_access;
|
||||
/* Map of user modes and the params this user has (if any) */
|
||||
std::map<Anope::string, Anope::string> modes;
|
||||
/* NickCore account the user is currently loggged in as, if they are logged in */
|
||||
Serialize::Reference<NickCore> nc;
|
||||
|
||||
/* # of invalid password attempts */
|
||||
unsigned short invalid_pw_count;
|
||||
/* Time of last invalid password */
|
||||
time_t invalid_pw_time;
|
||||
|
||||
|
||||
public: // XXX: exposing a tiny bit too much
|
||||
Anope::string nick; /* User's current nick */
|
||||
/* User's current nick */
|
||||
Anope::string nick;
|
||||
|
||||
Anope::string host; /* User's real hostname */
|
||||
Anope::string vhost; /* User's virtual hostname */
|
||||
Anope::string chost; /* User's cloaked hostname */
|
||||
Anope::string realname; /* Realname */
|
||||
Anope::string fingerprint; /* SSL Fingerprint */
|
||||
Anope::string ip; /* User's IP */
|
||||
Server *server; /* Server user is connected to */
|
||||
time_t timestamp; /* Timestamp of the nick */
|
||||
time_t my_signon; /* When did _we_ see the user? */
|
||||
bool SuperAdmin; /* is SuperAdmin on or off? */
|
||||
/* User's real hostname */
|
||||
Anope::string host;
|
||||
/* User's virtual hostname */
|
||||
Anope::string vhost;
|
||||
/* User's cloaked hostname */
|
||||
Anope::string chost;
|
||||
/* Realname */
|
||||
Anope::string realname;
|
||||
/* SSL Fingerprint */
|
||||
Anope::string fingerprint;
|
||||
/* User's IP */
|
||||
Anope::string ip;
|
||||
/* Server user is connected to */
|
||||
Server *server;
|
||||
/* When the user signed on. Set on connect and never modified. */
|
||||
time_t signon;
|
||||
/* Timestamp of the nick. Updated when the nick changes. */
|
||||
time_t timestamp;
|
||||
/* Is the user as super admin? */
|
||||
bool super_admin;
|
||||
|
||||
/* Channels the user is in */
|
||||
UChannelList chans;
|
||||
typedef std::list<ChanUserContainer *> ChanUserList;
|
||||
ChanUserList chans;
|
||||
|
||||
unsigned short invalid_pw_count; /* # of invalid password attempts */
|
||||
time_t invalid_pw_time; /* Time of last invalid password */
|
||||
|
||||
time_t lastmemosend; /* Last time MS SEND command used */
|
||||
time_t lastnickreg; /* Last time NS REGISTER cmd used */
|
||||
time_t lastmail; /* Last time this user sent a mail */
|
||||
|
||||
/****************************************************************/
|
||||
/* Last time this user sent a memo command used */
|
||||
time_t lastmemosend;
|
||||
/* Last time this user registered */
|
||||
time_t lastnickreg;
|
||||
/* Last time this user sent an email */
|
||||
time_t lastmail;
|
||||
|
||||
/** Create a new user object, initialising necessary fields and
|
||||
* adds it to the hash
|
||||
@@ -82,18 +95,28 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
|
||||
* @param snick The nickname of the user.
|
||||
* @param sident The username of the user
|
||||
* @param shost The hostname of the user
|
||||
* @param svhost The vhost of the user
|
||||
* @param sip The ip of the user
|
||||
* @param sserver The server of the user
|
||||
* @param srealname The realname/gecos of teh user
|
||||
* @param ssignon User's timestamp
|
||||
* @param smodes User's modes
|
||||
* @param suid The unique identifier of the user.
|
||||
*/
|
||||
User(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &suid = "");
|
||||
User(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, const Anope::string &sip, Server *sserver, const Anope::string &srealname, time_t ssignon, const Anope::string &smodes, const Anope::string &suid = "");
|
||||
|
||||
protected:
|
||||
/** Destroy a user.
|
||||
*/
|
||||
virtual ~User();
|
||||
|
||||
public:
|
||||
/** Update the nickname of a user record accordingly, should be
|
||||
* called from ircd protocol.
|
||||
* @param newnick The new username
|
||||
* @param ts The time the nick was changed, User::timestamp will be updated to this.
|
||||
*/
|
||||
void SetNewNick(const Anope::string &newnick);
|
||||
void ChangeNick(const Anope::string &newnick, time_t ts = Anope::CurTime);
|
||||
|
||||
/** Update the displayed (vhost) of a user record.
|
||||
* This is used (if set) instead of real host.
|
||||
@@ -116,8 +139,7 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
|
||||
*/
|
||||
const Anope::string &GetCloakedHost() const;
|
||||
|
||||
/** Retrieves the UID of the user, where applicable, if set.
|
||||
* This is not used on some IRCds, but is for a lot e.g. P10, TS6 protocols.
|
||||
/** Retrieves the UID of the user, if set, else the nick.
|
||||
* @return The UID of the user.
|
||||
*/
|
||||
const Anope::string &GetUID() const;
|
||||
@@ -144,7 +166,7 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
|
||||
*/
|
||||
const Anope::string &GetIdent() const;
|
||||
|
||||
/** Get the full mask ( nick!ident@realhost ) of a user
|
||||
/** Get the full mask (nick!ident@realhost) of a user
|
||||
*/
|
||||
Anope::string GetMask() const;
|
||||
|
||||
@@ -193,16 +215,16 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
|
||||
virtual NickCore *Account() const;
|
||||
|
||||
/** Check if the user is identified for their nick
|
||||
* @param CheckNick 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
|
||||
*/
|
||||
bool IsIdentified(bool CheckNick = false) const;
|
||||
bool IsIdentified(bool check_nick = false) const;
|
||||
|
||||
/** Check if the user is recognized for their nick (on the nicks access list)
|
||||
* @param CheckSecure Only returns true if the user has secure off
|
||||
* @param check_nick Only returns true if the user has secure off
|
||||
* @return true or false
|
||||
*/
|
||||
bool IsRecognized(bool CheckSecure = true) const;
|
||||
bool IsRecognized(bool check_nick = true) const;
|
||||
|
||||
/** Check if the user is a services oper
|
||||
* @return true if they are an oper
|
||||
@@ -226,16 +248,16 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
|
||||
void UpdateHost();
|
||||
|
||||
/** Check if the user has a mode
|
||||
* @param Name Mode name
|
||||
* @param name Mode name
|
||||
* @return true or false
|
||||
*/
|
||||
bool HasMode(UserModeName Name) const;
|
||||
bool HasMode(const Anope::string &name) const;
|
||||
|
||||
/** Set a mode internally on the user, the IRCd is not informed
|
||||
* @param um The user mode
|
||||
* @param Param The param, if there is one
|
||||
*/
|
||||
void SetModeInternal(UserMode *um, const Anope::string &Param = "");
|
||||
void SetModeInternal(UserMode *um, const Anope::string ¶m = "");
|
||||
|
||||
/** Remove a mode internally on the user, the IRCd is not informed
|
||||
* @param um The user mode
|
||||
@@ -247,14 +269,14 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
|
||||
* @param um The user mode
|
||||
* @param Param Optional param for the mode
|
||||
*/
|
||||
void SetMode(const BotInfo *bi, UserMode *um, const Anope::string &Param = "");
|
||||
void SetMode(const BotInfo *bi, UserMode *um, const Anope::string ¶m = "");
|
||||
|
||||
/** Set a mode on the user
|
||||
* @param bi The client setting the mode
|
||||
* @param Name The mode name
|
||||
* @param name The mode name
|
||||
* @param Param Optional param for the mode
|
||||
*/
|
||||
void SetMode(const BotInfo *bi, UserModeName Name, const Anope::string &Param = "");
|
||||
void SetMode(const BotInfo *bi, const Anope::string &name, const Anope::string ¶m = "");
|
||||
|
||||
/** Remove a mode on the user
|
||||
* @param bi The client setting the mode
|
||||
@@ -264,9 +286,9 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
|
||||
|
||||
/** Remove a mode from the user
|
||||
* @param bi The client setting the mode
|
||||
* @param Name The mode name
|
||||
* @param name The mode name
|
||||
*/
|
||||
void RemoveMode(const BotInfo *bi, UserModeName Name);
|
||||
void RemoveMode(const BotInfo *bi, const Anope::string &name);
|
||||
|
||||
/** Set a string of modes on a user
|
||||
* @param bi The client setting the modes
|
||||
@@ -290,7 +312,7 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
|
||||
* @param c The channel
|
||||
* @return The channel container, or NULL
|
||||
*/
|
||||
ChannelContainer *FindChannel(const Channel *c) const;
|
||||
ChanUserContainer *FindChannel(const Channel *c) const;
|
||||
|
||||
/** Check if the user is protected from kicks and negative mode changes
|
||||
* @return true or false
|
||||
@@ -302,21 +324,45 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
|
||||
* @param reason The reason for the kill
|
||||
*/
|
||||
void Kill(const Anope::string &source, const Anope::string &reason);
|
||||
|
||||
/** Process a kill for a user
|
||||
* @param source The user/server doing the kill
|
||||
* @param reason The reason for the kill
|
||||
*/
|
||||
void KillInternal(const Anope::string &source, const Anope::string &reason);
|
||||
|
||||
/** Processes a quit for the user, and marks them as quit
|
||||
* @param reason The reason for the quit
|
||||
*/
|
||||
void Quit(const Anope::string &reason = "");
|
||||
|
||||
bool Quitting() const;
|
||||
|
||||
/* Returns a mask that will most likely match any address the
|
||||
* user will have from that location. For IP addresses, wildcards the
|
||||
* appropriate subnet mask (e.g. 35.1.1.1 -> 35.*; 128.2.1.1 -> 128.2.*);
|
||||
* for named addresses, wildcards the leftmost part of the name unless the
|
||||
* name only contains two parts. If the username begins with a ~, delete
|
||||
* it.
|
||||
*/
|
||||
Anope::string Mask() const;
|
||||
|
||||
/** Notes the usage of an incorrect password. If too many
|
||||
* incorrect passwords are used the user might be killed.
|
||||
* @return true if the user was killed
|
||||
*/
|
||||
bool BadPassword();
|
||||
|
||||
/** Finds a user by nick, or possibly UID
|
||||
* @param name The nick, or possibly UID, to lookup
|
||||
* @param nick_only set to true to only look up by nick, not UID
|
||||
* @return the user, if they exist
|
||||
*/
|
||||
static User* Find(const Anope::string &name, bool nick_only = false);
|
||||
|
||||
/** Quits all users who are pending to be quit
|
||||
*/
|
||||
static void QuitUsers();
|
||||
};
|
||||
|
||||
extern CoreExport int32_t opcnt;
|
||||
extern CoreExport uint32_t maxusercnt, usercnt;
|
||||
extern CoreExport time_t maxusertime;
|
||||
|
||||
extern CoreExport User *finduser(const Anope::string &nick);
|
||||
|
||||
extern CoreExport User *do_nick(const Anope::string &source, const Anope::string &nick, const Anope::string &username, const Anope::string &host, const Anope::string &server, const Anope::string &realname, time_t ts, const Anope::string &ip, const Anope::string &vhost, const Anope::string &uid, const Anope::string &modes);
|
||||
|
||||
extern CoreExport void do_umode(const Anope::string &user, const Anope::string &modes);
|
||||
extern CoreExport void do_kill(User *user, const Anope::string &reason);
|
||||
|
||||
extern CoreExport bool matches_list(Channel *c, User *user, ChannelModeName mode);
|
||||
|
||||
extern CoreExport Anope::string create_mask(User *u);
|
||||
|
||||
#endif // USERS_H
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/* Build bumper
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
|
||||
@@ -1,29 +1,31 @@
|
||||
/* OperServ support
|
||||
/*
|
||||
*
|
||||
* (C) 2008-2012 Anope Team
|
||||
* (C) 2008-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef OPER_H
|
||||
#define OPER_H
|
||||
#ifndef XLINE_H
|
||||
#define XLINE_H
|
||||
|
||||
#include "serialize.h"
|
||||
#include "service.h"
|
||||
|
||||
/* An Xline, eg, anything added with operserv/akill, or any of the operserv/sxline commands */
|
||||
class CoreExport XLine : public Serializable
|
||||
{
|
||||
void InitRegex();
|
||||
public:
|
||||
Anope::string Mask;
|
||||
Anope::string mask;
|
||||
Regex *regex;
|
||||
Anope::string By;
|
||||
time_t Created;
|
||||
time_t Expires;
|
||||
Anope::string Reason;
|
||||
Anope::string by;
|
||||
time_t created;
|
||||
time_t expires;
|
||||
Anope::string reason;
|
||||
XLineManager *manager;
|
||||
Anope::string UID;
|
||||
Anope::string id;
|
||||
|
||||
XLine(const Anope::string &mask, const Anope::string &reason = "", const Anope::string &uid = "");
|
||||
|
||||
@@ -40,18 +42,18 @@ class CoreExport XLine : public Serializable
|
||||
bool HasNickOrReal() const;
|
||||
bool IsRegex() const;
|
||||
|
||||
const Anope::string serialize_name() const anope_override;
|
||||
Serialize::Data serialize() const anope_override;
|
||||
static Serializable* unserialize(Serializable *obj, Serialize::Data &data);
|
||||
void Serialize(Serialize::Data &data) const anope_override;
|
||||
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data);
|
||||
};
|
||||
|
||||
/* Managers XLines. There is one XLineManager per type of XLine. */
|
||||
class CoreExport XLineManager : public Service
|
||||
{
|
||||
char type;
|
||||
/* List of XLines in this XLineManager */
|
||||
serialize_checker<std::vector<XLine *> > XLines;
|
||||
Serialize::Checker<std::vector<XLine *> > xlines;
|
||||
/* Akills can have the same IDs, sometimes */
|
||||
static serialize_checker<std::multimap<Anope::string, XLine *, ci::less> > XLinesByUID;
|
||||
static Serialize::Checker<std::multimap<Anope::string, XLine *, ci::less> > XLinesByUID;
|
||||
public:
|
||||
/* List of XLine managers we check users against in XLineManager::CheckAll */
|
||||
static std::list<XLineManager *> XLineManagers;
|
||||
@@ -175,4 +177,4 @@ class CoreExport XLineManager : public Service
|
||||
virtual void SendDel(XLine *x) = 0;
|
||||
};
|
||||
|
||||
#endif // OPER_H
|
||||
#endif // XLINE_H
|
||||
@@ -29,7 +29,6 @@ if(GETTEXT_FOUND)
|
||||
endif(NOT WIN32)
|
||||
|
||||
# Install the new language file
|
||||
install(CODE "FILE(MAKE_DIRECTORY \"${LOCALE_DIR}/${LANG_LANG}/LC_MESSAGES/\")")
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG_MO} DESTINATION ${LOCALE_DIR}/${LANG_LANG}/LC_MESSAGES RENAME ${LANG_DOMAIN}.mo PERMISSIONS ${PERMS})
|
||||
endforeach(LANG_PO)
|
||||
|
||||
|
||||
+3459
-2959
File diff suppressed because it is too large
Load Diff
+2942
-2487
File diff suppressed because it is too large
Load Diff
+5110
-4595
File diff suppressed because it is too large
Load Diff
+2839
-2331
File diff suppressed because it is too large
Load Diff
+4221
-3718
File diff suppressed because it is too large
Load Diff
+4490
-3990
File diff suppressed because it is too large
Load Diff
+3329
-2843
File diff suppressed because it is too large
Load Diff
+3843
-3346
File diff suppressed because it is too large
Load Diff
+4570
-4105
File diff suppressed because it is too large
Load Diff
+3944
-3455
File diff suppressed because it is too large
Load Diff
+5100
-4615
File diff suppressed because it is too large
Load Diff
+4050
-3566
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -4,7 +4,7 @@ rm -f anope.pot
|
||||
touch anope.pot
|
||||
|
||||
cd ..
|
||||
FILES=`find ./ -name *.cpp -o -name *.h | grep -v /modules/third/`
|
||||
FILES=`find ./ -name *.cpp -o -name *.h -o -name *.conf | grep -v /modules/third/`
|
||||
for f in $FILES
|
||||
do
|
||||
xgettext -E -C -s -d Anope -j -o language/anope.pot --from-code=utf-8 --keyword --keyword=_ $f
|
||||
|
||||
+10
-9
@@ -42,7 +42,7 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS})
|
||||
# Temporary variable for the current source's include directories
|
||||
set(TEMP_INCLUDES)
|
||||
# Calculate the header file dependencies for the given source file
|
||||
calculate_depends(${SRC} SKIP_DEPENDS TEMP_INCLUDES)
|
||||
calculate_depends(${SRC} SKIP_DEPENDS FALSE TEMP_INCLUDES)
|
||||
# If there were some extra include directories, add them to the list
|
||||
if(TEMP_INCLUDES)
|
||||
append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES})
|
||||
@@ -54,7 +54,7 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS})
|
||||
# Reset skip_libraries
|
||||
set(SKIP_LIBRARIES)
|
||||
# Calculate the library dependencies for the given source file
|
||||
calculate_libraries(${SRC} SKIP_LIBRARIES TEMP_LDFLAGS TEMP_DEPENDENCIES)
|
||||
calculate_libraries(${SRC} SKIP_LIBRARIES FALSE TEMP_LDFLAGS TEMP_DEPENDENCIES)
|
||||
if(NOT SKIP_DEPENDS AND NOT SKIP_LIBRARIES)
|
||||
# Reset has_function
|
||||
set(HAS_FUNCTION)
|
||||
@@ -76,7 +76,7 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS})
|
||||
else(WIN32)
|
||||
set(WIN32_NO_LIBS)
|
||||
endif(WIN32)
|
||||
set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${TEMP_LDFLAGS} ${WIN32_NO_LIBS}")
|
||||
set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${TEMP_LDFLAGS} ${WIN32_NO_LIBS}" INSTALL_RPATH_USE_LINK_PATH ON BUILD_WITH_INSTALL_RPATH ON)
|
||||
add_dependencies(${SO} ${PROGRAM_NAME})
|
||||
if(GETTEXT_FOUND)
|
||||
add_dependencies(${SO} module_language)
|
||||
@@ -86,7 +86,7 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS})
|
||||
target_link_libraries(${SO} ${PROGRAM_NAME} wsock32 Ws2_32 ${WIN32_MEMORY} ${TEMP_DEPENDENCIES})
|
||||
set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}")
|
||||
else(WIN32)
|
||||
target_link_libraries(${SO} ${PROGRAM_NAME} ${TEMP_DEPENDENCIES})
|
||||
target_link_libraries(${SO} ${TEMP_DEPENDENCIES})
|
||||
endif(WIN32)
|
||||
# Set the module to be installed to the module directory under the data directory
|
||||
install(TARGETS ${SO}
|
||||
@@ -94,7 +94,7 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS})
|
||||
)
|
||||
endif(HAS_FUNCTION)
|
||||
else(NOT SKIP_DEPENDS AND NOT SKIP_LIBRARIES)
|
||||
message(" This is not a fatal error - ${SRC} will not be built.")
|
||||
message(" ${SRC} can not be built due to missing dependencies.")
|
||||
endif(NOT SKIP_DEPENDS AND NOT SKIP_LIBRARIES)
|
||||
endforeach(SRC)
|
||||
|
||||
@@ -137,7 +137,7 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS})
|
||||
# Temporary variable for the current source's include directories
|
||||
set(TEMP_INCLUDES)
|
||||
# Calculate the header file dependencies for the given source file
|
||||
calculate_depends(${SRC} SKIP_DEPENDS TEMP_INCLUDES)
|
||||
calculate_depends(${SRC} SKIP_DEPENDS FALSE TEMP_INCLUDES)
|
||||
# If there were some extra include directories, add them to the list
|
||||
if(TEMP_INCLUDES)
|
||||
append_to_list(EXTRA_INCLUDES ${TEMP_INCLUDES})
|
||||
@@ -147,7 +147,7 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS})
|
||||
# Reset extra dependencies
|
||||
set(TEMP_DEPENDENCIES)
|
||||
# Calculate the library dependencies for the given source file
|
||||
calculate_libraries(${SRC} SKIP_LIBRARIES TEMP_LDFLAGS TEMP_DEPENDENCIES)
|
||||
calculate_libraries(${SRC} SKIP_LIBRARIES FALSE TEMP_LDFLAGS TEMP_DEPENDENCIES)
|
||||
# Check the function dependencies for the given source file
|
||||
check_functions(${SRC} HAS_FUNCTION)
|
||||
|
||||
@@ -178,8 +178,9 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS})
|
||||
|
||||
# Generate the module and set it's linker flags, also set it to depend on the main Anope executable to be built beforehand
|
||||
add_library(${SO} MODULE ${MODULES_SUBDIR_SRCS})
|
||||
set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${SUBDIR_LDFLAGS}")
|
||||
set_target_properties(${SO} PROPERTIES LINKER_LANGUAGE CXX PREFIX "" SUFFIX "" LINK_FLAGS "${SUBDIR_LDFLAGS}" INSTALL_RPATH_USE_LINK_PATH ON BUILD_WITH_INSTALL_RPATH ON)
|
||||
add_dependencies(${SO} ${PROGRAM_NAME})
|
||||
target_link_libraries(${SO} ${PROGRAM_NAME})
|
||||
if(GETTEXT_FOUND)
|
||||
add_dependencies(${SO} module_language)
|
||||
endif(GETTEXT_FOUND)
|
||||
@@ -193,7 +194,7 @@ foreach(MODULE_FOLDER ${MODULES_FOLDERS})
|
||||
DESTINATION ${LIB_DIR}/modules
|
||||
)
|
||||
else(NOT SKIP_DEPENDS AND NOT SKIP_LIBRARIES AND HAS_FUNCTION)
|
||||
message(" This is not a fatal error - ${SUBDIR} will not be built.")
|
||||
message(" ${SRC} can not be built due to missing dependencies.")
|
||||
endif(NOT SKIP_DEPENDS AND NOT SKIP_LIBRARIES AND HAS_FUNCTION)
|
||||
|
||||
# Run the directories CMakeLists.txt if there is one
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* BotServ core functions
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -27,20 +27,20 @@ class CommandBSAssign : public Command
|
||||
const Anope::string &chan = params[0];
|
||||
const Anope::string &nick = params[1];
|
||||
|
||||
if (readonly)
|
||||
if (Anope::ReadOnly)
|
||||
{
|
||||
source.Reply(BOT_ASSIGN_READONLY);
|
||||
return;
|
||||
}
|
||||
|
||||
ChannelInfo *ci = cs_findchan(params[0]);
|
||||
ChannelInfo *ci = ChannelInfo::Find(params[0]);
|
||||
if (ci == NULL)
|
||||
{
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
BotInfo *bi = findbot(nick);
|
||||
BotInfo *bi = BotInfo::Find(nick, true);
|
||||
if (!bi)
|
||||
{
|
||||
source.Reply(BOT_DOES_NOT_EXIST, nick.c_str());
|
||||
@@ -48,13 +48,13 @@ class CommandBSAssign : public Command
|
||||
}
|
||||
|
||||
AccessGroup access = source.AccessFor(ci);
|
||||
if (ci->botflags.HasFlag(BS_NOBOT) || (!access.HasPriv("ASSIGN") && !source.HasPriv("botserv/administration")))
|
||||
if (ci->HasExt("BS_NOBOT") || (!access.HasPriv("ASSIGN") && !source.HasPriv("botserv/administration")))
|
||||
{
|
||||
source.Reply(ACCESS_DENIED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (bi->HasFlag(BI_PRIVATE) && !source.HasCommand("botserv/assign/private"))
|
||||
if (bi->oper_only && !source.HasPriv("botserv/administration"))
|
||||
{
|
||||
source.Reply(ACCESS_DENIED);
|
||||
return;
|
||||
@@ -95,13 +95,13 @@ class CommandBSUnassign : public Command
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
if (readonly)
|
||||
if (Anope::ReadOnly)
|
||||
{
|
||||
source.Reply(BOT_ASSIGN_READONLY);
|
||||
return;
|
||||
}
|
||||
|
||||
ChannelInfo *ci = cs_findchan(params[0]);
|
||||
ChannelInfo *ci = ChannelInfo::Find(params[0]);
|
||||
if (ci == NULL)
|
||||
{
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
@@ -121,7 +121,7 @@ class CommandBSUnassign : public Command
|
||||
return;
|
||||
}
|
||||
|
||||
if (ci->HasFlag(CI_PERSIST) && !ModeManager::FindChannelModeByName(CMODE_PERM))
|
||||
if (ci->HasExt("PERSIST") && !ModeManager::FindChannelModeByName("PERM"))
|
||||
{
|
||||
source.Reply(_("You can not unassign bots while persist is set on the channel."));
|
||||
return;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* BotServ core functions
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -19,10 +19,10 @@ class BadwordsDelCallback : public NumberList
|
||||
CommandSource &source;
|
||||
ChannelInfo *ci;
|
||||
Command *c;
|
||||
unsigned Deleted;
|
||||
unsigned deleted;
|
||||
bool override;
|
||||
public:
|
||||
BadwordsDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c), Deleted(0), override(false)
|
||||
BadwordsDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c), deleted(0), override(false)
|
||||
{
|
||||
if (!source.AccessFor(ci).HasPriv("BADWORDS") && source.HasPriv("botserv/administration"))
|
||||
this->override = true;
|
||||
@@ -30,12 +30,12 @@ class BadwordsDelCallback : public NumberList
|
||||
|
||||
~BadwordsDelCallback()
|
||||
{
|
||||
if (!Deleted)
|
||||
if (!deleted)
|
||||
source.Reply(_("No matching entries on %s bad words list."), ci->name.c_str());
|
||||
else if (Deleted == 1)
|
||||
else if (deleted == 1)
|
||||
source.Reply(_("Deleted 1 entry from %s bad words list."), ci->name.c_str());
|
||||
else
|
||||
source.Reply(_("Deleted %d entries from %s bad words list."), Deleted, ci->name.c_str());
|
||||
source.Reply(_("Deleted %d entries from %s bad words list."), deleted, ci->name.c_str());
|
||||
}
|
||||
|
||||
void HandleNumber(unsigned Number) anope_override
|
||||
@@ -44,7 +44,7 @@ class BadwordsDelCallback : public NumberList
|
||||
return;
|
||||
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, c, ci) << "DEL " << ci->GetBadWord(Number - 1)->word;
|
||||
++Deleted;
|
||||
++deleted;
|
||||
ci->EraseBadWord(Number - 1);
|
||||
}
|
||||
};
|
||||
@@ -58,7 +58,7 @@ class CommandBSBadwords : public Command
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "LIST";
|
||||
ListFormatter list;
|
||||
|
||||
list.addColumn("Number").addColumn("Word").addColumn("Type");
|
||||
list.AddColumn("Number").AddColumn("Word").AddColumn("Type");
|
||||
|
||||
if (!ci->GetBadWordCount())
|
||||
{
|
||||
@@ -86,7 +86,7 @@ class CommandBSBadwords : public Command
|
||||
entry["Number"] = stringify(Number);
|
||||
entry["Word"] = bw->word;
|
||||
entry["Type"] = bw->type == BW_SINGLE ? "(SINGLE)" : (bw->type == BW_START ? "(START)" : (bw->type == BW_END ? "(END)" : ""));
|
||||
this->list.addEntry(entry);
|
||||
this->list.AddEntry(entry);
|
||||
}
|
||||
}
|
||||
nl_list(list, ci, word);
|
||||
@@ -105,23 +105,23 @@ class CommandBSBadwords : public Command
|
||||
entry["Number"] = stringify(i + 1);
|
||||
entry["Word"] = bw->word;
|
||||
entry["Type"] = bw->type == BW_SINGLE ? "(SINGLE)" : (bw->type == BW_START ? "(START)" : (bw->type == BW_END ? "(END)" : ""));
|
||||
list.addEntry(entry);
|
||||
list.AddEntry(entry);
|
||||
}
|
||||
}
|
||||
|
||||
if (list.isEmpty())
|
||||
source.Reply(_("No matching entries on %s badword list."), ci->name.c_str());
|
||||
if (list.IsEmpty())
|
||||
source.Reply(_("No matching entries on %s bad words list."), ci->name.c_str());
|
||||
else
|
||||
{
|
||||
std::vector<Anope::string> replies;
|
||||
list.Process(replies);
|
||||
|
||||
source.Reply(_("Badword list for %s:"), ci->name.c_str());
|
||||
source.Reply(_("Bad words list for %s:"), ci->name.c_str());
|
||||
|
||||
for (unsigned i = 0; i < replies.size(); ++i)
|
||||
source.Reply(replies[i]);
|
||||
|
||||
source.Reply(_("End of badword list."));
|
||||
source.Reply(_("End of bad words list."));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ class CommandBSBadwords : public Command
|
||||
public:
|
||||
CommandBSBadwords(Module *creator) : Command(creator, "botserv/badwords", 2, 3)
|
||||
{
|
||||
this->SetDesc(_("Maintains bad words list"));
|
||||
this->SetDesc(_("Maintains the bad words list"));
|
||||
this->SetSyntax(_("\037channel\037 ADD \037word\037 [\037SINGLE\037 | \037START\037 | \037END\037]"));
|
||||
this->SetSyntax(_("\037channel\037 DEL {\037word\037 | \037entry-num\037 | \037list\037}"));
|
||||
this->SetSyntax(_("\037channel\037 LIST [\037mask\037 | \037list\037]"));
|
||||
@@ -241,7 +241,7 @@ class CommandBSBadwords : public Command
|
||||
return;
|
||||
}
|
||||
|
||||
ChannelInfo *ci = cs_findchan(params[0]);
|
||||
ChannelInfo *ci = ChannelInfo::Find(params[0]);
|
||||
if (ci == NULL)
|
||||
{
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
@@ -254,7 +254,7 @@ class CommandBSBadwords : public Command
|
||||
return;
|
||||
}
|
||||
|
||||
if (readonly)
|
||||
if (Anope::ReadOnly)
|
||||
{
|
||||
source.Reply(_("Sorry, channel bad words list modification is temporarily disabled."));
|
||||
return;
|
||||
@@ -282,14 +282,14 @@ class CommandBSBadwords : public Command
|
||||
"type \002%s%s HELP KICK %s\002.\n"
|
||||
" \n"
|
||||
"The \002ADD\002 command adds the given word to the\n"
|
||||
"badword list. If SINGLE is specified, a kick will be\n"
|
||||
"done only if a user says the entire word. If START is \n"
|
||||
"bad words list. If SINGLE is specified, a kick will be\n"
|
||||
"done only if a user says the entire word. If START is\n"
|
||||
"specified, a kick will be done if a user says a word\n"
|
||||
"that starts with \037word\037. If END is specified, a kick\n"
|
||||
"will be done if a user says a word that ends with\n"
|
||||
"\037word\037. If you don't specify anything, a kick will\n"
|
||||
"be issued every time \037word\037 is said by a user.\n"
|
||||
" \n"), Config->UseStrictPrivMsgString.c_str(), source.owner->nick.c_str(), source.command.c_str());
|
||||
" \n"), Config->UseStrictPrivMsgString.c_str(), source.service->nick.c_str(), source.command.c_str());
|
||||
source.Reply(_("The \002DEL\002 command removes the given word from the\n"
|
||||
"bad words list. If a list of entry numbers is given, those\n"
|
||||
"entries are deleted. (See the example for LIST below.)\n"
|
||||
|
||||
+40
-85
@@ -1,6 +1,6 @@
|
||||
/* BotServ core functions
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -23,7 +23,7 @@ class CommandBSBot : public Command
|
||||
const Anope::string &host = params[3];
|
||||
const Anope::string &real = params[4];
|
||||
|
||||
if (findbot(nick))
|
||||
if (BotInfo::Find(nick, true))
|
||||
{
|
||||
source.Reply(_("Bot \002%s\002 already exists."), nick.c_str());
|
||||
return;
|
||||
@@ -31,62 +31,45 @@ class CommandBSBot : public Command
|
||||
|
||||
if (nick.length() > Config->NickLen)
|
||||
{
|
||||
source.Reply(_("Bot Nicks may only contain valid nick characters."));
|
||||
source.Reply(_("Bot nicks may only be %d characters long."), Config->NickLen);
|
||||
return;
|
||||
}
|
||||
|
||||
if (user.length() > Config->UserLen)
|
||||
{
|
||||
source.Reply(_("Bot Idents may only contain %d characters."), Config->UserLen);
|
||||
source.Reply(_("Bot idents may only be %d characters long."), Config->UserLen);
|
||||
return;
|
||||
}
|
||||
|
||||
if (host.length() > Config->HostLen)
|
||||
{
|
||||
source.Reply(_("Bot Hosts may only contain %d characters."), Config->HostLen);
|
||||
source.Reply(_("Bot hosts may only be %d characters long."), Config->HostLen);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check the nick is valid re RFC 2812 */
|
||||
if (isdigit(nick[0]) || nick[0] == '-')
|
||||
if (!IRCD->IsNickValid(nick))
|
||||
{
|
||||
source.Reply(_("Bot Nicks may only contain valid nick characters."));
|
||||
source.Reply(_("Bot nicks may only contain valid nick characters."));
|
||||
return;
|
||||
}
|
||||
|
||||
for (unsigned i = 0, end = nick.length(); i < end && i < Config->NickLen; ++i)
|
||||
if (!isvalidnick(nick[i]))
|
||||
{
|
||||
source.Reply(_("Bot Nicks may only contain valid nick characters."));
|
||||
return;
|
||||
}
|
||||
|
||||
/* check for hardcored ircd forbidden nicks */
|
||||
if (!ircdproto->IsNickValid(nick))
|
||||
if (!IRCD->IsIdentValid(user))
|
||||
{
|
||||
source.Reply(_("Bot Nicks may only contain valid nick characters."));
|
||||
source.Reply(_("Bot idents may only contain valid ident characters."));
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check the host is valid */
|
||||
if (!IsValidHost(host))
|
||||
if (!IRCD->IsHostValid(host))
|
||||
{
|
||||
source.Reply(_("Bot Hosts may only contain valid host characters."));
|
||||
source.Reply(_("Bot hosts may only contain valid host characters."));
|
||||
return;
|
||||
}
|
||||
|
||||
for (unsigned i = 0, end = user.length(); i < end && i < Config->UserLen; ++i)
|
||||
if (!isalnum(user[i]))
|
||||
{
|
||||
source.Reply(_("Bot Idents may only contain valid characters."), Config->UserLen);
|
||||
return;
|
||||
}
|
||||
|
||||
/* We check whether the nick is registered, and inform the user
|
||||
* if so. You need to drop the nick manually before you can use
|
||||
* it as a bot nick from now on -GD
|
||||
*/
|
||||
if (findnick(nick))
|
||||
if (NickAlias::Find(nick))
|
||||
{
|
||||
source.Reply(NICK_ALREADY_REGISTERED, nick.c_str());
|
||||
return;
|
||||
@@ -116,40 +99,34 @@ class CommandBSBot : public Command
|
||||
return;
|
||||
}
|
||||
|
||||
BotInfo *bi = findbot(oldnick);
|
||||
BotInfo *bi = BotInfo::Find(oldnick, true);
|
||||
if (!bi)
|
||||
{
|
||||
source.Reply(BOT_DOES_NOT_EXIST, oldnick.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!oldnick.equals_ci(nick) && nickIsServices(oldnick, false))
|
||||
if (bi->conf)
|
||||
{
|
||||
source.Reply(BOT_DOES_NOT_EXIST, oldnick.c_str());
|
||||
source.Reply(_("Bot %s is not changeable."), bi->nick.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if (nick.length() > Config->NickLen)
|
||||
{
|
||||
source.Reply(_("Bot Nicks may only contain valid nick characters."));
|
||||
source.Reply(_("Bot nicks may only be %d characters long."), Config->NickLen);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!user.empty() && user.length() > Config->UserLen)
|
||||
{
|
||||
source.Reply(_("Bot Idents may only contain %d characters."), Config->UserLen);
|
||||
source.Reply(_("Bot idents may only be %d characters long."), Config->UserLen);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!host.empty() && host.length() > Config->HostLen)
|
||||
{
|
||||
source.Reply(_("Bot Hosts may only contain %d characters."), Config->HostLen);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!oldnick.equals_ci(nick) && nickIsServices(nick, false))
|
||||
{
|
||||
source.Reply(BOT_DOES_NOT_EXIST, oldnick.c_str());
|
||||
source.Reply(_("Bot hosts may only be %d characters long."), Config->HostLen);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -164,42 +141,25 @@ class CommandBSBot : public Command
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check the nick is valid re RFC 2812 */
|
||||
if (isdigit(nick[0]) || nick[0] == '-')
|
||||
if (!IRCD->IsNickValid(nick))
|
||||
{
|
||||
source.Reply(_("Bot Nicks may only contain valid nick characters."));
|
||||
source.Reply(_("Bot nicks may only contain valid nick characters."));
|
||||
return;
|
||||
}
|
||||
|
||||
for (unsigned i = 0, end = nick.length(); i < end && i < Config->NickLen; ++i)
|
||||
if (!isvalidnick(nick[i]))
|
||||
{
|
||||
source.Reply(_("Bot Nicks may only contain valid nick characters."));
|
||||
return;
|
||||
}
|
||||
|
||||
/* check for hardcored ircd forbidden nicks */
|
||||
if (!ircdproto->IsNickValid(nick))
|
||||
if (!user.empty() && !IRCD->IsIdentValid(user))
|
||||
{
|
||||
source.Reply(_("Bot Nicks may only contain valid nick characters."));
|
||||
source.Reply(_("Bot idents may only contain valid ident characters."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!host.empty() && !IsValidHost(host))
|
||||
if (!host.empty() && !IRCD->IsHostValid(host))
|
||||
{
|
||||
source.Reply(_("Bot Hosts may only contain valid host characters."));
|
||||
source.Reply(_("Bot hosts may only contain valid host characters."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!user.empty())
|
||||
for (unsigned i = 0, end = user.length(); i < end && i < Config->UserLen; ++i)
|
||||
if (!isalnum(user[i]))
|
||||
{
|
||||
source.Reply(_("Bot Idents may only contain valid characters."), Config->UserLen);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!nick.equals_ci(bi->nick) && findbot(nick))
|
||||
if (!nick.equals_ci(bi->nick) && BotInfo::Find(nick, true))
|
||||
{
|
||||
source.Reply(_("Bot \002%s\002 already exists."), nick.c_str());
|
||||
return;
|
||||
@@ -211,30 +171,25 @@ class CommandBSBot : public Command
|
||||
* if so. You need to drop the nick manually before you can use
|
||||
* it as a bot nick from now on -GD
|
||||
*/
|
||||
if (findnick(nick))
|
||||
if (NickAlias::Find(nick))
|
||||
{
|
||||
source.Reply(NICK_ALREADY_REGISTERED, nick.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
/* The new nick is really different, so we remove the Q line for the old nick. */
|
||||
if (ircd->sqline)
|
||||
{
|
||||
XLine x(bi->nick);
|
||||
ircdproto->SendSQLineDel(&x);
|
||||
}
|
||||
XLine x_del(bi->nick);
|
||||
IRCD->SendSQLineDel(&x_del);
|
||||
|
||||
/* Add a Q line for the new nick */
|
||||
XLine x(nick, "Reserved for services");
|
||||
ircdproto->SendSQLine(NULL, &x);
|
||||
IRCD->SendSQLine(NULL, &x);
|
||||
}
|
||||
|
||||
if (!user.empty())
|
||||
ircdproto->SendQuit(bi, "Quit: Be right back");
|
||||
IRCD->SendQuit(bi, "Quit: Be right back");
|
||||
else
|
||||
{
|
||||
ircdproto->SendChangeBotNick(bi, nick);
|
||||
}
|
||||
IRCD->SendNickChange(bi, nick);
|
||||
|
||||
if (!nick.equals_cs(bi->nick))
|
||||
bi->SetNewNick(nick);
|
||||
@@ -248,11 +203,11 @@ class CommandBSBot : public Command
|
||||
|
||||
if (!user.empty())
|
||||
{
|
||||
ircdproto->SendClientIntroduction(bi);
|
||||
IRCD->SendClientIntroduction(bi);
|
||||
bi->RejoinAll();
|
||||
}
|
||||
|
||||
source.Reply(_("Bot \002%s\002 has been changed to %s!%s@%s (%s)"), oldnick.c_str(), bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str());
|
||||
source.Reply(_("Bot \002%s\002 has been changed to %s!%s@%s (%s)."), oldnick.c_str(), bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str());
|
||||
Log(LOG_ADMIN, source, this) << "CHANGE " << oldnick << " to " << bi->GetMask() << " " << bi->realname;
|
||||
|
||||
FOREACH_MOD(I_OnBotChange, OnBotChange(bi));
|
||||
@@ -269,16 +224,16 @@ class CommandBSBot : public Command
|
||||
return;
|
||||
}
|
||||
|
||||
BotInfo *bi = findbot(nick);
|
||||
BotInfo *bi = BotInfo::Find(nick, true);
|
||||
if (!bi)
|
||||
{
|
||||
source.Reply(BOT_DOES_NOT_EXIST, nick.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if (nickIsServices(nick, false))
|
||||
if (bi->conf)
|
||||
{
|
||||
source.Reply(BOT_DOES_NOT_EXIST, nick.c_str());
|
||||
source.Reply(_("Bot %s is not deletable."), bi->nick.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -287,7 +242,7 @@ class CommandBSBot : public Command
|
||||
Log(LOG_ADMIN, source, this) << "DEL " << bi->nick;
|
||||
|
||||
source.Reply(_("Bot \002%s\002 has been deleted."), nick.c_str());
|
||||
bi->destroy();
|
||||
delete bi;
|
||||
return;
|
||||
}
|
||||
public:
|
||||
@@ -303,7 +258,7 @@ class CommandBSBot : public Command
|
||||
{
|
||||
const Anope::string &cmd = params[0];
|
||||
|
||||
if (readonly)
|
||||
if (Anope::ReadOnly)
|
||||
{
|
||||
source.Reply(_("Sorry, bot modification is temporarily disabled."));
|
||||
return;
|
||||
@@ -381,12 +336,12 @@ class CommandBSBot : public Command
|
||||
"channels.\n"
|
||||
" \n"
|
||||
"\002BOT ADD\002 adds a bot with the given nickname, username,\n"
|
||||
"hostname and realname. Since no integrity checks are done \n"
|
||||
"hostname and realname. Since no integrity checks are done\n"
|
||||
"for these settings, be really careful.\n"
|
||||
"\002BOT CHANGE\002 allows to change nickname, username, hostname\n"
|
||||
"or realname of a bot without actually delete it (and all\n"
|
||||
"the data associated with it).\n"
|
||||
"\002BOT DEL\002 removes the given bot from the bot list. \n"
|
||||
"\002BOT DEL\002 removes the given bot from the bot list.\n"
|
||||
" \n"
|
||||
"\002Note\002: you cannot create a bot that has a nick that is\n"
|
||||
"currently registered. If an unregistered user is currently\n"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* BotServ core functions
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -27,19 +27,19 @@ class CommandBSBotList : public Command
|
||||
unsigned count = 0;
|
||||
ListFormatter list;
|
||||
|
||||
list.addColumn("Nick").addColumn("Mask");
|
||||
list.AddColumn("Nick").AddColumn("Mask");
|
||||
|
||||
for (Anope::insensitive_map<BotInfo *>::const_iterator it = BotListByNick->begin(), it_end = BotListByNick->end(); it != it_end; ++it)
|
||||
for (botinfo_map::const_iterator it = BotListByNick->begin(), it_end = BotListByNick->end(); it != it_end; ++it)
|
||||
{
|
||||
BotInfo *bi = it->second;
|
||||
|
||||
if (source.HasCommand("botserv/botlist") || !bi->HasFlag(BI_PRIVATE))
|
||||
if (source.HasPriv("botserv/administration") || !bi->oper_only)
|
||||
{
|
||||
++count;
|
||||
ListFormatter::ListEntry entry;
|
||||
entry["Nick"] = (bi->HasFlag(BI_PRIVATE) ? "* " : "") + bi->nick;
|
||||
entry["Nick"] = (bi->oper_only ? "* " : "") + bi->nick;
|
||||
entry["Mask"] = bi->GetIdent() + "@" + bi->host;
|
||||
list.addEntry(entry);
|
||||
list.AddEntry(entry);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ class CommandBSBotList : public Command
|
||||
this->SendSyntax(source);
|
||||
source.Reply(" ");
|
||||
source.Reply(_("Lists all available bots on this network.\n"
|
||||
"Bots prefixed by a * are reserved for IRC operators."));
|
||||
"Bots prefixed by a * are reserved for IRC Operators."));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* BotServ core functions
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -26,7 +26,7 @@ class CommandBSSay : public Command
|
||||
{
|
||||
const Anope::string &text = params[1];
|
||||
|
||||
ChannelInfo *ci = cs_findchan(params[0]);
|
||||
ChannelInfo *ci = ChannelInfo::Find(params[0]);
|
||||
if (ci == NULL)
|
||||
{
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
@@ -57,7 +57,7 @@ class CommandBSSay : public Command
|
||||
return;
|
||||
}
|
||||
|
||||
ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", text.c_str());
|
||||
IRCD->SendPrivmsg(ci->bi, ci->name, "%s", text.c_str());
|
||||
ci->bi->lastmsg = Anope::CurTime;
|
||||
|
||||
// XXX need a way to find if someone is overriding this
|
||||
@@ -88,7 +88,7 @@ class CommandBSAct : public Command
|
||||
{
|
||||
Anope::string message = params[1];
|
||||
|
||||
ChannelInfo *ci = cs_findchan(params[0]);
|
||||
ChannelInfo *ci = ChannelInfo::Find(params[0]);
|
||||
if (ci == NULL)
|
||||
{
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
@@ -117,7 +117,7 @@ class CommandBSAct : public Command
|
||||
while ((i = message.find(1)) && i != Anope::string::npos)
|
||||
message.erase(i, 1);
|
||||
|
||||
ircdproto->SendAction(ci->bi, ci->name, "%s", message.c_str());
|
||||
IRCD->SendAction(ci->bi, ci->name, "%s", message.c_str());
|
||||
ci->bi->lastmsg = Anope::CurTime;
|
||||
|
||||
// XXX Need to be able to find if someone is overriding this.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* BotServ core functions
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -38,13 +38,13 @@ class CommandBSInfo : public Command
|
||||
buffers.push_back(buf);
|
||||
}
|
||||
|
||||
void CheckOptStr(Anope::string &buf, BotServFlag flag, const char *option, Flags<BotServFlag> &flags, const NickCore *nc)
|
||||
void CheckOptStr(Anope::string &buf, const Anope::string &flag, const char *option, Extensible *flags, const NickCore *nc)
|
||||
{
|
||||
if (flags.HasFlag(flag))
|
||||
if (flags->HasExt(flag))
|
||||
{
|
||||
if (!buf.empty())
|
||||
buf += ", ";
|
||||
buf += translate(nc, option);
|
||||
buf += Language::Translate(nc, option);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,14 +52,14 @@ class CommandBSInfo : public Command
|
||||
CommandBSInfo(Module *creator) : Command(creator, "botserv/info", 1, 1)
|
||||
{
|
||||
this->SetDesc(_("Allows you to see BotServ information about a channel or a bot"));
|
||||
this->SetSyntax(_("\002INFO {\037chan\037 | \037nick\037}\002"));
|
||||
this->SetSyntax(_("{\037chan\037|\037nick\037}"));
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
const Anope::string &query = params[0];
|
||||
|
||||
const BotInfo *bi = findbot(query);
|
||||
const BotInfo *bi = BotInfo::Find(query, true);
|
||||
ChannelInfo *ci;
|
||||
InfoFormatter info(source.nc);
|
||||
|
||||
@@ -68,8 +68,8 @@ class CommandBSInfo : public Command
|
||||
source.Reply(_("Information for bot \002%s\002:"), bi->nick.c_str());
|
||||
info[_("Mask")] = bi->GetIdent() + "@" + bi->host;
|
||||
info[_("Real name")] = bi->realname;
|
||||
info[_("Created")] = do_strftime(bi->created);
|
||||
info[_("Options")] = bi->HasFlag(BI_PRIVATE) ? _("Private") : _("None");
|
||||
info[_("Created")] = Anope::strftime(bi->created);
|
||||
info[_("Options")] = bi->oper_only ? _("Private") : _("None");
|
||||
info[_("Used on")] = stringify(bi->GetChannelCount()) + " channel(s)";
|
||||
|
||||
std::vector<Anope::string> replies;
|
||||
@@ -87,9 +87,9 @@ class CommandBSInfo : public Command
|
||||
}
|
||||
|
||||
}
|
||||
else if ((ci = cs_findchan(query)))
|
||||
else if ((ci = ChannelInfo::Find(query)))
|
||||
{
|
||||
if (!source.AccessFor(ci).HasPriv("FOUNDER") && !source.HasPriv("botserv/administration"))
|
||||
if (!source.AccessFor(ci).HasPriv("INFO") && !source.HasPriv("botserv/administration"))
|
||||
{
|
||||
source.Reply(ACCESS_DENIED);
|
||||
return;
|
||||
@@ -98,10 +98,10 @@ class CommandBSInfo : public Command
|
||||
source.Reply(CHAN_INFO_HEADER, ci->name.c_str());
|
||||
info[_("Bot nick")] = ci->bi ? ci->bi->nick : "not assigned yet";
|
||||
|
||||
Anope::string enabled = translate(source.nc, _("Enabled"));
|
||||
Anope::string disabled = translate(source.nc, _("Disabled"));
|
||||
Anope::string enabled = Language::Translate(source.nc, _("Enabled"));
|
||||
Anope::string disabled = Language::Translate(source.nc, _("Disabled"));
|
||||
|
||||
if (ci->botflags.HasFlag(BS_KICK_BADWORDS))
|
||||
if (ci->HasExt("BS_KICK_BADWORDS"))
|
||||
{
|
||||
if (ci->ttb[TTB_BADWORDS])
|
||||
info[_("Bad words kicker")] = Anope::printf("%s (%d kick(s) to ban)", enabled.c_str(), ci->ttb[TTB_BADWORDS]);
|
||||
@@ -111,7 +111,7 @@ class CommandBSInfo : public Command
|
||||
else
|
||||
info[_("Bad words kicker")] = disabled;
|
||||
|
||||
if (ci->botflags.HasFlag(BS_KICK_BOLDS))
|
||||
if (ci->HasExt("BS_KICK_BOLDS"))
|
||||
{
|
||||
if (ci->ttb[TTB_BOLDS])
|
||||
info[_("Bolds kicker")] = Anope::printf("%s (%d kick(s) to ban)", enabled.c_str(), ci->ttb[TTB_BOLDS]);
|
||||
@@ -121,7 +121,7 @@ class CommandBSInfo : public Command
|
||||
else
|
||||
info[_("Bolds kicker")] = disabled;
|
||||
|
||||
if (ci->botflags.HasFlag(BS_KICK_CAPS))
|
||||
if (ci->HasExt("BS_KICK_CAPS"))
|
||||
{
|
||||
if (ci->ttb[TTB_CAPS])
|
||||
info[_("Caps kicker")] = Anope::printf(_("%s (%d kick(s) to ban; minimum %d/%d%%"), enabled.c_str(), ci->ttb[TTB_CAPS], ci->capsmin, ci->capspercent);
|
||||
@@ -131,7 +131,7 @@ class CommandBSInfo : public Command
|
||||
else
|
||||
info[_("Caps kicker")] = disabled;
|
||||
|
||||
if (ci->botflags.HasFlag(BS_KICK_COLORS))
|
||||
if (ci->HasExt("BS_KICK_COLORS"))
|
||||
{
|
||||
if (ci->ttb[TTB_COLORS])
|
||||
info[_("Colors kicker")] = Anope::printf(_("%s (%d kick(s) to ban)"), enabled.c_str(), ci->ttb[TTB_COLORS]);
|
||||
@@ -141,7 +141,7 @@ class CommandBSInfo : public Command
|
||||
else
|
||||
info[_("Colors kicker")] = disabled;
|
||||
|
||||
if (ci->botflags.HasFlag(BS_KICK_FLOOD))
|
||||
if (ci->HasExt("BS_KICK_FLOOD"))
|
||||
{
|
||||
if (ci->ttb[TTB_FLOOD])
|
||||
info[_("Flood kicker")] = Anope::printf(_("%s (%d kick(s) to ban; %d lines in %ds"), enabled.c_str(), ci->ttb[TTB_FLOOD], ci->floodlines, ci->floodsecs);
|
||||
@@ -151,7 +151,7 @@ class CommandBSInfo : public Command
|
||||
else
|
||||
info[_("Flood kicker")] = disabled;
|
||||
|
||||
if (ci->botflags.HasFlag(BS_KICK_REPEAT))
|
||||
if (ci->HasExt("BS_KICK_REPEAT"))
|
||||
{
|
||||
if (ci->ttb[TTB_REPEAT])
|
||||
info[_("Repeat kicker")] = Anope::printf(_("%s (%d kick(s) to ban; %d times)"), enabled.c_str(), ci->ttb[TTB_REPEAT], ci->repeattimes);
|
||||
@@ -161,7 +161,7 @@ class CommandBSInfo : public Command
|
||||
else
|
||||
info[_("Repeat kicker")] = disabled;
|
||||
|
||||
if (ci->botflags.HasFlag(BS_KICK_REVERSES))
|
||||
if (ci->HasExt("BS_KICK_REVERSES"))
|
||||
{
|
||||
if (ci->ttb[TTB_REVERSES])
|
||||
info[_("Reverses kicker")] = Anope::printf(_("%s (%d kick(s) to ban)"), enabled.c_str(), ci->ttb[TTB_REVERSES]);
|
||||
@@ -171,7 +171,7 @@ class CommandBSInfo : public Command
|
||||
else
|
||||
info[_("Reverses kicker")] = disabled;
|
||||
|
||||
if (ci->botflags.HasFlag(BS_KICK_UNDERLINES))
|
||||
if (ci->HasExt("BS_KICK_UNDERLINES"))
|
||||
{
|
||||
if (ci->ttb[TTB_UNDERLINES])
|
||||
info[_("Underlines kicker")] = Anope::printf(_("%s (%d kick(s) to ban)"), enabled.c_str(), ci->ttb[TTB_UNDERLINES]);
|
||||
@@ -181,7 +181,7 @@ class CommandBSInfo : public Command
|
||||
else
|
||||
info[_("Underlines kicker")] = disabled;
|
||||
|
||||
if (ci->botflags.HasFlag(BS_KICK_ITALICS))
|
||||
if (ci->HasExt("BS_KICK_ITALICS"))
|
||||
{
|
||||
if (ci->ttb[TTB_ITALICS])
|
||||
info[_("Italics kicker")] = Anope::printf(_("%s (%d kick(s) to ban)"), enabled.c_str(), ci->ttb[TTB_ITALICS]);
|
||||
@@ -191,7 +191,7 @@ class CommandBSInfo : public Command
|
||||
else
|
||||
info[_("Italics kicker")] = disabled;
|
||||
|
||||
if (ci->botflags.HasFlag(BS_KICK_AMSGS))
|
||||
if (ci->HasExt("BS_KICK_AMSGS"))
|
||||
{
|
||||
if (ci->ttb[TTB_AMSGS])
|
||||
info[_("AMSG kicker")] = Anope::printf(_("%s (%d kick(s) to ban)"), enabled.c_str(), ci->ttb[TTB_AMSGS]);
|
||||
@@ -202,11 +202,11 @@ class CommandBSInfo : public Command
|
||||
info[_("AMSG kicker")] = disabled;
|
||||
|
||||
Anope::string flags;
|
||||
CheckOptStr(flags, BS_DONTKICKOPS, _("Ops protection"), ci->botflags, source.nc);
|
||||
CheckOptStr(flags, BS_DONTKICKVOICES, _("Voices protection"), ci->botflags, source.nc);
|
||||
CheckOptStr(flags, BS_FANTASY, _("Fantasy"), ci->botflags, source.nc);
|
||||
CheckOptStr(flags, BS_GREET, _("Greet"), ci->botflags, source.nc);
|
||||
CheckOptStr(flags, BS_NOBOT, _("No bot"), ci->botflags, source.nc);
|
||||
CheckOptStr(flags, "BS_DONTKICKOPS", _("Ops protection"), ci, source.nc);
|
||||
CheckOptStr(flags, "BS_DONTKICKVOICES", _("Voices protection"), ci, source.nc);
|
||||
CheckOptStr(flags, "BS_FANTASY", _("Fantasy"), ci, source.nc);
|
||||
CheckOptStr(flags, "BS_GREET", _("Greet"), ci, source.nc);
|
||||
CheckOptStr(flags, "BS_NOBOT", _("No bot"), ci, source.nc);
|
||||
|
||||
info[_("Options")] = flags.empty() ? _("None") : flags;
|
||||
|
||||
@@ -228,7 +228,7 @@ class CommandBSInfo : public Command
|
||||
"If the parameter is a channel, then you'll get information\n"
|
||||
"such as enabled kickers. If the parameter is a nick,\n"
|
||||
"you'll get information about a bot, such as creation\n"
|
||||
"time or number of channels it is on."), source.owner->nick.c_str());
|
||||
"time or number of channels it is on."), source.service->nick.c_str());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* BotServ core functions
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -30,9 +30,9 @@ class CommandBSKick : public Command
|
||||
const Anope::string &value = params[2];
|
||||
const Anope::string &ttb = params.size() > 3 ? params[3] : "";
|
||||
|
||||
ChannelInfo *ci = cs_findchan(params[0]);
|
||||
ChannelInfo *ci = ChannelInfo::Find(params[0]);
|
||||
|
||||
if (readonly)
|
||||
if (Anope::ReadOnly)
|
||||
source.Reply(_("Sorry, kicker configuration is temporarily disabled."));
|
||||
else if (ci == NULL)
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
@@ -72,19 +72,19 @@ class CommandBSKick : public Command
|
||||
else
|
||||
ci->ttb[TTB_BADWORDS] = 0;
|
||||
|
||||
ci->botflags.SetFlag(BS_KICK_BADWORDS);
|
||||
ci->ExtendMetadata("BS_KICK_BADWORDS");
|
||||
if (ci->ttb[TTB_BADWORDS])
|
||||
source.Reply(_("Bot will now kick \002bad words\002, and will place a ban after \n"
|
||||
"%d kicks for the same user. Use the BADWORDS command\n"
|
||||
"to add or remove a bad word."), ci->ttb[TTB_BADWORDS]);
|
||||
source.Reply(_("Bot will now kick for \002bad words\002, and will place a ban\n"
|
||||
"after %d kicks for the same user. Use the BADWORDS command\n"
|
||||
"to add or remove a bad word."), ci->ttb[TTB_BADWORDS]);
|
||||
else
|
||||
source.Reply(_("Bot will now kick \002bad words\002. Use the BADWORDS command\n"
|
||||
source.Reply(_("Bot will now kick for \002bad words\002. Use the BADWORDS command\n"
|
||||
"to add or remove a bad word."));
|
||||
}
|
||||
else
|
||||
{
|
||||
ci->botflags.UnsetFlag(BS_KICK_BADWORDS);
|
||||
source.Reply(_("Bot won't kick \002bad words\002 anymore."));
|
||||
ci->Shrink("BS_KICK_BADWORDS");
|
||||
source.Reply(_("Bot won't kick for \002bad words\002 anymore."));
|
||||
}
|
||||
}
|
||||
else if (option.equals_ci("BOLDS"))
|
||||
@@ -108,16 +108,17 @@ class CommandBSKick : public Command
|
||||
}
|
||||
else
|
||||
ci->ttb[TTB_BOLDS] = 0;
|
||||
ci->botflags.SetFlag(BS_KICK_BOLDS);
|
||||
ci->ExtendMetadata("BS_KICK_BOLDS");
|
||||
if (ci->ttb[TTB_BOLDS])
|
||||
source.Reply(_("Bot will now kick \002bolds\002, and will place a ban after\n%d kicks to the same user."), ci->ttb[TTB_BOLDS]);
|
||||
source.Reply(_("Bot will now kick for \002bolds\002, and will place a ban\n"
|
||||
"after %d kicks for the same user."), ci->ttb[TTB_BOLDS]);
|
||||
else
|
||||
source.Reply(_("Bot will now kick \002bolds\002."));
|
||||
source.Reply(_("Bot will now kick for \002bolds\002."));
|
||||
}
|
||||
else
|
||||
{
|
||||
ci->botflags.UnsetFlag(BS_KICK_BOLDS);
|
||||
source.Reply(_("Bot won't kick \002bolds\002 anymore."));
|
||||
ci->Shrink("BS_KICK_BOLDS");
|
||||
source.Reply(_("Bot won't kick for \002bolds\002 anymore."));
|
||||
}
|
||||
}
|
||||
else if (option.equals_ci("CAPS"))
|
||||
@@ -163,19 +164,19 @@ class CommandBSKick : public Command
|
||||
if (ci->capspercent < 1 || ci->capspercent > 100)
|
||||
ci->capspercent = 25;
|
||||
|
||||
ci->botflags.SetFlag(BS_KICK_CAPS);
|
||||
ci->ExtendMetadata("BS_KICK_CAPS");
|
||||
if (ci->ttb[TTB_CAPS])
|
||||
source.Reply(_("Bot will now kick \002caps\002 (they must constitute at least\n"
|
||||
"%d characters and %d%% of the entire message), and will \n"
|
||||
source.Reply(_("Bot will now kick for \002caps\002 (they must constitute at least\n"
|
||||
"%d characters and %d%% of the entire message), and will\n"
|
||||
"place a ban after %d kicks for the same user."), ci->capsmin, ci->capspercent, ci->ttb[TTB_CAPS]);
|
||||
else
|
||||
source.Reply(_("Bot will now kick \002caps\002 (they must constitute at least\n"
|
||||
source.Reply(_("Bot will now kick for \002caps\002 (they must constitute at least\n"
|
||||
"%d characters and %d%% of the entire message)."), ci->capsmin, ci->capspercent);
|
||||
}
|
||||
else
|
||||
{
|
||||
ci->botflags.UnsetFlag(BS_KICK_CAPS);
|
||||
source.Reply(_("Bot won't kick \002caps\002 anymore."));
|
||||
ci->Shrink("BS_KICK_CAPS");
|
||||
source.Reply(_("Bot won't kick for \002caps\002 anymore."));
|
||||
}
|
||||
}
|
||||
else if (option.equals_ci("COLORS"))
|
||||
@@ -200,16 +201,17 @@ class CommandBSKick : public Command
|
||||
else
|
||||
ci->ttb[TTB_COLORS] = 0;
|
||||
|
||||
ci->botflags.SetFlag(BS_KICK_COLORS);
|
||||
ci->ExtendMetadata("BS_KICK_COLORS");
|
||||
if (ci->ttb[TTB_COLORS])
|
||||
source.Reply(_("Bot will now kick \002colors\002, and will place a ban after %d\nkicks for the same user."), ci->ttb[TTB_COLORS]);
|
||||
source.Reply(_("Bot will now kick for \002colors\002, and will place a ban\n"
|
||||
"after %d kicks for the same user."), ci->ttb[TTB_COLORS]);
|
||||
else
|
||||
source.Reply(_("Bot will now kick \002colors\002."));
|
||||
source.Reply(_("Bot will now kick for \002colors\002."));
|
||||
}
|
||||
else
|
||||
{
|
||||
ci->botflags.UnsetFlag(BS_KICK_COLORS);
|
||||
source.Reply(_("Bot won't kick \002colors\002 anymore."));
|
||||
ci->Shrink("BS_KICK_COLORS");
|
||||
source.Reply(_("Bot won't kick for \002colors\002 anymore."));
|
||||
}
|
||||
}
|
||||
else if (option.equals_ci("FLOOD"))
|
||||
@@ -257,16 +259,17 @@ class CommandBSKick : public Command
|
||||
if (ci->floodsecs > Config->BSKeepData)
|
||||
ci->floodsecs = Config->BSKeepData;
|
||||
|
||||
ci->botflags.SetFlag(BS_KICK_FLOOD);
|
||||
ci->ExtendMetadata("BS_KICK_FLOOD");
|
||||
if (ci->ttb[TTB_FLOOD])
|
||||
source.Reply(_("Bot will now kick \002flood\002 (%d lines in %d seconds and\nwill place a ban after %d kicks for the same user."), ci->floodlines, ci->floodsecs, ci->ttb[TTB_FLOOD]);
|
||||
source.Reply(_("Bot will now kick for \002flood\002 (%d lines in %d seconds\n"
|
||||
"and will place a ban after %d kicks for the same user."), ci->floodlines, ci->floodsecs, ci->ttb[TTB_FLOOD]);
|
||||
else
|
||||
source.Reply(_("Bot will now kick \002flood\002 (%d lines in %d seconds)."), ci->floodlines, ci->floodsecs);
|
||||
source.Reply(_("Bot will now kick for \002flood\002 (%d lines in %d seconds)."), ci->floodlines, ci->floodsecs);
|
||||
}
|
||||
else
|
||||
{
|
||||
ci->botflags.UnsetFlag(BS_KICK_FLOOD);
|
||||
source.Reply(_("Bot won't kick \002flood\002 anymore."));
|
||||
ci->Shrink("BS_KICK_FLOOD");
|
||||
source.Reply(_("Bot won't kick for \002flood\002 anymore."));
|
||||
}
|
||||
}
|
||||
else if (option.equals_ci("REPEAT"))
|
||||
@@ -302,19 +305,19 @@ class CommandBSKick : public Command
|
||||
if (ci->repeattimes < 2)
|
||||
ci->repeattimes = 3;
|
||||
|
||||
ci->botflags.SetFlag(BS_KICK_REPEAT);
|
||||
ci->ExtendMetadata("BS_KICK_REPEAT");
|
||||
if (ci->ttb[TTB_REPEAT])
|
||||
source.Reply(_("Bot will now kick \002repeats\002 (users that say the\n"
|
||||
"same thing %d times), and will place a ban after %d \n"
|
||||
source.Reply(_("Bot will now kick for \002repeats\002 (users that say the\n"
|
||||
"same thing %d times), and will place a ban after %d\n"
|
||||
"kicks for the same user."), ci->repeattimes, ci->ttb[TTB_REPEAT]);
|
||||
else
|
||||
source.Reply(_("Bot will now kick \002repeats\002 (users that say the\n"
|
||||
source.Reply(_("Bot will now kick for \002repeats\002 (users that say the\n"
|
||||
"same thing %d times)."), ci->repeattimes);
|
||||
}
|
||||
else
|
||||
{
|
||||
ci->botflags.UnsetFlag(BS_KICK_REPEAT);
|
||||
source.Reply(_("Bot won't kick \002repeats\002 anymore."));
|
||||
ci->Shrink("BS_KICK_REPEAT");
|
||||
source.Reply(_("Bot won't kick for \002repeats\002 anymore."));
|
||||
}
|
||||
}
|
||||
else if (option.equals_ci("REVERSES"))
|
||||
@@ -338,16 +341,17 @@ class CommandBSKick : public Command
|
||||
}
|
||||
else
|
||||
ci->ttb[TTB_REVERSES] = 0;
|
||||
ci->botflags.SetFlag(BS_KICK_REVERSES);
|
||||
ci->ExtendMetadata("BS_KICK_REVERSES");
|
||||
if (ci->ttb[TTB_REVERSES])
|
||||
source.Reply(_("Bot will now kick \002reverses\002, and will place a ban after %d\nkicks for the same user."), ci->ttb[TTB_REVERSES]);
|
||||
source.Reply(_("Bot will now kick for \002reverses\002, and will place a ban\n"
|
||||
"after %d kicks for the same user."), ci->ttb[TTB_REVERSES]);
|
||||
else
|
||||
source.Reply(_("Bot will now kick \002reverses\002."));
|
||||
source.Reply(_("Bot will now kick for \002reverses\002."));
|
||||
}
|
||||
else
|
||||
{
|
||||
ci->botflags.UnsetFlag(BS_KICK_REVERSES);
|
||||
source.Reply(_("Bot won't kick \002reverses\002 anymore."));
|
||||
ci->Shrink("BS_KICK_REVERSES");
|
||||
source.Reply(_("Bot won't kick for \002reverses\002 anymore."));
|
||||
}
|
||||
}
|
||||
else if (option.equals_ci("UNDERLINES"))
|
||||
@@ -372,16 +376,17 @@ class CommandBSKick : public Command
|
||||
else
|
||||
ci->ttb[TTB_UNDERLINES] = 0;
|
||||
|
||||
ci->botflags.SetFlag(BS_KICK_UNDERLINES);
|
||||
ci->ExtendMetadata("BS_KICK_UNDERLINES");
|
||||
if (ci->ttb[TTB_UNDERLINES])
|
||||
source.Reply(_("Bot will now kick \002underlines\002, and will place a ban after %d\nkicks for the same user."), ci->ttb[TTB_UNDERLINES]);
|
||||
source.Reply(_("Bot will now kick for \002underlines\002, and will place a ban\n"
|
||||
"after %d kicks for the same user."), ci->ttb[TTB_UNDERLINES]);
|
||||
else
|
||||
source.Reply(_("Bot will now kick \002underlines\002."));
|
||||
source.Reply(_("Bot will now kick for \002underlines\002."));
|
||||
}
|
||||
else
|
||||
{
|
||||
ci->botflags.UnsetFlag(BS_KICK_UNDERLINES);
|
||||
source.Reply(_("Bot won't kick \002underlines\002 anymore."));
|
||||
ci->Shrink("BS_KICK_UNDERLINES");
|
||||
source.Reply(_("Bot won't kick for \002underlines\002 anymore."));
|
||||
}
|
||||
}
|
||||
else if (option.equals_ci("ITALICS"))
|
||||
@@ -406,16 +411,17 @@ class CommandBSKick : public Command
|
||||
else
|
||||
ci->ttb[TTB_ITALICS] = 0;
|
||||
|
||||
ci->botflags.SetFlag(BS_KICK_ITALICS);
|
||||
ci->ExtendMetadata("BS_KICK_ITALICS");
|
||||
if (ci->ttb[TTB_ITALICS])
|
||||
source.Reply(_("Bot will now kick \002italics\002, and will place a ban after\n%d kicks for the same user."), ci->ttb[TTB_ITALICS]);
|
||||
source.Reply(_("Bot will now kick for \002italics\002, and will place a ban\n"
|
||||
"after %d kicks for the same user."), ci->ttb[TTB_ITALICS]);
|
||||
else
|
||||
source.Reply(_("Bot will now kick \002italics\002."));
|
||||
source.Reply(_("Bot will now kick for \002italics\002."));
|
||||
}
|
||||
else
|
||||
{
|
||||
ci->botflags.UnsetFlag(BS_KICK_ITALICS);
|
||||
source.Reply(_("Bot won't kick \002italics\002 anymore."));
|
||||
ci->Shrink("BS_KICK_ITALICS");
|
||||
source.Reply(_("Bot won't kick for \002italics\002 anymore."));
|
||||
}
|
||||
}
|
||||
else if (option.equals_ci("AMSGS"))
|
||||
@@ -440,15 +446,16 @@ class CommandBSKick : public Command
|
||||
else
|
||||
ci->ttb[TTB_AMSGS] = 0;
|
||||
|
||||
ci->botflags.SetFlag(BS_KICK_AMSGS);
|
||||
ci->ExtendMetadata("BS_KICK_AMSGS");
|
||||
if (ci->ttb[TTB_AMSGS])
|
||||
source.Reply(_("Bot will now kick for \002amsgs\002, and will place a ban after %d\nkicks for the same user."), ci->ttb[TTB_AMSGS]);
|
||||
source.Reply(_("Bot will now kick for \002amsgs\002, and will place a ban\n"
|
||||
"after %d kicks for the same user."), ci->ttb[TTB_AMSGS]);
|
||||
else
|
||||
source.Reply(_("Bot will now kick for \002amsgs\002"));
|
||||
}
|
||||
else
|
||||
{
|
||||
ci->botflags.UnsetFlag(BS_KICK_AMSGS);
|
||||
ci->Shrink("BS_KICK_AMSGS");
|
||||
source.Reply(_("Bot won't kick for \002amsgs\002 anymore."));
|
||||
}
|
||||
}
|
||||
@@ -482,10 +489,10 @@ class CommandBSKick : public Command
|
||||
"on a specific option.\n"
|
||||
" \n"
|
||||
"Note: access to this command is controlled by the\n"
|
||||
"level SET."), Config->UseStrictPrivMsgString.c_str(), source.owner->nick.c_str());
|
||||
"level SET."), Config->UseStrictPrivMsgString.c_str(), source.service->nick.c_str());
|
||||
}
|
||||
else if (subcommand.equals_ci("BADWORDS"))
|
||||
source.Reply(_("Syntax: \002\037#channel\037 BADWORDS {\037ON|OFF\037} [\037ttb\037]\002\n"
|
||||
source.Reply(_("Syntax: \002\037channel\037 BADWORDS {\037ON|OFF\037} [\037ttb\037]\002\n"
|
||||
"Sets the bad words kicker on or off. When enabled, this\n"
|
||||
"option tells the bot to kick users who say certain words\n"
|
||||
"on the channels.\n"
|
||||
@@ -494,7 +501,7 @@ class CommandBSKick : public Command
|
||||
"more information.\n"
|
||||
"ttb is the number of times a user can be kicked\n"
|
||||
"before it get banned. Don't give ttb to disable\n"
|
||||
"the ban system once activated."), Config->UseStrictPrivMsgString.c_str(), source.owner->nick.c_str());
|
||||
"the ban system once activated."), Config->UseStrictPrivMsgString.c_str(), source.service->nick.c_str());
|
||||
else if (subcommand.equals_ci("BOLDS"))
|
||||
source.Reply(_("Syntax: \002\037channel\037 BOLDS {\037ON|OFF\037} [\037ttb\037]\002\n"
|
||||
"Sets the bolds kicker on or off. When enabled, this\n"
|
||||
@@ -508,7 +515,7 @@ class CommandBSKick : public Command
|
||||
"option tells the bot to kick users who are talking in\n"
|
||||
"CAPS.\n"
|
||||
"The bot kicks only if there are at least \002min\002 caps\n"
|
||||
"and they constitute at least \002percent\002%% of the total \n"
|
||||
"and they constitute at least \002percent\002%% of the total\n"
|
||||
"text line (if not given, it defaults to 10 characters\n"
|
||||
"and 25%%).\n"
|
||||
"ttb is the number of times a user can be kicked\n"
|
||||
@@ -624,11 +631,6 @@ struct BanData : public ExtensibleItem
|
||||
data_map.erase(user);
|
||||
}
|
||||
}
|
||||
|
||||
void OnDelete() anope_override
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
};
|
||||
|
||||
struct UserData : public ExtensibleItem
|
||||
@@ -657,11 +659,6 @@ struct UserData : public ExtensibleItem
|
||||
int16_t times;
|
||||
|
||||
Anope::string lastline;
|
||||
|
||||
void OnDelete() anope_override
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -708,7 +705,7 @@ class BSKick : public Module
|
||||
|
||||
UserData *GetUserData(User *u, Channel *c)
|
||||
{
|
||||
UserContainer *uc = c->FindUser(u);
|
||||
ChanUserContainer *uc = c->FindUser(u);
|
||||
if (uc == NULL)
|
||||
return NULL;
|
||||
|
||||
@@ -736,14 +733,12 @@ class BSKick : public Module
|
||||
/* Should not use == here because bd.ttb[ttbtype] could possibly be > ci->ttb[ttbtype]
|
||||
* if the TTB was changed after it was not set (0) before and the user had already been
|
||||
* kicked a few times. Bug #1056 - Adam */
|
||||
Anope::string mask;
|
||||
|
||||
bd.ttb[ttbtype] = 0;
|
||||
|
||||
get_idealban(ci, u, mask);
|
||||
Anope::string mask = ci->GetIdealBan(u);
|
||||
|
||||
if (ci->c)
|
||||
ci->c->SetMode(NULL, CMODE_BAN, mask);
|
||||
ci->c->SetMode(NULL, "BAN", mask);
|
||||
FOREACH_MOD(I_OnBotBan, OnBotBan(u, ci, mask));
|
||||
}
|
||||
}
|
||||
@@ -756,7 +751,7 @@ class BSKick : public Module
|
||||
if (!ci || !ci->bi || !ci->c || !u || u->server->IsULined() || !ci->c->FindUser(u))
|
||||
return;
|
||||
|
||||
Anope::string fmt = translate(u, message);
|
||||
Anope::string fmt = Language::Translate(u, message);
|
||||
va_start(args, message);
|
||||
vsnprintf(buf, sizeof(buf), fmt.c_str(), args);
|
||||
va_end(args);
|
||||
@@ -778,7 +773,7 @@ class BSKick : public Module
|
||||
for (channel_map::const_iterator cit = ChannelList.begin(), cit_end = ChannelList.end(); cit != cit_end; ++cit)
|
||||
{
|
||||
Channel *c = cit->second;
|
||||
for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; ++it)
|
||||
for (Channel::ChanUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; ++it)
|
||||
(*it)->Shrink("bs_main_userdata");
|
||||
c->Shrink("bs_main_bandata");
|
||||
}
|
||||
@@ -798,15 +793,11 @@ class BSKick : public Module
|
||||
if (ci == NULL)
|
||||
return;
|
||||
|
||||
bool Allow = true;
|
||||
if (ci->AccessFor(u).HasPriv("NOKICK"))
|
||||
Allow = false;
|
||||
else if (ci->botflags.HasFlag(BS_DONTKICKOPS) && (c->HasUserStatus(u, CMODE_HALFOP) || c->HasUserStatus(u, CMODE_OP) || c->HasUserStatus(u, CMODE_PROTECT) || c->HasUserStatus(u, CMODE_OWNER)))
|
||||
Allow = false;
|
||||
else if (ci->botflags.HasFlag(BS_DONTKICKVOICES) && c->HasUserStatus(u, CMODE_VOICE))
|
||||
Allow = false;
|
||||
|
||||
if (!Allow)
|
||||
return;
|
||||
else if (ci->HasExt("BS_DONTKICKOPS") && (c->HasUserStatus(u, "HALFOP") || c->HasUserStatus(u, "OP") || c->HasUserStatus(u, "PROTECT") || c->HasUserStatus(u, "OWNER")))
|
||||
return;
|
||||
else if (ci->HasExt("BS_DONTKICKVOICES") && c->HasUserStatus(u, "VOICE"))
|
||||
return;
|
||||
|
||||
Anope::string realbuf = msg;
|
||||
@@ -824,7 +815,7 @@ class BSKick : public Module
|
||||
return;
|
||||
|
||||
/* Bolds kicker */
|
||||
if (ci->botflags.HasFlag(BS_KICK_BOLDS) && realbuf.find(2) != Anope::string::npos)
|
||||
if (ci->HasExt("BS_KICK_BOLDS") && realbuf.find(2) != Anope::string::npos)
|
||||
{
|
||||
check_ban(ci, u, TTB_BOLDS);
|
||||
bot_kick(ci, u, _("Don't use bolds on this channel!"));
|
||||
@@ -832,7 +823,7 @@ class BSKick : public Module
|
||||
}
|
||||
|
||||
/* Color kicker */
|
||||
if (ci->botflags.HasFlag(BS_KICK_COLORS) && realbuf.find(3) != Anope::string::npos)
|
||||
if (ci->HasExt("BS_KICK_COLORS") && realbuf.find(3) != Anope::string::npos)
|
||||
{
|
||||
check_ban(ci, u, TTB_COLORS);
|
||||
bot_kick(ci, u, _("Don't use colors on this channel!"));
|
||||
@@ -840,7 +831,7 @@ class BSKick : public Module
|
||||
}
|
||||
|
||||
/* Reverses kicker */
|
||||
if (ci->botflags.HasFlag(BS_KICK_REVERSES) && realbuf.find(22) != Anope::string::npos)
|
||||
if (ci->HasExt("BS_KICK_REVERSES") && realbuf.find(22) != Anope::string::npos)
|
||||
{
|
||||
check_ban(ci, u, TTB_REVERSES);
|
||||
bot_kick(ci, u, _("Don't use reverses on this channel!"));
|
||||
@@ -848,7 +839,7 @@ class BSKick : public Module
|
||||
}
|
||||
|
||||
/* Italics kicker */
|
||||
if (ci->botflags.HasFlag(BS_KICK_ITALICS) && realbuf.find(29) != Anope::string::npos)
|
||||
if (ci->HasExt("BS_KICK_ITALICS") && realbuf.find(29) != Anope::string::npos)
|
||||
{
|
||||
check_ban(ci, u, TTB_ITALICS);
|
||||
bot_kick(ci, u, _("Don't use italics on this channel!"));
|
||||
@@ -856,7 +847,7 @@ class BSKick : public Module
|
||||
}
|
||||
|
||||
/* Underlines kicker */
|
||||
if (ci->botflags.HasFlag(BS_KICK_UNDERLINES) && realbuf.find(31) != Anope::string::npos)
|
||||
if (ci->HasExt("BS_KICK_UNDERLINES") && realbuf.find(31) != Anope::string::npos)
|
||||
{
|
||||
check_ban(ci, u, TTB_UNDERLINES);
|
||||
bot_kick(ci, u, _("Don't use underlines on this channel!"));
|
||||
@@ -864,7 +855,7 @@ class BSKick : public Module
|
||||
}
|
||||
|
||||
/* Caps kicker */
|
||||
if (ci->botflags.HasFlag(BS_KICK_CAPS) && realbuf.length() >= static_cast<unsigned>(ci->capsmin))
|
||||
if (ci->HasExt("BS_KICK_CAPS") && realbuf.length() >= static_cast<unsigned>(ci->capsmin))
|
||||
{
|
||||
int i = 0, l = 0;
|
||||
|
||||
@@ -890,12 +881,12 @@ class BSKick : public Module
|
||||
}
|
||||
|
||||
/* Bad words kicker */
|
||||
if (ci->botflags.HasFlag(BS_KICK_BADWORDS))
|
||||
if (ci->HasExt("BS_KICK_BADWORDS"))
|
||||
{
|
||||
bool mustkick = false;
|
||||
|
||||
/* Normalize the buffer */
|
||||
Anope::string nbuf = normalizeBuffer(realbuf);
|
||||
Anope::string nbuf = Anope::NormalizeBuffer(realbuf);
|
||||
|
||||
for (unsigned i = 0, end = ci->GetBadWordCount(); i < end; ++i)
|
||||
{
|
||||
@@ -971,7 +962,7 @@ class BSKick : public Module
|
||||
if (ud)
|
||||
{
|
||||
/* Flood kicker */
|
||||
if (ci->botflags.HasFlag(BS_KICK_FLOOD))
|
||||
if (ci->HasExt("BS_KICK_FLOOD"))
|
||||
{
|
||||
if (Anope::CurTime - ud->last_start > ci->floodsecs)
|
||||
{
|
||||
@@ -989,7 +980,7 @@ class BSKick : public Module
|
||||
}
|
||||
|
||||
/* Repeat kicker */
|
||||
if (ci->botflags.HasFlag(BS_KICK_REPEAT))
|
||||
if (ci->HasExt("BS_KICK_REPEAT"))
|
||||
{
|
||||
if (!ud->lastline.equals_ci(realbuf))
|
||||
ud->times = 0;
|
||||
@@ -1006,12 +997,12 @@ class BSKick : public Module
|
||||
|
||||
if (ud->lastline.equals_ci(realbuf) && !ud->lasttarget.empty() && !ud->lasttarget.equals_ci(ci->name))
|
||||
{
|
||||
for (UChannelList::iterator it = u->chans.begin(); it != u->chans.end();)
|
||||
for (User::ChanUserList::iterator it = u->chans.begin(); it != u->chans.end();)
|
||||
{
|
||||
Channel *chan = (*it)->chan;
|
||||
++it;
|
||||
|
||||
if (chan->ci && chan->ci->botflags.HasFlag(BS_KICK_AMSGS) && !chan->ci->AccessFor(u).HasPriv("NOKICK"))
|
||||
if (chan->ci && chan->ci->HasExt("BS_KICK_AMSGS") && !chan->ci->AccessFor(u).HasPriv("NOKICK"))
|
||||
{
|
||||
check_ban(chan->ci, u, TTB_AMSGS);
|
||||
bot_kick(chan->ci, u, _("Don't use AMSGs!"));
|
||||
|
||||
+367
-7
@@ -1,6 +1,6 @@
|
||||
/* BotServ core functions
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -9,8 +9,6 @@
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
#include "module.h"
|
||||
|
||||
class CommandBSSet : public Command
|
||||
@@ -35,13 +33,13 @@ class CommandBSSet : public Command
|
||||
" \n"
|
||||
"Available options:"));
|
||||
Anope::string this_name = source.command;
|
||||
for (BotInfo::command_map::const_iterator it = source.owner->commands.begin(), it_end = source.owner->commands.end(); it != it_end; ++it)
|
||||
for (CommandInfo::map::const_iterator it = source.service->commands.begin(), it_end = source.service->commands.end(); it != it_end; ++it)
|
||||
{
|
||||
const Anope::string &c_name = it->first;
|
||||
const CommandInfo &info = it->second;
|
||||
if (c_name.find_ci(this_name + " ") == 0)
|
||||
{
|
||||
service_reference<Command> command("Command", info.name);
|
||||
ServiceReference<Command> command("Command", info.name);
|
||||
if (command)
|
||||
{
|
||||
source.command = it->first;
|
||||
@@ -50,19 +48,381 @@ class CommandBSSet : public Command
|
||||
}
|
||||
}
|
||||
source.Reply(_("Type \002%s%s HELP SET \037option\037\002 for more information on a\n"
|
||||
"particular option."), Config->UseStrictPrivMsgString.c_str(), source.owner->nick.c_str());
|
||||
"particular option."), Config->UseStrictPrivMsgString.c_str(), source.service->nick.c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class CommandBSSetDontKickOps : public Command
|
||||
{
|
||||
public:
|
||||
CommandBSSetDontKickOps(Module *creator, const Anope::string &sname = "botserv/set/dontkickops") : Command(creator, sname, 2, 2)
|
||||
{
|
||||
this->SetDesc(_("To protect ops against bot kicks"));
|
||||
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
ChannelInfo *ci = ChannelInfo::Find(params[0]);
|
||||
if (ci == NULL)
|
||||
{
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
AccessGroup access = source.AccessFor(ci);
|
||||
if (!source.HasPriv("botserv/administration") && !access.HasPriv("SET"))
|
||||
{
|
||||
source.Reply(ACCESS_DENIED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Anope::ReadOnly)
|
||||
{
|
||||
source.Reply(_("Sorry, bot option setting is temporarily disabled."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (params[1].equals_ci("ON"))
|
||||
{
|
||||
bool override = !access.HasPriv("SET");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to enable dontkickops";
|
||||
|
||||
ci->ExtendMetadata("BS_DONTKICKOPS");
|
||||
source.Reply(_("Bot \002won't kick ops\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else if (params[1].equals_ci("OFF"))
|
||||
{
|
||||
bool override = !access.HasPriv("SET");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to disable dontkickops";
|
||||
|
||||
ci->Shrink("BS_DONTKICKOPS");
|
||||
source.Reply(_("Bot \002will kick ops\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else
|
||||
this->OnSyntaxError(source, source.command);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(_(" \n"
|
||||
"Enables or disables \002ops protection\002 mode on a channel.\n"
|
||||
"When it is enabled, ops won't be kicked by the bot\n"
|
||||
"even if they don't match the NOKICK level."));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class CommandBSSetDontKickVoices : public Command
|
||||
{
|
||||
public:
|
||||
CommandBSSetDontKickVoices(Module *creator, const Anope::string &sname = "botserv/set/dontkickvoices") : Command(creator, sname, 2, 2)
|
||||
{
|
||||
this->SetDesc(_("To protect voices against bot kicks"));
|
||||
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
ChannelInfo *ci = ChannelInfo::Find(params[0]);
|
||||
if (ci == NULL)
|
||||
{
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
AccessGroup access = source.AccessFor(ci);
|
||||
if (!source.HasPriv("botserv/administration") && !access.HasPriv("SET"))
|
||||
{
|
||||
source.Reply(ACCESS_DENIED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Anope::ReadOnly)
|
||||
{
|
||||
source.Reply(_("Sorry, bot option setting is temporarily disabled."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (params[1].equals_ci("ON"))
|
||||
{
|
||||
bool override = !access.HasPriv("SET");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to enable dontkickvoices";
|
||||
|
||||
ci->ExtendMetadata("BS_DONTKICKVOICES");
|
||||
source.Reply(_("Bot \002won't kick voices\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else if (params[1].equals_ci("OFF"))
|
||||
{
|
||||
bool override = !access.HasPriv("SET");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to disable dontkickvoices";
|
||||
|
||||
ci->Shrink("BS_DONTKICKVOICES");
|
||||
source.Reply(_("Bot \002will kick voices\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else
|
||||
this->OnSyntaxError(source, source.command);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(_(" \n"
|
||||
"Enables or disables \002voices protection\002 mode on a channel.\n"
|
||||
"When it is enabled, voices won't be kicked by the bot\n"
|
||||
"even if they don't match the NOKICK level."));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class CommandBSSetFantasy : public Command
|
||||
{
|
||||
public:
|
||||
CommandBSSetFantasy(Module *creator, const Anope::string &sname = "botserv/set/fantasy") : Command(creator, sname, 2, 2)
|
||||
{
|
||||
this->SetDesc(_("Enable fantaisist commands"));
|
||||
this->SetSyntax(_("\037channel\037 {\037ON|OFF\037}"));
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
ChannelInfo *ci = ChannelInfo::Find(params[0]);
|
||||
const Anope::string &value = params[1];
|
||||
|
||||
if (ci == NULL)
|
||||
{
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!source.HasPriv("botserv/administration") && !source.AccessFor(ci).HasPriv("SET"))
|
||||
{
|
||||
source.Reply(ACCESS_DENIED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Anope::ReadOnly)
|
||||
{
|
||||
source.Reply(_("Sorry, bot option setting is temporarily disabled."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (value.equals_ci("ON"))
|
||||
{
|
||||
bool override = !source.AccessFor(ci).HasPriv("SET");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to enable fantasy";
|
||||
|
||||
ci->ExtendMetadata("BS_FANTASY");
|
||||
source.Reply(_("Fantasy mode is now \002on\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else if (value.equals_ci("OFF"))
|
||||
{
|
||||
bool override = !source.AccessFor(ci).HasPriv("SET");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to disable fantasy";
|
||||
|
||||
ci->Shrink("BS_FANTASY");
|
||||
source.Reply(_("Fantasy mode is now \002off\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else
|
||||
this->OnSyntaxError(source, source.command);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(_(" \n"
|
||||
"Enables or disables \002fantasy\002 mode on a channel.\n"
|
||||
"When it is enabled, users will be able to use\n"
|
||||
"%s commands on a channel when prefixed\n"
|
||||
"with one of the following fantasy characters: \002%s\002\n"
|
||||
" \n"
|
||||
"Note that users wanting to use fantaisist\n"
|
||||
"commands MUST have enough level for both\n"
|
||||
"the FANTASIA and another level depending\n"
|
||||
"of the command if required (for example, to use\n"
|
||||
"!op, user must have enough access for the OPDEOP\n"
|
||||
"level)."), Config->ChanServ.c_str(), Config->BSFantasyCharacter.c_str());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class CommandBSSetGreet : public Command
|
||||
{
|
||||
public:
|
||||
CommandBSSetGreet(Module *creator, const Anope::string &sname = "botserv/set/greet") : Command(creator, sname, 2, 2)
|
||||
{
|
||||
this->SetDesc(_("Enable greet messages"));
|
||||
this->SetSyntax(_("\037channel\037 {\037ON|OFF\037}"));
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
ChannelInfo *ci = ChannelInfo::Find(params[0]);
|
||||
const Anope::string &value = params[1];
|
||||
|
||||
if (ci == NULL)
|
||||
{
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!source.HasPriv("botserv/administration") && !source.AccessFor(ci).HasPriv("SET"))
|
||||
{
|
||||
source.Reply(ACCESS_DENIED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Anope::ReadOnly)
|
||||
{
|
||||
source.Reply(_("Sorry, bot option setting is temporarily disabled."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (value.equals_ci("ON"))
|
||||
{
|
||||
bool override = !source.AccessFor(ci).HasPriv("SET");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to enable greets";
|
||||
|
||||
ci->ExtendMetadata("BS_GREET");
|
||||
source.Reply(_("Greet mode is now \002on\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else if (value.equals_ci("OFF"))
|
||||
{
|
||||
bool override = !source.AccessFor(ci).HasPriv("SET");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to disable greets";
|
||||
|
||||
ci->Shrink("BS_GREET");
|
||||
source.Reply(_("Greet mode is now \002off\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else
|
||||
this->OnSyntaxError(source, source.command);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(_(" \n"
|
||||
"Enables or disables \002greet\002 mode on a channel.\n"
|
||||
"When it is enabled, the bot will display greet\n"
|
||||
"messages of users joining the channel, provided\n"
|
||||
"they have enough access to the channel."));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class CommandBSSetNoBot : public Command
|
||||
{
|
||||
public:
|
||||
CommandBSSetNoBot(Module *creator, const Anope::string &sname = "botserv/set/nobot") : Command(creator, sname, 2, 2)
|
||||
{
|
||||
this->SetDesc(_("Prevent a bot from being assigned to a channel"));
|
||||
this->SetSyntax(_("\037channel\037 {\037ON|OFF\037}"));
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
ChannelInfo *ci = ChannelInfo::Find(params[0]);
|
||||
const Anope::string &value = params[1];
|
||||
|
||||
if (ci == NULL)
|
||||
{
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if (value.equals_ci("ON"))
|
||||
{
|
||||
bool override = !source.AccessFor(ci).HasPriv("SET");
|
||||
Log(override ? LOG_ADMIN : LOG_COMMAND, source, this, ci) << "to enable nobot";
|
||||
|
||||
ci->ExtendMetadata("BS_NOBOT");
|
||||
if (ci->bi)
|
||||
ci->bi->UnAssign(source.GetUser(), ci);
|
||||
source.Reply(_("No-bot mode is now \002on\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else if (value.equals_ci("OFF"))
|
||||
{
|
||||
bool override = !source.AccessFor(ci).HasPriv("SET");
|
||||
Log(override ? LOG_ADMIN : LOG_COMMAND, source, this, ci) << "to disable nobot";
|
||||
|
||||
ci->Shrink("BS_NOBOT");
|
||||
source.Reply(_("No-bot mode is now \002off\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else
|
||||
this->OnSyntaxError(source, source.command);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(_(" \n"
|
||||
"This option makes a channel be unassignable. If a bot\n"
|
||||
"is already assigned to the channel, it is unassigned\n"
|
||||
"automatically when you enable the option."));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class CommandBSSetPrivate : public Command
|
||||
{
|
||||
public:
|
||||
CommandBSSetPrivate(Module *creator, const Anope::string &sname = "botserv/set/private") : Command(creator, sname, 2, 2)
|
||||
{
|
||||
this->SetDesc(_("Prevent a bot from being assigned by non IRC operators"));
|
||||
this->SetSyntax(_("\037botname\037 {\037ON|OFF\037}"));
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
BotInfo *bi = BotInfo::Find(params[0], true);
|
||||
const Anope::string &value = params[1];
|
||||
|
||||
if (bi == NULL)
|
||||
{
|
||||
source.Reply(BOT_DOES_NOT_EXIST, params[0].c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if (value.equals_ci("ON"))
|
||||
{
|
||||
bi->ExtendMetadata("PRIVATE");
|
||||
source.Reply(_("Private mode of bot %s is now \002on\002."), bi->nick.c_str());
|
||||
}
|
||||
else if (value.equals_ci("OFF"))
|
||||
{
|
||||
bi->Shrink("PRIVATE");
|
||||
source.Reply(_("Private mode of bot %s is now \002off\002."), bi->nick.c_str());
|
||||
}
|
||||
else
|
||||
this->OnSyntaxError(source, source.command);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(_(" \n"
|
||||
"This option prevents a bot from being assigned to a\n"
|
||||
"channel by users that aren't IRC Operators."));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class BSSet : public Module
|
||||
{
|
||||
CommandBSSet commandbsset;
|
||||
CommandBSSetDontKickOps commandbssetdontkickops;
|
||||
CommandBSSetDontKickVoices commandbssetdontkickvoices;
|
||||
CommandBSSetFantasy commandbssetfantasy;
|
||||
CommandBSSetNoBot commandbssetnobot;
|
||||
CommandBSSetPrivate commandbssetprivate;
|
||||
|
||||
public:
|
||||
BSSet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
|
||||
commandbsset(this)
|
||||
commandbsset(this), commandbssetdontkickops(this), commandbssetdontkickvoices(this),
|
||||
commandbssetfantasy(this), commandbssetnobot(this), commandbssetprivate(this)
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
/* BotServ core functions
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
#include "module.h"
|
||||
|
||||
class CommandBSSetDontKickOps : public Command
|
||||
{
|
||||
public:
|
||||
CommandBSSetDontKickOps(Module *creator, const Anope::string &sname = "botserv/set/dontkickops") : Command(creator, sname, 2, 2)
|
||||
{
|
||||
this->SetDesc(_("To protect ops against bot kicks"));
|
||||
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
ChannelInfo *ci = cs_findchan(params[0]);
|
||||
if (ci == NULL)
|
||||
{
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
AccessGroup access = source.AccessFor(ci);
|
||||
if (!source.HasPriv("botserv/administration") && !access.HasPriv("SET"))
|
||||
{
|
||||
source.Reply(ACCESS_DENIED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (readonly)
|
||||
{
|
||||
source.Reply(_("Sorry, bot option setting is temporarily disabled."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (params[1].equals_ci("ON"))
|
||||
{
|
||||
bool override = !access.HasPriv("SET");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to enable dontkickops";
|
||||
|
||||
ci->botflags.SetFlag(BS_DONTKICKOPS);
|
||||
source.Reply(_("Bot \002won't kick ops\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else if (params[1].equals_ci("OFF"))
|
||||
{
|
||||
bool override = !access.HasPriv("SET");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to disable dontkickops";
|
||||
|
||||
ci->botflags.UnsetFlag(BS_DONTKICKOPS);
|
||||
source.Reply(_("Bot \002will kick ops\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else
|
||||
this->OnSyntaxError(source, source.command);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(_(" \n"
|
||||
"Enables or disables \002ops protection\002 mode on a channel.\n"
|
||||
"When it is enabled, ops won't be kicked by the bot\n"
|
||||
"even if they don't match the NOKICK level."));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class BSSetDontKickOps : public Module
|
||||
{
|
||||
CommandBSSetDontKickOps commandbssetdontkickops;
|
||||
|
||||
public:
|
||||
BSSetDontKickOps(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
|
||||
commandbssetdontkickops(this)
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
}
|
||||
};
|
||||
|
||||
MODULE_INIT(BSSetDontKickOps)
|
||||
@@ -1,90 +0,0 @@
|
||||
/* BotServ core functions
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
#include "module.h"
|
||||
|
||||
class CommandBSSetDontKickVoices : public Command
|
||||
{
|
||||
public:
|
||||
CommandBSSetDontKickVoices(Module *creator, const Anope::string &sname = "botserv/set/dontkickvoices") : Command(creator, sname, 2, 2)
|
||||
{
|
||||
this->SetDesc(_("To protect voices against bot kicks"));
|
||||
this->SetSyntax(_("\037channel\037 {ON | OFF}"));
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
ChannelInfo *ci = cs_findchan(params[0]);
|
||||
if (ci == NULL)
|
||||
{
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
AccessGroup access = source.AccessFor(ci);
|
||||
if (!source.HasPriv("botserv/administration") && !access.HasPriv("SET"))
|
||||
{
|
||||
source.Reply(ACCESS_DENIED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (readonly)
|
||||
{
|
||||
source.Reply(_("Sorry, bot option setting is temporarily disabled."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (params[1].equals_ci("ON"))
|
||||
{
|
||||
bool override = !access.HasPriv("SET");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to enable dontkickvoices";
|
||||
|
||||
ci->botflags.SetFlag(BS_DONTKICKVOICES);
|
||||
source.Reply(_("Bot \002won't kick voices\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else if (params[1].equals_ci("OFF"))
|
||||
{
|
||||
bool override = !access.HasPriv("SET");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to disable dontkickvoices";
|
||||
|
||||
ci->botflags.UnsetFlag(BS_DONTKICKVOICES);
|
||||
source.Reply(_("Bot \002will kick voices\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else
|
||||
this->OnSyntaxError(source, source.command);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(_(" \n"
|
||||
"Enables or disables \002voices protection\002 mode on a channel.\n"
|
||||
"When it is enabled, voices won't be kicked by the bot\n"
|
||||
"even if they don't match the NOKICK level."));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class BSSetDontKickVoices : public Module
|
||||
{
|
||||
CommandBSSetDontKickVoices commandbssetdontkickvoices;
|
||||
|
||||
public:
|
||||
BSSetDontKickVoices(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
|
||||
commandbssetdontkickvoices(this)
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
}
|
||||
};
|
||||
|
||||
MODULE_INIT(BSSetDontKickVoices)
|
||||
@@ -1,99 +0,0 @@
|
||||
/* BotServ core functions
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
#include "module.h"
|
||||
|
||||
class CommandBSSetFantasy : public Command
|
||||
{
|
||||
public:
|
||||
CommandBSSetFantasy(Module *creator, const Anope::string &sname = "botserv/set/fantasy") : Command(creator, sname, 2, 2)
|
||||
{
|
||||
this->SetDesc(_("Enable fantaisist commands"));
|
||||
this->SetSyntax(_("\037channel\037 {\037ON|OFF\037}"));
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
ChannelInfo *ci = cs_findchan(params[0]);
|
||||
const Anope::string &value = params[1];
|
||||
|
||||
if (ci == NULL)
|
||||
{
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!source.HasPriv("botserv/administration") && !source.AccessFor(ci).HasPriv("SET"))
|
||||
{
|
||||
source.Reply(ACCESS_DENIED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (readonly)
|
||||
{
|
||||
source.Reply(_("Sorry, bot option setting is temporarily disabled."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (value.equals_ci("ON"))
|
||||
{
|
||||
bool override = !source.AccessFor(ci).HasPriv("SET");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to enable fantasy";
|
||||
|
||||
ci->botflags.SetFlag(BS_FANTASY);
|
||||
source.Reply(_("Fantasy mode is now \002on\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else if (value.equals_ci("OFF"))
|
||||
{
|
||||
bool override = !source.AccessFor(ci).HasPriv("SET");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to disable fantasy";
|
||||
|
||||
ci->botflags.UnsetFlag(BS_FANTASY);
|
||||
source.Reply(_("Fantasy mode is now \002off\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else
|
||||
this->OnSyntaxError(source, source.command);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(_(" \n"
|
||||
"Enables or disables \002fantasy\002 mode on a channel.\n"
|
||||
"When it is enabled, users will be able to use\n"
|
||||
"%s commands on a channel when prefixed\n"
|
||||
"with one of the following fantasy characters: \002%s\002\n"
|
||||
" \n"
|
||||
"Note that users wanting to use fantaisist\n"
|
||||
"commands MUST have enough level for both\n"
|
||||
"the FANTASIA and another level depending\n"
|
||||
"of the command if required (for example, to use \n"
|
||||
"!op, user must have enough access for the OPDEOP\n"
|
||||
"level)."), Config->ChanServ.c_str(), Config->BSFantasyCharacter.c_str());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class BSSetFantasy : public Module
|
||||
{
|
||||
CommandBSSetFantasy commandbssetfantasy;
|
||||
|
||||
public:
|
||||
BSSetFantasy(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
|
||||
commandbssetfantasy(this)
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
}
|
||||
};
|
||||
|
||||
MODULE_INIT(BSSetFantasy)
|
||||
@@ -1,92 +0,0 @@
|
||||
/* BotServ core functions
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
#include "module.h"
|
||||
|
||||
class CommandBSSetGreet : public Command
|
||||
{
|
||||
public:
|
||||
CommandBSSetGreet(Module *creator, const Anope::string &sname = "botserv/set/greet") : Command(creator, sname, 2, 2)
|
||||
{
|
||||
this->SetDesc(_("Enable greet messages"));
|
||||
this->SetSyntax(_("\037channel\037 {\037ON|OFF\037}"));
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
ChannelInfo *ci = cs_findchan(params[0]);
|
||||
const Anope::string &value = params[1];
|
||||
|
||||
if (ci == NULL)
|
||||
{
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!source.HasPriv("botserv/administration") && !source.AccessFor(ci).HasPriv("SET"))
|
||||
{
|
||||
source.Reply(ACCESS_DENIED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (readonly)
|
||||
{
|
||||
source.Reply(_("Sorry, bot option setting is temporarily disabled."));
|
||||
return;
|
||||
}
|
||||
|
||||
if (value.equals_ci("ON"))
|
||||
{
|
||||
bool override = !source.AccessFor(ci).HasPriv("SET");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to enable greets";
|
||||
|
||||
ci->botflags.SetFlag(BS_GREET);
|
||||
source.Reply(_("Greet mode is now \002on\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else if (value.equals_ci("OFF"))
|
||||
{
|
||||
bool override = !source.AccessFor(ci).HasPriv("SET");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to disable greets";
|
||||
|
||||
ci->botflags.UnsetFlag(BS_GREET);
|
||||
source.Reply(_("Greet mode is now \002off\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else
|
||||
this->OnSyntaxError(source, source.command);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(_(" \n"
|
||||
"Enables or disables \002greet\002 mode on a channel.\n"
|
||||
"When it is enabled, the bot will display greet\n"
|
||||
"messages of users joining the channel, provided\n"
|
||||
"they have enough access to the channel."));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class BSSetGreet : public Module
|
||||
{
|
||||
CommandBSSetGreet commandbssetgreet;
|
||||
|
||||
public:
|
||||
BSSetGreet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
|
||||
commandbssetgreet(this)
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
}
|
||||
};
|
||||
|
||||
MODULE_INIT(BSSetGreet)
|
||||
@@ -1,87 +0,0 @@
|
||||
/* BotServ core functions
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
#include "module.h"
|
||||
|
||||
class CommandBSSetNoBot : public Command
|
||||
{
|
||||
public:
|
||||
CommandBSSetNoBot(Module *creator, const Anope::string &sname = "botserv/set/nobot") : Command(creator, sname, 2, 2)
|
||||
{
|
||||
this->SetDesc(_("Prevent a bot from being assigned to a channel"));
|
||||
this->SetSyntax(_("\037channel\037 {\037ON|OFF\037}"));
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
ChannelInfo *ci = cs_findchan(params[0]);
|
||||
const Anope::string &value = params[1];
|
||||
|
||||
if (ci == NULL)
|
||||
{
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!source.HasCommand("botserv/set/nobot"))
|
||||
{
|
||||
source.Reply(ACCESS_DENIED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (value.equals_ci("ON"))
|
||||
{
|
||||
bool override = !source.AccessFor(ci).HasPriv("SET");
|
||||
Log(override ? LOG_ADMIN : LOG_COMMAND, source, this, ci) << "to enable nobot";
|
||||
|
||||
ci->botflags.SetFlag(BS_NOBOT);
|
||||
if (ci->bi)
|
||||
ci->bi->UnAssign(source.GetUser(), ci);
|
||||
source.Reply(_("No Bot mode is now \002on\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else if (value.equals_ci("OFF"))
|
||||
{
|
||||
bool override = !source.AccessFor(ci).HasPriv("SET");
|
||||
Log(override ? LOG_ADMIN : LOG_COMMAND, source, this, ci) << "to disable nobot";
|
||||
|
||||
ci->botflags.UnsetFlag(BS_NOBOT);
|
||||
source.Reply(_("No Bot mode is now \002off\002 on channel %s."), ci->name.c_str());
|
||||
}
|
||||
else
|
||||
this->OnSyntaxError(source, source.command);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(_(" \n"
|
||||
"This option makes a channel be unassignable. If a bot \n"
|
||||
"is already assigned to the channel, it is unassigned\n"
|
||||
"automatically when you enable the option."));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class BSSetNoBot : public Module
|
||||
{
|
||||
CommandBSSetNoBot commandbssetnobot;
|
||||
|
||||
public:
|
||||
BSSetNoBot(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
|
||||
commandbssetnobot(this)
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
}
|
||||
};
|
||||
|
||||
MODULE_INIT(BSSetNoBot)
|
||||
@@ -1,78 +0,0 @@
|
||||
/* BotServ core functions
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Based on the original code of Epona by Lara.
|
||||
* Based on the original code of Services by Andy Church.
|
||||
*/
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
#include "module.h"
|
||||
|
||||
class CommandBSSetPrivate : public Command
|
||||
{
|
||||
public:
|
||||
CommandBSSetPrivate(Module *creator, const Anope::string &sname = "botserv/set/private") : Command(creator, sname, 2, 2)
|
||||
{
|
||||
this->SetDesc(_("Prevent a bot from being assigned by non IRC operators"));
|
||||
this->SetSyntax(_("\037botname\037 {\037ON|OFF\037}"));
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
BotInfo *bi = findbot(params[0]);
|
||||
const Anope::string &value = params[1];
|
||||
|
||||
if (bi == NULL)
|
||||
{
|
||||
source.Reply(BOT_DOES_NOT_EXIST, params[0].c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!source.HasCommand("botserv/set/private"))
|
||||
{
|
||||
source.Reply(ACCESS_DENIED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (value.equals_ci("ON"))
|
||||
{
|
||||
bi->SetFlag(BI_PRIVATE);
|
||||
source.Reply(_("Private mode of bot %s is now \002on\002."), bi->nick.c_str());
|
||||
}
|
||||
else if (value.equals_ci("OFF"))
|
||||
{
|
||||
bi->UnsetFlag(BI_PRIVATE);
|
||||
source.Reply(_("Private mode of bot %s is now \002off\002."), bi->nick.c_str());
|
||||
}
|
||||
else
|
||||
this->OnSyntaxError(source, source.command);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(_(" \n"
|
||||
"This option prevents a bot from being assigned to a\n"
|
||||
"channel by users that aren't IRC operators."));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class BSSetPrivate : public Module
|
||||
{
|
||||
CommandBSSetPrivate commandbssetprivate;
|
||||
|
||||
public:
|
||||
BSSetPrivate(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
|
||||
commandbssetprivate(this)
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
}
|
||||
};
|
||||
|
||||
MODULE_INIT(BSSetPrivate)
|
||||
@@ -1,6 +1,6 @@
|
||||
/* ChanServ core functions
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -36,12 +36,12 @@ class AccessChanAccess : public ChanAccess
|
||||
return this->ci->GetLevel(name) != ACCESS_INVALID && this->level >= this->ci->GetLevel(name);
|
||||
}
|
||||
|
||||
Anope::string Serialize() const
|
||||
Anope::string AccessSerialize() const
|
||||
{
|
||||
return stringify(this->level);
|
||||
}
|
||||
|
||||
void Unserialize(const Anope::string &data) anope_override
|
||||
void AccessUnserialize(const Anope::string &data) anope_override
|
||||
{
|
||||
this->level = convertTo<int>(data);
|
||||
}
|
||||
@@ -119,7 +119,7 @@ class CommandCSAccess : public Command
|
||||
|
||||
bool override = false;
|
||||
|
||||
if ((!highest || *highest <= tmp_access) && !u_access.Founder)
|
||||
if ((!highest || *highest <= tmp_access) && !u_access.founder)
|
||||
{
|
||||
if (source.HasPriv("chanserv/access/modify"))
|
||||
override = true;
|
||||
@@ -130,9 +130,9 @@ class CommandCSAccess : public Command
|
||||
}
|
||||
}
|
||||
|
||||
if (mask.find_first_of("!*@") == Anope::string::npos && !findnick(mask))
|
||||
if (mask.find_first_of("!*@") == Anope::string::npos && !NickAlias::Find(mask))
|
||||
{
|
||||
User *targ = finduser(mask);
|
||||
User *targ = User::Find(mask, true);
|
||||
if (targ != NULL)
|
||||
mask = "*!*@" + targ->GetDisplayedHost();
|
||||
else
|
||||
@@ -148,7 +148,7 @@ class CommandCSAccess : public Command
|
||||
if (mask.equals_ci(access->mask))
|
||||
{
|
||||
/* Don't allow lowering from a level >= u_level */
|
||||
if ((!highest || *access >= *highest) && !u_access.Founder && !source.HasPriv("chanserv/access/modify"))
|
||||
if ((!highest || *access >= *highest) && !u_access.founder && !source.HasPriv("chanserv/access/modify"))
|
||||
{
|
||||
source.Reply(ACCESS_DENIED);
|
||||
return;
|
||||
@@ -164,7 +164,7 @@ class CommandCSAccess : public Command
|
||||
return;
|
||||
}
|
||||
|
||||
service_reference<AccessProvider> provider("AccessProvider", "access/access");
|
||||
ServiceReference<AccessProvider> provider("AccessProvider", "access/access");
|
||||
if (!provider)
|
||||
return;
|
||||
AccessChanAccess *access = anope_dynamic_static_cast<AccessChanAccess *>(provider->Create());
|
||||
@@ -186,7 +186,19 @@ class CommandCSAccess : public Command
|
||||
|
||||
void DoDel(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> ¶ms)
|
||||
{
|
||||
const Anope::string &mask = params[2];
|
||||
Anope::string mask = params[2];
|
||||
|
||||
if (!isdigit(mask[0]) && mask.find_first_of("!*@") == Anope::string::npos && !NickAlias::Find(mask))
|
||||
{
|
||||
User *targ = User::Find(mask, true);
|
||||
if (targ != NULL)
|
||||
mask = "*!*@" + targ->GetDisplayedHost();
|
||||
else
|
||||
{
|
||||
source.Reply(NICK_X_NOT_REGISTERED, mask.c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ci->GetAccessCount())
|
||||
source.Reply(_("%s access list is empty."), ci->name.c_str());
|
||||
@@ -197,12 +209,12 @@ class CommandCSAccess : public Command
|
||||
CommandSource &source;
|
||||
ChannelInfo *ci;
|
||||
Command *c;
|
||||
unsigned Deleted;
|
||||
unsigned deleted;
|
||||
Anope::string Nicks;
|
||||
bool Denied;
|
||||
bool override;
|
||||
public:
|
||||
AccessDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &numlist) : NumberList(numlist, true), source(_source), ci(_ci), c(_c), Deleted(0), Denied(false), override(false)
|
||||
AccessDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &numlist) : NumberList(numlist, true), source(_source), ci(_ci), c(_c), deleted(0), Denied(false), override(false)
|
||||
{
|
||||
if (!source.AccessFor(ci).HasPriv("ACCESS_CHANGE") && source.HasPriv("chanserv/access/modify"))
|
||||
this->override = true;
|
||||
@@ -210,18 +222,18 @@ class CommandCSAccess : public Command
|
||||
|
||||
~AccessDelCallback()
|
||||
{
|
||||
if (Denied && !Deleted)
|
||||
if (Denied && !deleted)
|
||||
source.Reply(ACCESS_DENIED);
|
||||
else if (!Deleted)
|
||||
else if (!deleted)
|
||||
source.Reply(_("No matching entries on %s access list."), ci->name.c_str());
|
||||
else
|
||||
{
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, c, ci) << "to delete " << Nicks;
|
||||
|
||||
if (Deleted == 1)
|
||||
if (deleted == 1)
|
||||
source.Reply(_("Deleted 1 entry from %s access list."), ci->name.c_str());
|
||||
else
|
||||
source.Reply(_("Deleted %d entries from %s access list."), Deleted, ci->name.c_str());
|
||||
source.Reply(_("Deleted %d entries from %s access list."), deleted, ci->name.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,13 +247,13 @@ class CommandCSAccess : public Command
|
||||
AccessGroup u_access = source.AccessFor(ci);
|
||||
const ChanAccess *u_highest = u_access.Highest();
|
||||
|
||||
if ((!u_highest || *u_highest <= *access) && !u_access.Founder && !this->override && !access->mask.equals_ci(source.nc->display))
|
||||
if ((!u_highest || *u_highest <= *access) && !u_access.founder && !this->override && !access->mask.equals_ci(source.nc->display))
|
||||
{
|
||||
Denied = true;
|
||||
return;
|
||||
}
|
||||
|
||||
++Deleted;
|
||||
++deleted;
|
||||
if (!Nicks.empty())
|
||||
Nicks += ", " + access->mask;
|
||||
else
|
||||
@@ -265,16 +277,16 @@ class CommandCSAccess : public Command
|
||||
ChanAccess *access = ci->GetAccess(i - 1);
|
||||
if (mask.equals_ci(access->mask))
|
||||
{
|
||||
if (!access->mask.equals_ci(source.nc->display) && !u_access.Founder && (!highest || *highest <= *access) && !source.HasPriv("chanserv/access/modify"))
|
||||
if (!access->mask.equals_ci(source.nc->display) && !u_access.founder && (!highest || *highest <= *access) && !source.HasPriv("chanserv/access/modify"))
|
||||
source.Reply(ACCESS_DENIED);
|
||||
else
|
||||
{
|
||||
source.Reply(_("\002%s\002 deleted from %s access list."), access->mask.c_str(), ci->name.c_str());
|
||||
bool override = !u_access.Founder && !u_access.HasPriv("ACCESS_CHANGE") && !access->mask.equals_ci(source.nc->display);
|
||||
bool override = !u_access.founder && !u_access.HasPriv("ACCESS_CHANGE") && !access->mask.equals_ci(source.nc->display);
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to delete " << access->mask;
|
||||
|
||||
FOREACH_MOD(I_OnAccessDel, OnAccessDel(ci, source, access));
|
||||
ci->EraseAccess(access);
|
||||
delete access;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -313,7 +325,7 @@ class CommandCSAccess : public Command
|
||||
|
||||
Anope::string timebuf;
|
||||
if (ci->c)
|
||||
for (CUserList::const_iterator cit = ci->c->users.begin(), cit_end = ci->c->users.end(); cit != cit_end; ++cit)
|
||||
for (Channel::ChanUserList::const_iterator cit = ci->c->users.begin(), cit_end = ci->c->users.end(); cit != cit_end; ++cit)
|
||||
if (access->Matches((*cit)->user, (*cit)->user->Account()))
|
||||
timebuf = "Now";
|
||||
if (timebuf.empty())
|
||||
@@ -321,7 +333,7 @@ class CommandCSAccess : public Command
|
||||
if (access->last_seen == 0)
|
||||
timebuf = "Never";
|
||||
else
|
||||
timebuf = do_strftime(access->last_seen, NULL, true);
|
||||
timebuf = Anope::strftime(access->last_seen, NULL, true);
|
||||
}
|
||||
|
||||
ListFormatter::ListEntry entry;
|
||||
@@ -330,7 +342,7 @@ class CommandCSAccess : public Command
|
||||
entry["Mask"] = access->mask;
|
||||
entry["By"] = access->creator;
|
||||
entry["Last seen"] = timebuf;
|
||||
this->list.addEntry(entry);
|
||||
this->list.AddEntry(entry);
|
||||
}
|
||||
}
|
||||
nl_list(list, ci, nick);
|
||||
@@ -347,7 +359,7 @@ class CommandCSAccess : public Command
|
||||
|
||||
Anope::string timebuf;
|
||||
if (ci->c)
|
||||
for (CUserList::const_iterator cit = ci->c->users.begin(), cit_end = ci->c->users.end(); cit != cit_end; ++cit)
|
||||
for (Channel::ChanUserList::const_iterator cit = ci->c->users.begin(), cit_end = ci->c->users.end(); cit != cit_end; ++cit)
|
||||
if (access->Matches((*cit)->user, (*cit)->user->Account()))
|
||||
timebuf = "Now";
|
||||
if (timebuf.empty())
|
||||
@@ -355,7 +367,7 @@ class CommandCSAccess : public Command
|
||||
if (access->last_seen == 0)
|
||||
timebuf = "Never";
|
||||
else
|
||||
timebuf = do_strftime(access->last_seen, NULL, true);
|
||||
timebuf = Anope::strftime(access->last_seen, NULL, true);
|
||||
}
|
||||
|
||||
ListFormatter::ListEntry entry;
|
||||
@@ -364,11 +376,11 @@ class CommandCSAccess : public Command
|
||||
entry["Mask"] = access->mask;
|
||||
entry["By"] = access->creator;
|
||||
entry["Last seen"] = timebuf;
|
||||
list.addEntry(entry);
|
||||
list.AddEntry(entry);
|
||||
}
|
||||
}
|
||||
|
||||
if (list.isEmpty())
|
||||
if (list.IsEmpty())
|
||||
source.Reply(_("No matching entries on %s access list."), ci->name.c_str());
|
||||
else
|
||||
{
|
||||
@@ -395,7 +407,7 @@ class CommandCSAccess : public Command
|
||||
}
|
||||
|
||||
ListFormatter list;
|
||||
list.addColumn("Number").addColumn("Level").addColumn("Mask");
|
||||
list.AddColumn("Number").AddColumn("Level").AddColumn("Mask");
|
||||
this->ProcessList(source, ci, params, list);
|
||||
}
|
||||
|
||||
@@ -408,7 +420,7 @@ class CommandCSAccess : public Command
|
||||
}
|
||||
|
||||
ListFormatter list;
|
||||
list.addColumn("Number").addColumn("Level").addColumn("Mask").addColumn("By").addColumn("Last seen");
|
||||
list.AddColumn("Number").AddColumn("Level").AddColumn("Mask").AddColumn("By").AddColumn("Last seen");
|
||||
this->ProcessList(source, ci, params, list);
|
||||
}
|
||||
|
||||
@@ -448,7 +460,7 @@ class CommandCSAccess : public Command
|
||||
const Anope::string &nick = params.size() > 2 ? params[2] : "";
|
||||
const Anope::string &s = params.size() > 3 ? params[3] : "";
|
||||
|
||||
ChannelInfo *ci = cs_findchan(params[0]);
|
||||
ChannelInfo *ci = ChannelInfo::Find(params[0]);
|
||||
if (ci == NULL)
|
||||
{
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
@@ -468,8 +480,8 @@ class CommandCSAccess : public Command
|
||||
has_access = true;
|
||||
else if (is_del)
|
||||
{
|
||||
const NickAlias *na = findnick(nick);
|
||||
if (na && na->nc == source.nc)
|
||||
const NickAlias *na = NickAlias::Find(nick);
|
||||
if (na && na->nc == source.GetAccount())
|
||||
has_access = true;
|
||||
}
|
||||
|
||||
@@ -480,7 +492,7 @@ class CommandCSAccess : public Command
|
||||
this->OnSyntaxError(source, cmd);
|
||||
else if (!has_access)
|
||||
source.Reply(ACCESS_DENIED);
|
||||
else if (readonly && !is_list)
|
||||
else if (Anope::ReadOnly && !is_list)
|
||||
source.Reply(_("Sorry, channel access list modification is temporarily disabled."));
|
||||
else if (cmd.equals_ci("ADD"))
|
||||
this->DoAdd(source, ci, params);
|
||||
@@ -508,7 +520,7 @@ class CommandCSAccess : public Command
|
||||
"user levels allow for access to different subsets of\n"
|
||||
"privileges. Any registered user not on the access list has\n"
|
||||
"a user level of 0, and any unregistered user has a user level\n"
|
||||
"of -1."), source.owner->nick.c_str());
|
||||
"of -1."), source.service->nick.c_str());
|
||||
source.Reply(" ");
|
||||
source.Reply(_("The \002ACCESS ADD\002 command adds the given mask to the\n"
|
||||
"access list with the given user level; if the mask is\n"
|
||||
@@ -557,7 +569,7 @@ class CommandCSAccess : public Command
|
||||
" \n"
|
||||
"These levels may be changed, or new ones added, using the\n"
|
||||
"\002LEVELS\002 command; type \002%s%s HELP LEVELS\002 for\n"
|
||||
"information."), source.owner->nick.c_str(), Config->UseStrictPrivMsgString.c_str(), source.owner->nick.c_str());
|
||||
"information."), source.service->nick.c_str(), Config->UseStrictPrivMsgString.c_str(), source.service->nick.c_str());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -592,7 +604,7 @@ class CommandCSLevels : public Command
|
||||
{
|
||||
Privilege *p = PrivilegeManager::FindPrivilege(what);
|
||||
if (p == NULL)
|
||||
source.Reply(_("Setting \002%s\002 not known. Type \002%s%s HELP LEVELS \002 for a list of valid settings."), what.c_str(), Config->UseStrictPrivMsgString.c_str(), source.owner->nick.c_str());
|
||||
source.Reply(_("Setting \002%s\002 not known. Type \002%s%s HELP LEVELS\002 for a list of valid settings."), what.c_str(), Config->UseStrictPrivMsgString.c_str(), source.service->nick.c_str());
|
||||
else
|
||||
{
|
||||
ci->SetLevel(p->name, level);
|
||||
@@ -630,7 +642,7 @@ class CommandCSLevels : public Command
|
||||
}
|
||||
}
|
||||
|
||||
source.Reply(_("Setting \002%s\002 not known. Type \002%s%s HELP LEVELS \002 for a list of valid settings."), what.c_str(), Config->UseStrictPrivMsgString.c_str(), source.owner->nick.c_str());
|
||||
source.Reply(_("Setting \002%s\002 not known. Type \002%s%s HELP LEVELS\002 for a list of valid settings."), what.c_str(), Config->UseStrictPrivMsgString.c_str(), source.service->nick.c_str());
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -640,7 +652,7 @@ class CommandCSLevels : public Command
|
||||
source.Reply(_("Access level settings for channel %s:"), ci->name.c_str());
|
||||
|
||||
ListFormatter list;
|
||||
list.addColumn("Name").addColumn("Level");
|
||||
list.AddColumn("Name").AddColumn("Level");
|
||||
|
||||
const std::vector<Privilege> &privs = PrivilegeManager::GetPrivileges();
|
||||
|
||||
@@ -659,7 +671,7 @@ class CommandCSLevels : public Command
|
||||
else
|
||||
entry["Level"] = stringify(j);
|
||||
|
||||
list.addEntry(entry);
|
||||
list.AddEntry(entry);
|
||||
}
|
||||
|
||||
std::vector<Anope::string> replies;
|
||||
@@ -697,7 +709,7 @@ class CommandCSLevels : public Command
|
||||
const Anope::string &what = params.size() > 2 ? params[2] : "";
|
||||
const Anope::string &s = params.size() > 3 ? params[3] : "";
|
||||
|
||||
ChannelInfo *ci = cs_findchan(params[0]);
|
||||
ChannelInfo *ci = ChannelInfo::Find(params[0]);
|
||||
if (ci == NULL)
|
||||
{
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
@@ -729,10 +741,10 @@ class CommandCSLevels : public Command
|
||||
{
|
||||
if (subcommand.equals_ci("DESC"))
|
||||
{
|
||||
source.Reply(_("The following feature/function names are understood."));
|
||||
source.Reply(_("The following feature/function names are available:"));
|
||||
|
||||
ListFormatter list;
|
||||
list.addColumn("Name").addColumn("Description");
|
||||
list.AddColumn("Name").AddColumn("Description");
|
||||
|
||||
const std::vector<Privilege> &privs = PrivilegeManager::GetPrivileges();
|
||||
for (unsigned i = 0; i < privs.size(); ++i)
|
||||
@@ -740,8 +752,8 @@ class CommandCSLevels : public Command
|
||||
const Privilege &p = privs[i];
|
||||
ListFormatter::ListEntry entry;
|
||||
entry["Name"] = p.name;
|
||||
entry["Description"] = translate(source.nc, p.desc.c_str());
|
||||
list.addEntry(entry);
|
||||
entry["Description"] = Language::Translate(source.nc, p.desc.c_str());
|
||||
list.AddEntry(entry);
|
||||
}
|
||||
|
||||
std::vector<Anope::string> replies;
|
||||
@@ -772,7 +784,7 @@ class CommandCSLevels : public Command
|
||||
"\002HELP ACCESS LEVELS\002).\n"
|
||||
" \n"
|
||||
"For a list of the features and functions whose levels can be\n"
|
||||
"set, see \002HELP LEVELS DESC\002."), source.owner->nick.c_str());
|
||||
"set, see \002HELP LEVELS DESC\002."), source.service->nick.c_str());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -789,6 +801,7 @@ class CSAccess : public Module
|
||||
accessprovider(this), commandcsaccess(this), commandcslevels(this)
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
this->SetPermanent(true);
|
||||
|
||||
Implementation i[] = { I_OnReload, I_OnCreateChan, I_OnGroupCheckPriv };
|
||||
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* ChanServ core functions
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* (C) 2003-2013 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
@@ -52,10 +52,13 @@ class CommandCSAKick : public Command
|
||||
{
|
||||
Anope::string mask = params[2];
|
||||
Anope::string reason = params.size() > 3 ? params[3] : "";
|
||||
const NickAlias *na = findnick(mask);
|
||||
const NickAlias *na = NickAlias::Find(mask);
|
||||
NickCore *nc = NULL;
|
||||
const AutoKick *akick;
|
||||
|
||||
if (reason.length() > Config->CSReasonMax)
|
||||
reason = reason.substr(0, Config->CSReasonMax);
|
||||
|
||||
if (!na)
|
||||
{
|
||||
Anope::string nick, user, host;
|
||||
@@ -69,7 +72,7 @@ class CommandCSAKick : public Command
|
||||
/* Check excepts BEFORE we get this far */
|
||||
if (ci->c)
|
||||
{
|
||||
std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> modes = ci->c->GetModeList(CMODE_EXCEPT);
|
||||
std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> modes = ci->c->GetModeList("EXCEPT");
|
||||
for (; modes.first != modes.second; ++modes.first)
|
||||
{
|
||||
if (Anope::Match(modes.first->second, mask))
|
||||
@@ -82,7 +85,7 @@ class CommandCSAKick : public Command
|
||||
|
||||
/* Check whether target nick has equal/higher access
|
||||
* or whether the mask matches a user with higher/equal access - Viper */
|
||||
if (ci->HasFlag(CI_PEACE) && nc)
|
||||
if (ci->HasExt("PEACE") && nc)
|
||||
{
|
||||
AccessGroup nc_access = ci->AccessFor(nc), u_access = source.AccessFor(ci);
|
||||
if (nc == ci->GetFounder() || nc_access >= u_access)
|
||||
@@ -91,16 +94,16 @@ class CommandCSAKick : public Command
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (ci->HasFlag(CI_PEACE))
|
||||
else if (ci->HasExt("PEACE"))
|
||||
{
|
||||
/* Match against all currently online users with equal or
|
||||
* higher access. - Viper */
|
||||
for (Anope::insensitive_map<User *>::iterator it = UserListByNick.begin(), it_end = UserListByNick.end(); it != it_end; ++it)
|
||||
for (user_map::const_iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it)
|
||||
{
|
||||
User *u2 = it->second;
|
||||
|
||||
AccessGroup nc_access = ci->AccessFor(nc), u_access = source.AccessFor(ci);
|
||||
Entry entry_mask(CMODE_BEGIN, mask);
|
||||
Entry entry_mask("", mask);
|
||||
|
||||
if ((ci->AccessFor(u2).HasPriv("FOUNDER") || nc_access >= u_access) && entry_mask.Matches(u2))
|
||||
{
|
||||
@@ -131,9 +134,9 @@ class CommandCSAKick : public Command
|
||||
for (unsigned j = 0, end = ci->GetAkickCount(); j < end; ++j)
|
||||
{
|
||||
akick = ci->GetAkick(j);
|
||||
if (akick->HasFlag(AK_ISNICK) ? akick->nc == nc : mask.equals_ci(akick->mask))
|
||||
if (akick->nc ? akick->nc == nc : mask.equals_ci(akick->mask))
|
||||
{
|
||||
source.Reply(_("\002%s\002 already exists on %s autokick list."), akick->HasFlag(AK_ISNICK) ? akick->nc->display.c_str() : akick->mask.c_str(), ci->name.c_str());
|
||||
source.Reply(_("\002%s\002 already exists on %s autokick list."), akick->nc ? akick->nc->display.c_str() : akick->mask.c_str(), ci->name.c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -178,34 +181,34 @@ class CommandCSAKick : public Command
|
||||
CommandSource &source;
|
||||
ChannelInfo *ci;
|
||||
Command *c;
|
||||
unsigned Deleted;
|
||||
unsigned deleted;
|
||||
public:
|
||||
AkickDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c), Deleted(0)
|
||||
AkickDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c), deleted(0)
|
||||
{
|
||||
}
|
||||
|
||||
~AkickDelCallback()
|
||||
{
|
||||
bool override = !source.AccessFor(ci).HasPriv("AKICK");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, c, ci) << "to delete " << Deleted << (Deleted == 1 ? " entry" : " entries");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, c, ci) << "to delete " << deleted << (deleted == 1 ? " entry" : " entries");
|
||||
|
||||
if (!Deleted)
|
||||
if (!deleted)
|
||||
source.Reply(_("No matching entries on %s autokick list."), ci->name.c_str());
|
||||
else if (Deleted == 1)
|
||||
else if (deleted == 1)
|
||||
source.Reply(_("Deleted 1 entry from %s autokick list."), ci->name.c_str());
|
||||
else
|
||||
source.Reply(_("Deleted %d entries from %s autokick list."), Deleted, ci->name.c_str());
|
||||
source.Reply(_("Deleted %d entries from %s autokick list."), deleted, ci->name.c_str());
|
||||
}
|
||||
|
||||
void HandleNumber(unsigned Number) anope_override
|
||||
void HandleNumber(unsigned number) anope_override
|
||||
{
|
||||
if (!Number || Number > ci->GetAkickCount())
|
||||
if (!number || number > ci->GetAkickCount())
|
||||
return;
|
||||
|
||||
FOREACH_MOD(I_OnAkickDel, OnAkickDel(source, ci, ci->GetAkick(Number - 1)));
|
||||
FOREACH_MOD(I_OnAkickDel, OnAkickDel(source, ci, ci->GetAkick(number - 1)));
|
||||
|
||||
++Deleted;
|
||||
ci->EraseAkick(Number - 1);
|
||||
++deleted;
|
||||
ci->EraseAkick(number - 1);
|
||||
}
|
||||
}
|
||||
delcallback(source, ci, this, mask);
|
||||
@@ -213,14 +216,14 @@ class CommandCSAKick : public Command
|
||||
}
|
||||
else
|
||||
{
|
||||
const NickAlias *na = findnick(mask);
|
||||
const NickAlias *na = NickAlias::Find(mask);
|
||||
const NickCore *nc = na ? *na->nc : NULL;
|
||||
|
||||
for (i = 0, end = ci->GetAkickCount(); i < end; ++i)
|
||||
{
|
||||
const AutoKick *akick = ci->GetAkick(i);
|
||||
|
||||
if ((akick->HasFlag(AK_ISNICK) && akick->nc == nc) || (!akick->HasFlag(AK_ISNICK) && mask.equals_ci(akick->mask)))
|
||||
if (akick->nc ? akick->nc == nc : mask.equals_ci(akick->mask))
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -266,22 +269,25 @@ class CommandCSAKick : public Command
|
||||
|
||||
Anope::string timebuf, lastused;
|
||||
if (akick->addtime)
|
||||
timebuf = do_strftime(akick->addtime, NULL, false);
|
||||
timebuf = Anope::strftime(akick->addtime, NULL, false);
|
||||
else
|
||||
timebuf = UNKNOWN;
|
||||
if (akick->last_used)
|
||||
lastused = do_strftime(akick->last_used, NULL, false);
|
||||
lastused = Anope::strftime(akick->last_used, NULL, false);
|
||||
else
|
||||
lastused = UNKNOWN;
|
||||
|
||||
ListFormatter::ListEntry entry;
|
||||
entry["Number"] = stringify(number);
|
||||
entry["Mask"] = akick->mask;
|
||||
if (akick->nc)
|
||||
entry["Mask"] = akick->nc->display;
|
||||
else
|
||||
entry["Mask"] = akick->mask;
|
||||
entry["Creator"] = akick->creator;
|
||||
entry["Created"] = timebuf;
|
||||
entry["Last used"] = lastused;
|
||||
entry["Reason"] = akick->reason;
|
||||
this->list.addEntry(entry);
|
||||
this->list.AddEntry(entry);
|
||||
}
|
||||
}
|
||||
nl_list(list, ci, mask);
|
||||
@@ -295,34 +301,37 @@ class CommandCSAKick : public Command
|
||||
|
||||
if (!mask.empty())
|
||||
{
|
||||
if (!akick->HasFlag(AK_ISNICK) && !Anope::Match(akick->mask, mask))
|
||||
if (!akick->nc && !Anope::Match(akick->mask, mask))
|
||||
continue;
|
||||
if (akick->HasFlag(AK_ISNICK) && !Anope::Match(akick->nc->display, mask))
|
||||
if (akick->nc && !Anope::Match(akick->nc->display, mask))
|
||||
continue;
|
||||
}
|
||||
|
||||
Anope::string timebuf, lastused;
|
||||
if (akick->addtime)
|
||||
timebuf = do_strftime(akick->addtime);
|
||||
timebuf = Anope::strftime(akick->addtime);
|
||||
else
|
||||
timebuf = UNKNOWN;
|
||||
if (akick->last_used)
|
||||
lastused = do_strftime(akick->last_used);
|
||||
lastused = Anope::strftime(akick->last_used);
|
||||
else
|
||||
lastused = UNKNOWN;
|
||||
|
||||
ListFormatter::ListEntry entry;
|
||||
entry["Number"] = stringify(i + 1);
|
||||
entry["Mask"] = akick->mask;
|
||||
if (akick->nc)
|
||||
entry["Mask"] = akick->nc->display;
|
||||
else
|
||||
entry["Mask"] = akick->mask;
|
||||
entry["Creator"] = akick->creator;
|
||||
entry["Created"] = timebuf;
|
||||
entry["Last used"] = lastused;
|
||||
entry["Reason"] = akick->reason;
|
||||
list.addEntry(entry);
|
||||
list.AddEntry(entry);
|
||||
}
|
||||
}
|
||||
|
||||
if (list.isEmpty())
|
||||
if (list.IsEmpty())
|
||||
source.Reply(_("No matching entries on %s autokick list."), ci->name.c_str());
|
||||
else
|
||||
{
|
||||
@@ -347,7 +356,7 @@ class CommandCSAKick : public Command
|
||||
}
|
||||
|
||||
ListFormatter list;
|
||||
list.addColumn("Number").addColumn("Mask").addColumn("Reason");
|
||||
list.AddColumn("Number").AddColumn("Mask").AddColumn("Reason");
|
||||
this->ProcessList(source, ci, params, list);
|
||||
}
|
||||
|
||||
@@ -360,7 +369,7 @@ class CommandCSAKick : public Command
|
||||
}
|
||||
|
||||
ListFormatter list;
|
||||
list.addColumn("Number").addColumn("Mask").addColumn("Creator").addColumn("Created").addColumn("Last used").addColumn("Reason");
|
||||
list.AddColumn("Number").AddColumn("Mask").AddColumn("Creator").AddColumn("Created").AddColumn("Last used").AddColumn("Reason");
|
||||
this->ProcessList(source, ci, params, list);
|
||||
}
|
||||
|
||||
@@ -375,9 +384,9 @@ class CommandCSAKick : public Command
|
||||
return;
|
||||
}
|
||||
|
||||
for (CUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; )
|
||||
for (User::ChanUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; )
|
||||
{
|
||||
UserContainer *uc = *it++;
|
||||
ChanUserContainer *uc = *it++;
|
||||
|
||||
if (ci->CheckKick(uc->user))
|
||||
++count;
|
||||
@@ -416,7 +425,7 @@ class CommandCSAKick : public Command
|
||||
Anope::string cmd = params[1];
|
||||
Anope::string mask = params.size() > 2 ? params[2] : "";
|
||||
|
||||
ChannelInfo *ci = cs_findchan(params[0]);
|
||||
ChannelInfo *ci = ChannelInfo::Find(params[0]);
|
||||
if (ci == NULL)
|
||||
{
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str());
|
||||
@@ -427,7 +436,7 @@ class CommandCSAKick : public Command
|
||||
this->OnSyntaxError(source, cmd);
|
||||
else if (!source.AccessFor(ci).HasPriv("AKICK") && !source.HasPriv("chanserv/access/modify"))
|
||||
source.Reply(ACCESS_DENIED);
|
||||
else if (!cmd.equals_ci("LIST") && !cmd.equals_ci("VIEW") && !cmd.equals_ci("ENFORCE") && readonly)
|
||||
else if (!cmd.equals_ci("LIST") && !cmd.equals_ci("VIEW") && !cmd.equals_ci("ENFORCE") && Anope::ReadOnly)
|
||||
source.Reply(_("Sorry, channel autokick list modification is temporarily disabled."));
|
||||
else if (cmd.equals_ci("ADD"))
|
||||
this->DoAdd(source, ci, params);
|
||||
@@ -464,7 +473,7 @@ class CommandCSAKick : public Command
|
||||
"When akicking a \037registered nick\037 the nickserv account\n"
|
||||
"will be added to the akick list instead of the mask.\n"
|
||||
"All users within that nickgroup will then be akicked.\n"),
|
||||
source.owner->nick.c_str());
|
||||
source.service->nick.c_str());
|
||||
source.Reply(_(
|
||||
" \n"
|
||||
"The \002AKICK DEL\002 command removes the given nick or mask\n"
|
||||
@@ -476,7 +485,7 @@ class CommandCSAKick : public Command
|
||||
"optionally only those AutoKick entries which match the\n"
|
||||
"given mask.\n"
|
||||
" \n"
|
||||
"The \002AKICK VIEW\002 command is a more verbose version of\n"
|
||||
"The \002AKICK VIEW\002 command is a more verbose version of the\n"
|
||||
"\002AKICK LIST\002 command.\n"
|
||||
" \n"
|
||||
"The \002AKICK ENFORCE\002 command causes %s to enforce the\n"
|
||||
@@ -484,7 +493,7 @@ class CommandCSAKick : public Command
|
||||
"AKICK mask.\n"
|
||||
" \n"
|
||||
"The \002AKICK CLEAR\002 command clears all entries of the\n"
|
||||
"akick list."), source.owner->nick.c_str());
|
||||
"akick list."), source.service->nick.c_str());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -499,6 +508,44 @@ class CSAKick : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
Implementation i[] = { I_OnCheckKick };
|
||||
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
|
||||
}
|
||||
|
||||
EventReturn OnCheckKick(User *u, ChannelInfo *ci, Anope::string &mask, Anope::string &reason) anope_override
|
||||
{
|
||||
if (ci->c->MatchesList(u, "EXCEPT"))
|
||||
return EVENT_CONTINUE;
|
||||
|
||||
for (unsigned j = 0, end = ci->GetAkickCount(); j < end; ++j)
|
||||
{
|
||||
AutoKick *autokick = ci->GetAkick(j);
|
||||
bool kick = false;
|
||||
|
||||
if (autokick->nc)
|
||||
{
|
||||
if (autokick->nc == u->Account())
|
||||
kick = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Entry akick_mask("", autokick->mask);
|
||||
if (akick_mask.Matches(u))
|
||||
kick = true;
|
||||
}
|
||||
|
||||
if (kick)
|
||||
{
|
||||
Log(LOG_DEBUG_2) << u->nick << " matched akick " << (autokick->nc ? autokick->nc->display : autokick->mask);
|
||||
autokick->last_used = Anope::CurTime;
|
||||
if (!autokick->nc)
|
||||
mask = autokick->mask;
|
||||
reason = autokick->reason.empty() ? Config->CSAutokickReason : autokick->reason;
|
||||
return EVENT_STOP;
|
||||
}
|
||||
}
|
||||
|
||||
return EVENT_CONTINUE;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
/* cs_appendtopic.c - Add text to a channels topic
|
||||
*
|
||||
* (C) 2003-2012 Anope Team
|
||||
* Contact us at team@anope.org
|
||||
*
|
||||
* Based on the original module by SGR <Alex_SGR@ntlworld.com>
|
||||
* Included in the Anope module pack since Anope 1.7.9
|
||||
* Anope Coder: GeniusDex <geniusdex@anope.org>
|
||||
*
|
||||
* Please read COPYING and README for further details.
|
||||
*
|
||||
* Send bug reports to the Anope Coder instead of the module
|
||||
* author, because any changes since the inclusion into anope
|
||||
* are not supported by the original author.
|
||||
*/
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
#include "module.h"
|
||||
|
||||
/* ------------------------------------------------------------
|
||||
* Name: cs_appendtopic
|
||||
* Author: SGR <Alex_SGR@ntlworld.com>
|
||||
* Date: 31/08/2003
|
||||
* ------------------------------------------------------------
|
||||
*
|
||||
* This module has no configurable options. For information on
|
||||
* this module, load it and refer to /ChanServ APPENDTOPIC HELP
|
||||
*
|
||||
* Thanks to dengel, Rob and Certus for all there support.
|
||||
* Especially Rob, who always manages to show me where I have
|
||||
* not allocated any memory. Even if it takes a few weeks of
|
||||
* pestering to get him to look at it.
|
||||
*
|
||||
* ------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/* DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
class CommandCSAppendTopic : public Command
|
||||
{
|
||||
public:
|
||||
CommandCSAppendTopic(Module *creator) : Command(creator, "chanserv/appendtopic", 2, 2)
|
||||
{
|
||||
this->SetDesc(_("Add text to a channels topic"));
|
||||
this->SetSyntax(_("\037channel\037 \037text\037"));
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override
|
||||
{
|
||||
const Anope::string &newtopic = params[1];
|
||||
|
||||
Channel *c = findchan(params[0]);;
|
||||
|
||||
if (!c)
|
||||
source.Reply(CHAN_X_NOT_IN_USE, params[0].c_str());
|
||||
else if (!c->ci)
|
||||
source.Reply(CHAN_X_NOT_REGISTERED, c->name.c_str());
|
||||
else if (!source.AccessFor(c->ci).HasPriv("TOPIC") && !source.HasCommand("chanserv/topic"))
|
||||
source.Reply(ACCESS_DENIED);
|
||||
else
|
||||
{
|
||||
Anope::string topic;
|
||||
if (!c->ci->last_topic.empty())
|
||||
{
|
||||
topic = c->ci->last_topic + " " + newtopic;
|
||||
c->ci->last_topic.clear();
|
||||
}
|
||||
else
|
||||
topic = newtopic;
|
||||
|
||||
bool has_topiclock = c->ci->HasFlag(CI_TOPICLOCK);
|
||||
c->ci->UnsetFlag(CI_TOPICLOCK);
|
||||
c->ChangeTopic(source.GetNick(), topic, Anope::CurTime);
|
||||
if (has_topiclock)
|
||||
c->ci->SetFlag(CI_TOPICLOCK);
|
||||
|
||||
bool override = !source.AccessFor(c->ci).HasPriv("TOPIC");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, c->ci) << "to append: " << topic;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(" ");
|
||||
source.Reply(_("This command allows users to append text to a currently set\n"
|
||||
"channel topic. When TOPICLOCK is on, the topic is updated and\n"
|
||||
"the new, updated topic is locked."));
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class CSAppendTopic : public Module
|
||||
{
|
||||
CommandCSAppendTopic commandcsappendtopic;
|
||||
|
||||
public:
|
||||
CSAppendTopic(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
|
||||
commandcsappendtopic(this)
|
||||
{
|
||||
this->SetAuthor("SGR");
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
MODULE_INIT(CSAppendTopic)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user