Merge branch 'insp3' into master.

This commit is contained in:
Sadie Powell 2019-05-15 15:11:31 +01:00
commit 1d5b18de82
223 changed files with 2602 additions and 1342 deletions

View File

@ -6,15 +6,13 @@ GENERAL SUPPORT INFORMATION
The GitHub issue tracker is for bug reports and feature requests.
General support can be found at the following locations:
IRC:
irc.inspircd.org #inspircd
Docs: https://docs.inspircd.org
IRC: irc.inspircd.org #inspircd
Example configs:
2.0 - https://github.com/inspircd/inspircd/tree/insp20/docs/conf
3.0 (alpha) - https://github.com/inspircd/inspircd/tree/master/docs/conf
3.0 (stable) - https://github.com/inspircd/inspircd/tree/insp3/docs/conf
2.0 (old stable) - https://github.com/inspircd/inspircd/tree/insp20/docs/conf
Wiki:
https://wiki.inspircd.org
-->
**Description**
@ -24,6 +22,7 @@ Briefly describe the problem you are having in a few paragraphs.
-->
**Steps to reproduce the issue:**
1.
2.
3.

2
.gitignore vendored
View File

@ -15,7 +15,7 @@
/include/config.h
/src/modules/m_geoip.cpp
/src/modules/m_geo_maxmind.cpp
/src/modules/m_ldap.cpp
/src/modules/m_mysql.cpp
/src/modules/m_pgsql.cpp

View File

@ -10,7 +10,7 @@ InspIRCd is supported on on the following platforms:
- Most recent Linux distributions using the Clang 3.8+ or GCC 5+ compilers and the GNU toolchain.
- The most recent three major releases of macOS using the AppleClang 7.0.2+, Clang 3.8+, or GCC 5+ (*not* LLVM-GCC) compilers and the GNU toolchains.
- The most recent three major releases of macOS using the AppleClang 7.0.2+, Clang 3.8+, or GCC 5+ (*not* LLVM-GCC) compilers and the GNU toolchain.
- Windows 7 or newer using the MSVC 14+ (Visual Studio 2015) compiler and CMake 2.8+.
@ -20,12 +20,12 @@ If you encounter any bugs then [please file an issue](https://github.com/inspirc
## Installation
Most InspIRCd users running a UNIX-like system build from source. A guide about how to do this is available on [the InspIRCd wiki](https://wiki.inspircd.org/Installation_From_Source).
Most InspIRCd users running a UNIX-like system build from source. A guide about how to do this is available on [the InspIRCd docs site](https://docs.inspircd.org/3/installation/source).
Building from source on Windows is generally not recommended but [a guide is available](https://github.com/inspircd/inspircd/blob/master/win/README.txt) if you wish to do this.
<!--
TODO: uncomment this once we have binary packages for v3.
TODO: uncomment this once we have binary packages for v4.
If you are running on CentOS 7, Debian 7, or Windows binary packages are available from [the downloads page](https://github.com/inspircd/inspircd/releases/latest).
@ -41,7 +41,8 @@ InspIRCd is licensed under [version 2 of the GNU General Public License](https:/
## External Links
* [Website](https://www.inspircd.org)
* [Documentation](https://wiki.inspircd.org)
* [Documentation](https://docs.inspircd.org)
* [GitHub](https://github.com/inspircd)
* [Support IRC channel](https://kiwiirc.com/nextclient/irc.inspircd.org:+6697/#inspircd) &mdash; \#inspircd on irc.inspircd.org
* [Development IRC channel](https://kiwiirc.com/nextclient/irc.inspircd.org:+6697/#inspircd.dev) &mdash; \#inspircd.dev on irc.inspircd.org
* [InspIRCd test network](https://kiwiirc.com/nextclient/testnet.inspircd.org:+6697) &mdash; testnet.inspircd.org

19
configure vendored
View File

@ -52,6 +52,7 @@ my ($opt_binary_dir,
$opt_config_dir,
$opt_data_dir,
$opt_development,
$opt_disable_auto_extras,
$opt_disable_interactive,
$opt_distribution_label,
$opt_gid,
@ -73,17 +74,18 @@ sub disable_extras (@);
my @opt_enableextras;
my @opt_disableextras;
GetOptions(
exit 1 unless GetOptions(
'clean' => \&cmd_clean,
'help' => \&cmd_help,
'update' => \&cmd_update,
'development' => \$opt_development,
'disable-interactive' => \$opt_disable_interactive,
'distribution-label=s' => \$opt_distribution_label,
'binary-dir=s' => \$opt_binary_dir,
'config-dir=s' => \$opt_config_dir,
'data-dir=s' => \$opt_data_dir,
'development' => \$opt_development,
'disable-auto-extras' => \$opt_disable_auto_extras,
'disable-interactive' => \$opt_disable_interactive,
'distribution-label=s' => \$opt_distribution_label,
'gid=s' => \$opt_gid,
'log-dir=s' => \$opt_log_dir,
'manual-dir=s' => \$opt_manual_dir,
@ -117,6 +119,7 @@ our $interactive = !(
defined $opt_config_dir ||
defined $opt_data_dir ||
defined $opt_development ||
defined $opt_disable_auto_extras ||
defined $opt_disable_interactive ||
defined $opt_distribution_label ||
defined $opt_gid ||
@ -254,14 +257,14 @@ $config{UID} = $user[2];
# Warn the user about clock drifting when running on OpenVZ.
if (-e '/proc/user_beancounters' || -e '/proc/vz/vzaquota') {
print_warning <<'EOW';
You are building InspIRCd inside of an an OpenVZ container. If you
You are building InspIRCd inside of an OpenVZ container. If you
plan to use InspIRCd in this container then you should make sure that NTP is
configured on the Hardware Node. Failure to do so may result in clock drifting!
EOW
}
# Check that the user actually wants this version.
if ($version{LABEL} ne 'release') {
if (defined $version{REAL_LABEL}) {
print_warning <<'EOW';
You are building a development version. This contains code which has
not been tested as heavily and may contain various faults which could seriously
@ -321,12 +324,12 @@ if (prompt_bool $interactive, $question, 0) {
enable_extras "$module_name.cpp";
}
}
} else {
} elsif (!defined $opt_disable_auto_extras) {
# TODO: finish modulemanager rewrite and replace this code with:
# system './modulemanager', 'enable', '--auto';
my %modules = (
# Missing: m_ldap, m_regex_stdlib, m_ssl_mbedtls
'm_geoip.cpp' => 'pkg-config --exists geoip',
'm_geo_maxmind.cpp' => 'pkg-config --exists libmaxminddb',
'm_mysql.cpp' => 'mysql_config --version',
'm_pgsql.cpp' => 'pg_config --version',
'm_regex_pcre.cpp' => 'pcre-config --version',

View File

@ -79,7 +79,7 @@ format are optional.">
<helpop key="accept" value="/ACCEPT *|(+|-)<nick>[,(+|-)<nick>]+
Manages your accept list. This list is used to determine who can
private message you when you have usermode +g set.
private message you when you have user mode +g set.
/ACCEPT * - List accepted nicks
/ACCEPT +<nick> - Add a nick
@ -145,10 +145,11 @@ E.g. '/RMODE #channel b m:*' will remove all mute extbans on the channel.">
This behaves identically to /REMOVE. /REMOVE is a built-in mIRC command
which caused trouble for some users.">
<helpop key="silence" value="/SILENCE [(+|-)<mask> [p|c|i|n|t|a|x]]
<helpop key="silence" value="/SILENCE [(+|-)<mask> [CcdiNnPpTtx]]
A server-side ignore of the given n!u@h mask. The flags at the end
are optional, and specify what is to be ignored from this mask.
A server-side ignore of the given n!u@h mask. If the optional flags field is
specified then it must contain one or more flags which specify what kind of
messages should be blocked and how they should be blocked.
/SILENCE - Shows a list of silenced masks
/SILENCE +<mask> [<flags>] - Add a mask
@ -156,24 +157,19 @@ are optional, and specify what is to be ignored from this mask.
Valid SILENCE Flags
-------------------
C Matches a CTCP targeted at a user.
c Matches a CTCP targeted at a channel.
d Default behaviour; equivalent to CciNnPpTt.
i Matches an invite to a channel.
N Matches a NOTICE targeted at a user.
n Matches a NOTICE targeted at a channel.
P Matches a PRIVMSG targeted at a user.
p Matches a PRIVMSG targeted at a channel.
T Matches a TAGMSG targeted at a user.
t Matches a TAGMSG targeted at a channel.
x Exempt the mask from silence rules.
p Block private messages
c Block channel messages
i Block invites
n Block private notices
t Block channel notices
a Block all of the above
x Exception
Multiple flags may be specified. For an exception, you must pair x
with what you want excepted. For example, if you wanted to except
everything from people with a host matching *.foo.net, you would do
/SILENCE +*!*@*.foo.net xa
If no flags are specified, it will default to blocking private messages
and private notices (pn).
/SILENCE without a parameter will list the masks that you have silenced.">
Any combination of flags is valid.">
<helpop key="knock" value="/KNOCK <channel> :<reason>
@ -224,7 +220,7 @@ Sends a notice to a user or channel specified in <target>.">
Joins one or more channels you provide the names for.">
<helpop key="names" value="/NAMES <channel>[,<channel>]+
<helpop key="names" value="/NAMES [<channel>[,<channel>]+]
Return a list of users on the channel(s) you provide.">
@ -247,7 +243,7 @@ Change or view modes of <target>.
Sets the mode for a channel or a nickname specified in <target>.
A user may only set modes upon themselves, and may not set the
+o usermode, and a user may only change channel modes of
+o user mode, and a user may only change channel modes of
channels where they are at least a halfoperator.
For a list of all user and channel modes, enter /HELPOP UMODES or
@ -347,10 +343,10 @@ to using a server.">
<helpop key="oper" value="/OPER <username> <password>
Attempts to authenticate a user as an IRC operator.
Attempts to authenticate as a server operator.
Both successful and unsuccessful oper attempts are
logged, and sent to online IRC operators.">
logged, and sent to online server operators.">
<helpop key="list" value="/LIST [<pattern>]
@ -465,8 +461,8 @@ Returns the IP address and nickname of the given user(s).">
This command returns the number of local and global clients matched,
and the percentage of clients matched, plus how they were matched
(by IP address or by hostname). Mask should be given as either a
nick!user@host or user@IP (wildcards accepted).">
(by IP address or by hostname). Mask should be given as either
nick!user@host or user@IP (wildcards and CIDR blocks are accepted).">
<helpop key="lockserv" value="/LOCKSERV [:<message>]
@ -492,11 +488,11 @@ Valid FILTER Actions
--------------------
None Does nothing
Warn Lets the message through and informs +s IRCops of the message
and all relevant info
Block Blocks message and informs +s IRCops of the blocked message
and all relevant info
Silent Blocks message, but does not notify IRCops
Warn Lets the message through and informs +s server operators
of the message and all relevant info
Block Blocks message and informs +s server operators of the blocked
message and all relevant info
Silent Blocks message, but does not notify server operators
Kill Kills the user
Gline G-lines the user for the specified duration
Zline Z-lines the user for the specified duration
@ -836,16 +832,16 @@ using their cloak when they quit.">
from channels they are in (requires the deaf module).
g In combination with /ACCEPT, provides for server-side
ignore (requires the callerid module).
h Marks as 'available for help' in WHOIS (IRCop only,
requires the helpop module).
h Marks as 'available for help' in WHOIS (server operators
only, requires the helpop module).
i Makes invisible to /WHO if the user using /WHO is not in
a common channel.
k Prevents the user from being kicked from channels, or
having op modes removed from them (services only,
requires the servprotect module).
o Marks as a IRC operator.
o Marks as a server operator.
s <mask> Receives server notices specified by <mask>
(IRCop only).
(server operators only).
r Marks as a having a registered nickname
(requires the services account module).
w Receives wallops messages.
@ -853,20 +849,24 @@ using their cloak when they quit.">
z Only allow private messages from SSL users (requires the
sslmode module).
B Marks as a bot (requires the botmode module).
D Privdeaf mode. User will not receive any private messages
or notices from users (requires the deaf module).
G Censors messages sent to the user based on filters
configured for the network (requires the censor module).
H Hides an oper's oper status from WHOIS (requires the
hideoper module).
I Hides a user's entire channel list in WHOIS from
non-IRCops (requires the hidechans module).
non-server operators (requires the hidechans module).
L Stops redirections done by the redirect module (requires
the redirect module).
O Allows server operators to opt-in to overriding
restrictions (requires the override module).
R Blocks private messages from unregistered users
(requires the services account module).
S Strips formatting codes out of private messages
to the user (requires the stripcolor module).
W Receives notification when a user uses WHOIS on them
(IRCop only, requires the showwhois module).">
W Receives notifications when a user uses WHOIS on them
(server operators only, requires the showwhois module).">
<helpop key="chmodes" value="Channel Modes
-------------
@ -965,12 +965,12 @@ using their cloak when they quit.">
the services account module).
N Prevents users on the channel from changing nick
(requires the nonicks module).
O Channel is IRCops only (can only be set by IRCops,
requires the operchans module).
O Channel is server operators only (can only be set
by server operators, requires the operchans module).
P Makes the channel permanent; Bans, invites, the
topic, modes, and such will not be lost when it
empties (can only be set by IRCops, requires
the permchannels module).
empties (can only be set by server operators,
requires the permchannels module).
Q Only U-lined servers and their users can kick
(requires the nokicks module).
R Blocks unregistered users from joining (requires
@ -984,6 +984,7 @@ using their cloak when they quit.">
(requires the exemptchanops module).
Possible restriction types to exempt with +X are:
anticaps Channel mode +B
auditorium-see Permission required to see the full user list of
a +u channel (requires the auditorium module).
auditorium-vis Permission required to be visible in a +u channel
@ -1042,9 +1043,9 @@ Y Show connection classes
O Show opertypes and the allowed user and channel modes it can set
E Show socket engine events
S Show currently held registered nicknames
G Show how many local users are connected from each country according to GeoIP
G Show how many local users are connected from each country
Note that all /STATS use is broadcast to online IRC operators.">
Note that all /STATS use is broadcast to online server operators.">
<helpop key="snomasks" value="Server Notice Masks
@ -1072,7 +1073,7 @@ Note that all /STATS use is broadcast to online IRC operators.">
r Allows receipt of local oper commands (requires the operlog module).
R Allows receipt of remote oper commands (requires the operlog module).
t Allows receipt of attempts to use /STATS (local and remote).
v Allows receipt of oper-override notices (requires the override module).
v Allows receipt of oper override notices (requires the override module).
x Allows receipt of local X-line notices (G/Z/Q/K/E/R/SHUN/CBan).
X Allows receipt of remote X-line notices (G/Z/Q/K/E/R/SHUN/CBan).">
@ -1092,7 +1093,7 @@ setting +I <extban>.
Matching extbans:
a:<mask> Matches user with both a matching banmask and realname,
a:<mask> Matches user with both a matching banmask and real name,
where <mask> is in the format nick!user@host+realname
(requires gecosban module).
j:<channel> Matches anyone in the given channel. Does not support
@ -1105,8 +1106,9 @@ Matching extbans:
serverban module).
z:<certfp> Matches users having the given SSL certificate
fingerprint (requires the sslmodes module).
O:<opertype> Matches IRCops of a matching type, mostly useful as an
an invite exception (requires the operchans module).
O:<opertype> Matches server operators of a matching type, mostly
useful as an invite exception (requires the
operchans module).
R:<account> Matches users logged into a matching account (requires
the services account module).
U:<banmask> Matches unregistered users matching the given banmask.

View File

@ -145,7 +145,7 @@
# ssl: If you want the port(s) in this bind tag to use SSL, set this to
# the name of a custom <sslprofile> tag that you have defined or one
# of "openssl", "gnutls", "mbedtls" if you have not defined any. See the
# wiki page for the SSL module you are using for more details.
# docs page for the SSL module you are using for more details.
#
# You will need to load the ssl_openssl module for OpenSSL, ssl_gnutls
# for GnuTLS and ssl_mbedtls for mbedTLS.
@ -180,7 +180,7 @@
#<bind path="/tmp/inspircd.sock" type="clients">
# You can define a custom <sslprofile> tag which defines the SSL configuration
# for this listener. See the wiki page for the SSL module you are using for
# for this listener. See the docs page for the SSL module you are using for
# more details.
#
# Alternatively, you can use one of the default SSL profiles which are created
@ -260,7 +260,7 @@
# a user if they do not do anything on connect.
# (Note, this is a client-side thing, if the client does not
# send /NICK, /USER or /PASS)
timeout="10"
timeout="20"
# localmax: Maximum local connections per IP (or CIDR mask, see below).
localmax="3"
@ -282,6 +282,10 @@
# useident: Defines if users in this class MUST respond to a ident query or not.
useident="no"
# usests: Whether a STS policy should be advertised to users in this class.
# This setting only has effect when the ircv3_sts module is loaded.
#usests="no"
# webirc: Restricts usage of this class to the specified WebIRC gateway.
# This setting only has effect when the cgiirc module is loaded.
#webirc="name"
@ -289,21 +293,31 @@
# limit: How many users are allowed in this class
limit="5000"
# modes: Usermodes that are set on users in this block on connect.
# modes: User modes that are set on users in this block on connect.
# Enabling this option requires that the conn_umodes module be loaded.
# This entry is highly recommended to use for/with IP cloaking/masking.
# For the example to work, this also requires that the cloaking
# module be loaded as well.
modes="+x"
# requireident, requiressl, requireaccount: require that users of this
# block have a valid ident response, use SSL, or have authenticated.
# Requires ident, sslinfo, or the services_account module, respectively.
requiressl="on"
# NOTE: For requireaccount, you must complete the signon prior to full
# connection. Currently, this is only possible by using SASL
# authentication; passforward and PRIVMSG NickServ happen after
# your final connect block has been found.
# requireident: Require that users of this block have a valid ident response.
# Requires the ident module to be loaded.
#requireident="yes"
# requiressl: Require that users of this block use an SSL connection.
# This can also be set to "trusted", as to only accept certificates
# issued by a certificate authority that you can configure in the
# settings of the SSL module that you're using.
# Requires the sslinfo module to be loaded.
#requiressl="yes"
# requireaccount: Require that users of this block have authenticated to a
# services account.
# NOTE: You must complete the signon prior to full connection. Currently,
# this is only possible by using SASL authentication; passforward
# and PRIVMSG NickServ happen after your final connect block has been found.
# Requires the services_account module to be loaded.
#requireaccount="yes"
# Alternate MOTD file for this connect class. The contents of this file are
# specified using <files secretmotd="filename"> or <execfiles ...>
@ -344,7 +358,7 @@
# a user if they do not do anything on connect.
# (Note, this is a client-side thing, if the client does not
# send /NICK, /USER or /PASS)
timeout="10"
timeout="20"
# pingfreq: How often the server tries to ping connecting clients.
pingfreq="2m"
@ -400,10 +414,14 @@
# useident: Defines if users in this class must respond to a ident query or not.
useident="no"
# usests: Whether a STS policy should be advertised to users in this class.
# This setting only has effect when the ircv3_sts module is loaded.
#usests="no"
# limit: How many users are allowed in this class
limit="5000"
# modes: Usermodes that are set on users in this block on connect.
# modes: User modes that are set on users in this block on connect.
# Enabling this option requires that the conn_umodes module be loaded.
# This entry is highly recommended to use for/with IP cloaking/masking.
# For the example to work, this also requires that the cloaking
@ -438,11 +456,11 @@
# This file has all the information about oper classes, types and o:lines.
# You *MUST* edit it.
<include file="examples/opers.conf.example">
#<include file="examples/opers.conf.example">
# This file has all the information about server links and ulined servers.
# You *MUST* edit it if you intend to link servers.
<include file="examples/links.conf.example">
#<include file="examples/links.conf.example">
#-#-#-#-#-#-#-#-#-#- MISCELLANEOUS CONFIGURATION -#-#-#-#-#-#-#-#-#-#
# #
@ -593,6 +611,8 @@
# exemptchanops: Allows users with with a status mode to be exempt
# from various channel restrictions. Possible restrictions are:
# - anticaps Channel mode +B - blocks messages with too many capital
# letters (requires the anticaps module).
# - auditorium-see Permission required to see the full user list of
# a +u channel (requires the auditorium module).
# - auditorium-vis Permission required to be visible in a +u channel
@ -745,7 +765,7 @@
restrictbannedusers="yes"
# genericoper: Setting this value to yes makes all opers on this server
# appear as 'is an IRC operator' in their WHOIS, regardless of their
# appear as 'is a server operator' in their WHOIS, regardless of their
# oper type, however oper types are still used internally. This only
# affects the display in WHOIS.
genericoper="no"
@ -918,7 +938,7 @@
<exception
# host: ident@hostname to exempt.
# Wildcards and CIDR (if you specify an IP) can be used.
host="*@ircop.example.com"
host="*@serverop.example.com"
# reason: Reason for exception. Only shown in /STATS e.
reason="Oper's hostname">
@ -965,7 +985,7 @@
# provide almost all the features of InspIRCd. :) #
# #
# The default does nothing -- we include it for simplicity for you. #
<include file="examples/modules.conf.example">
#<include file="examples/modules.conf.example">
#-#-#-#-#-#-#-#-#-#-#-# SERVICES CONFIGURATION #-#-#-#-#-#-#-#-#-#-#-#
# #

View File

@ -39,7 +39,7 @@
# ssl: If defined, this states the SSL profile that will be used when
# making an outbound connection to the server. Options are the name of an
# <sslprofile> tag that you have defined or one of "openssl", "gnutls",
# "mbedtls" if you have not defined any. See the wiki page for the SSL
# "mbedtls" if you have not defined any. See the docs page for the SSL
# module you are using for more details.
#
# You will need to load the ssl_openssl module for OpenSSL, ssl_gnutls
@ -49,8 +49,8 @@
# fingerprint: If defined, this option will force servers to be
# authenticated using SSL certificate fingerprints. See
# https://wiki.inspircd.org/SSL for more information. This will
# require an SSL link for both inbound and outbound connections.
# https://docs.inspircd.org/3/modules/spanningtree for more information.
# This will require an SSL link for both inbound and outbound connections.
#fingerprint=""
# bind: Local IP address to bind to.

View File

@ -10,7 +10,7 @@
# #
# By default, ALL modules are commented out. You must uncomment them #
# or add lines to your config to load modules. Please refer to #
# https://wiki.inspircd.org/3.0/Modules for a list of modules and #
# https://docs.inspircd.org/3/modules for a list of modules and #
# each modules link for any additional conf tags they require. #
# #
# ____ _ _____ _ _ ____ _ _ _ #
@ -117,9 +117,9 @@
# the user receives a 'no such nick' 401 numeric. #
# #
# uline - Setting this to true will ensure that the user #
# given in 'requires' is also on a u-lined server, #
# given in 'requires' is also on a U-lined server, #
# as well as actually being on the network. If the #
# user is online, but not on a u-lined server, #
# user is online, but not on a U-lined server, #
# then an oper alert is sent out as this is #
# possibly a sign of a user trying to impersonate #
# a service. #
@ -132,17 +132,17 @@
# An example of using the format value to create an alias with two
# different behaviours depending on the format of the parameters.
#
#<alias text="ID" format="#*" replace="PRIVMSG ChanServ :IDENTIFY $2 $3"
#<alias text="ID" format="#*" replace="SQUERY ChanServ :IDENTIFY $2 $3"
# requires="ChanServ" uline="yes">
#
#<alias text="ID" replace="PRIVMSG NickServ :IDENTIFY $2"
#<alias text="ID" replace="SQUERY NickServ :IDENTIFY $2"
# requires="NickServ" uline="yes">
#
# This alias fixes a glitch in xchat 2.6.x and above and the way it
# assumes IDENTIFY must be prefixed by a colon (:) character. It should
# be placed ABOVE the default NICKSERV alias.
#
#<alias text="NICKSERV" format=":IDENTIFY *" replace="PRIVMSG NickServ :IDENTIFY $3-"
#<alias text="NICKSERV" format=":IDENTIFY *" replace="SQUERY NickServ :IDENTIFY $3-"
# requires="NickServ" uline="yes">
#
# You may also add aliases to trigger based on something said in a
@ -151,7 +151,7 @@
# command must be preceded by the fantasy prefix when used.
#
#<alias text="CS" usercommand="no" channelcommand="yes"
# replace="PRIVMSG ChanServ :$1 $chan $2-" requires="ChanServ" uline="yes">
# replace="SQUERY ChanServ :$1 $chan $2-" requires="ChanServ" uline="yes">
#
# This would be used as "!cs <command> <options>", with the channel
# being automatically inserted after the command in the message to
@ -253,7 +253,7 @@
#<module name="botmode">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# CallerID module: Adds usermode +g which activates hybrid-style
# CallerID module: Adds user mode +g which activates hybrid-style
# callerid: block all private messages unless you /ACCEPT first.
#<module name="callerid">
#
@ -424,10 +424,12 @@
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Channelban: Implements extended ban j:, which stops anyone already
# in a channel matching a ban like +b j:#channel*mask from joining.
# in a channel matching a ban like +b j:#channel from joining.
# It is also possible to ban based on their status in that channel,
# like so: +b j:@#channel, this example prevents the ops from joining.
# Note that by default wildcard characters * and ? are allowed in
# channel names. To disallow them, load m_channames and add characters
# 42 and 63 to denyrange (see above).
# channel names. To disallow them, load the channames module and
# add characters 42 and 63 to denyrange (see above).
#<module name="channelban">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
@ -472,7 +474,7 @@
# Connection class ban module: Adds support for extban 'n' which
# matches against the class name of the user's connection.
# This module assumes that connection classes are named in a uniform
# way on all servers of the network.
# way on all servers of the network. Wildcards are accepted.
#<module name="classban">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
@ -481,7 +483,7 @@
#<module name="clearchan">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Cloaking module: Adds usermode +x and cloaking support.
# Cloaking module: Adds user mode +x and cloaking support.
# Relies on the md5 module being loaded.
# To cloak users when they connect, load the conn_umodes module and set
# <connect:modes> to include the +x mode. The example <connect> tag
@ -690,9 +692,24 @@
#<banfile pattern="*.txt" action="allow">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Deaf module: Adds support for the usermode +d - deaf to channel
# messages and channel notices.
# Deaf module: Adds support for user modes +d and +D:
# d - deaf to channel messages and notices.
# D - deaf to user messages and notices.
# The +D user mode is not enabled by default to enable link compatibility
# with 2.0 servers.
#<module name="deaf">
#
#-#-#-#-#-#-#-#-#-#-#-#- DEAF CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#
# bypasschars - Characters that bypass deaf to a regular user.
# bypasscharsuline - Characters that bypass deaf to a U-lined user (services).
# Both of these take a list of characters that must match
# the starting character of a message.
# If 'bypasscharsuline' is empty, then 'bypasschars' will
# match for both regular and U-lined users.
# enableprivdeaf - Whether to enable user mode +D (privdeaf).
# privdeafuline - Whether U-lined users bypass user mode +D (privdeaf).
#
#<deaf bypasschars="" bypasscharsuline="!" enableprivdeaf="no" privdeafuline="yes">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Delay join module: Adds the channel mode +D which delays all JOIN
@ -776,15 +793,16 @@
# more blacklists. #
#<module name="dnsbl">
# #
# For configuration options please see the wiki page for dnsbl at #
# https://wiki.inspircd.org/Modules/3.0/dnsbl #
# For configuration options please see the docs page for dnsbl at #
# https://docs.inspircd.org/3/modules/dnsbl #
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Exempt channel operators module: Provides support for allowing #
# users of a specified channel status to be exempt from some channel #
# restriction modes. Supported restrictions are #
# blockcaps, blockcolor, censor, filter, flood, nickflood, noctcp, #
# nonick, nonotice, regmoderated, stripcolor, and topiclock. #
# restriction modes. Supported restrictions are: #
# anticaps, auditorium-see, auditorium-vis, blockcaps, blockcolor, #
# censor, filter, flood, nickflood, noctcp, nonick, nonotice, #
# regmoderated, stripcolor, and topiclock. #
# See <options:exemptchanops> in inspircd.conf.example for a more #
# detailed list of the restriction modes that can be exempted. #
# These are settable using: /MODE #chan +X <restriction>:<status> #
@ -831,30 +849,48 @@
#<module name="gecosban">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# GeoIP module: Allows the server admin to match users by country code.
# This module is in extras. Re-run configure with:
# ./configure --enable-extras=m_geoip.cpp
# and run make install, then uncomment this module to enable it.
# This module requires GeoIP to be installed on your system,
# use your package manager to find the appropriate packages
# or check the InspIRCd wiki page for this module.
#<module name="geoip">
#
# The actual allow/ban actions are done by connect classes, not by the
# GeoIP module. An example connect class to ban people from russia or
# turkey:
#
# <connect deny="*" geoip="TR,RU">
#
# If enabled you can also ban people from channnels by country code
# using the G: extban (e.g. /MODE #channel +b G:US).
# <geoip extban="yes">
#
# The country code must be in capitals and should be an ISO country
# code such as TR, GB, or US. Unknown IPs (localhost, LAN IPs, etc)
# will be assigned the country code "UNK". Since connect classes are
# matched from top down, your deny classes must be above your allow
# classes for them to match.
# Geolocation ban module: Adds support for extban 'G' which matches #
# against the ISO 3166-1 alpha-2 codes for the countries that users #
# are connecting from. Users connecting from unknown origins such as #
# internal networks can be matched against using the XX alpha-2 code. #
# A full list of ISO 3166-1 alpha-2 codes can be found at #
# https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 #
#<module name="geoban">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Geolocation connect class module: Adds support for limiting connect #
# classes to users from specific countries. With this module you can #
# specify a space-delimited list of two character the ISO 3166-1 #
# alpha-2 codes in the "country" field of a connect class. e.g. to #
# deny connections from users in Russia or Turkey: #
# #
# <connect deny="*" country="TR RU"> #
# #
# Users connecting from unknown origins such as internal networks can #
# be matched against using the XX alpha-2 code. A full list of ISO #
# 3166-1 alpha-2 codes can be found at #
# https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 #
#<module name="geoclass">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# MaxMindDB geolocation module: Provides geolocation information for #
# other modules that need it using the libMaxMindDB library. #
# #
# This module is in extras. Re-run configure with: #
# ./configure --enable-extras=m_geo_maxmind.cpp
# and run make install, then uncomment this module to enable it. #
# #
# This module requires libMaxMindDB to be installed on your system. #
# Use your package manager to find the appropriate packages or check #
# the InspIRCd documentation page for this module. #
#<module name="geo_maxmind">
# #
# If you use the geo_maxmind module you MUST provide a database file #
# to look up geolocation information in. You can either purchase this #
# from MaxMind at https://www.maxmind.com/en/geoip2-country-database #
# or use the free CC-BY-SA licensed GeoLite2 Country database which #
# can be downloaded at https://dev.maxmind.com/geoip/geoip2/geolite2/ #
#<maxmind file="GeoLite2-Country.mmdb">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Globops module: Provides the /GLOBOPS command and snomask +g.
@ -939,7 +975,7 @@
#
#-#-#-#-#-#-#-#-#-#-#- HOSTCHANGE CONFIGURATION -#-#-#-#-#-#-#-#-#-#
# #
# See https://wiki.inspircd.org/Modules/3.0/hostchange for help. #
# See https://docs.inspircd.org/3/modules/hostchange for help. #
# #
#<hostchange mask="*@42.theanswer.example.org" action="addaccount" suffix=".users.example.com">
#<hostchange mask="*root@*" action="addnick" prefix="example/users/">
@ -1092,6 +1128,13 @@
# another user into a channel. This respects <options:announceinvites>.
#<module name="ircv3_invitenotify">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# IRCv3 message id module: Provides the msgid IRCv3 extension which
# adds a unique identifier to each message when the message-tags cap
# has been requested. This enables support for modern features such as
# reactions and replies.
#<module name="ircv3_msgid">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# IRCv3 server-time module. Adds the 'time' tag which adds a timestamp
# to all messages received from the server.
@ -1291,8 +1334,8 @@
#
#-#-#-#-#-#-#-#-#-#-#-#- SQL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#-#
# #
# mysql is more complex than described here, see the wiki for more #
# info: https://wiki.inspircd.org/Modules/3.0/mysql #
# mysql is more complex than described here, see the docs for more #
# info: https://docs.inspircd.org/3/modules/mysql #
#
#<database module="mysql" name="mydb" user="myuser" pass="mypass" host="localhost" id="my_database2">
@ -1369,7 +1412,7 @@
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Network business join module:
# Allows an oper to join a channel using /OJOIN, giving them +Y on the
# channel which makes them immune to kick/deop/etc.
# channel which makes them immune to kicks.
#<module name="ojoin">
#
# Specify the prefix that +Y will grant here.
@ -1423,26 +1466,26 @@
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Oper prefixing module: Adds a channel prefix mode +y which is given
# to all IRC operators automatically on all channels they are in.
# to all server operators automatically on all channels they are in.
# This prefix mode is more powerful than channel op and other regular
# prefix modes.
#
# Load this module if you want all your IRC operators to have channel
# operator powers.
# Load this module if you want all your server operators to have
# channel operator powers.
#<module name="operprefix">
#
# You may additionally customise the prefix character.
#<operprefix prefix="!">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Oper MOTD module: Provides support for separate message of the day
# Oper MOTD module: Provides support for a separate message of the day
# on oper-up.
# This module is oper-only.
#<module name="opermotd">
#
#-#-#-#-#-#-#-#-#-#-# OPERMOTD CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#
# #
# If you are using the opermotd module, specify the motd here. #
# If you are using the opermotd module, specify the motd file here. #
# #
# onoper - If on, the message is sent on /OPER, otherwise it's #
# only sent when /OPERMOTD is used. #
@ -1458,13 +1501,13 @@
# #
# Much of override's configuration relates to your oper blocks. #
# For more information on how to allow opers to override, see: #
# https://wiki.inspircd.org/Modules/3.0/override #
# https://docs.inspircd.org/3/modules/override #
# #
# noisy - If enabled, all oper overrides will be announced #
# via channel notice. #
# #
# requirekey - If enabled, overriding on join requires a channel #
# key of "override" to be specified #
# key of "override" to be specified. #
# #
#<override noisy="yes" requirekey="no">
@ -1502,7 +1545,7 @@
# cmd: Command for the user to run when it receives a connect
# password.
cmd="PRIVMSG $nickrequired :IDENTIFY $pass">
cmd="SQUERY $nickrequired :IDENTIFY $pass">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Password hash module: Allows hashed passwords to be used.
@ -1574,8 +1617,8 @@
#
#-#-#-#-#-#-#-#-#-#-#-#- SQL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#-#
# #
# pgsql is more complex than described here, see the wiki for #
# more: https://wiki.inspircd.org/Modules/3.0/pgsql #
# pgsql is more complex than described here, see the docs for #
# more: https://docs.inspircd.org/3/modules/pgsql #
#
#<database module="pgsql" name="mydb" user="myuser" pass="mypass" host="localhost" id="my_database" ssl="no">
@ -1680,7 +1723,7 @@
# less CPU usage. Increasing this beyond 512 doesn't have
# any effect, as the maximum length of a message on IRC
# cannot exceed that.
#<repeat maxbacklog="20" maxdistance="50 maxlines="20" maxtime="0" size="512">
#<repeat maxbacklog="20" maxdistance="50" maxlines="20" maxtime="0" size="512">
#<module name="repeat">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
@ -1714,13 +1757,15 @@
# If you wish to re-check a user when they change nickname (can be
# useful under some situations, but *can* also use CPU with more users
# on a server) then set 'matchonnickchange' to yes.
# If you additionally want Z-lines to be added on matches, then
# set 'zlineonmatch' to yes.
# Also, this is where you set what Regular Expression engine is to be
# used. If you ever change it while running, all of your R-lines will
# be wiped. This is the regex engine used by all R-lines set, and
# regex_<engine> must be loaded, or rline will be non-functional
# until you load it or change the engine to one that is loaded.
#
#<rline matchonnickchange="yes" engine="pcre">
#<rline matchonnickchange="yes" zlineonmatch="no" engine="pcre">
#
# Generally, you will NOT want to use 'glob' here, as this turns an
# R-line into just another G-line. The exceptions are that R-lines will
@ -1838,7 +1883,7 @@
#<module name="setidle">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Services support module: Adds several usermodes such as +R and +M.
# Services support module: Adds several user modes such as +R and +M.
# This module implements the 'identified' state via account names,
# and is similar in operation to the way asuka and ircu handle services.
#
@ -1884,6 +1929,7 @@
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Serverban: Implements extended ban 's', which stops anyone connected
# to a server matching a mask like +b s:server.mask.here from joining.
# Wildcards are accepted.
#<module name="serverban">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
@ -1925,7 +1971,7 @@
# endtext="End of server rules.">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Show whois module: Adds the +W usermode which allows opers to see
# Show whois module: Adds the +W user mode which allows opers to see
# when they are /WHOIS'd.
# This module is oper-only by default.
#<module name="showwhois">
@ -1973,7 +2019,7 @@
#<module name="sslrehashsignal">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# GnuTLS SSL module: Adds support for SSL connections using GnuTLS,
# GnuTLS SSL module: Adds support for SSL/TLS connections using GnuTLS,
# if enabled. You must answer 'yes' in ./configure when asked or
# manually symlink the source for this module from the directory
# src/modules/extra, if you want to enable this, or it will not load.
@ -1981,30 +2027,40 @@
#
#-#-#-#-#-#-#-#-#-#-#- GNUTLS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#
# #
# ssl_gnutls is too complex to describe here, see the wiki: #
# https://wiki.inspircd.org/Modules/3.0/ssl_gnutls #
# ssl_gnutls is too complex to describe here, see the docs: #
# https://docs.inspircd.org/3/modules/ssl_gnutls #
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# SSL info module: Allows users to retrieve information about other
# users' peer SSL certificates and keys. This can be used by client
# scripts to validate users. For this to work, one of ssl_gnutls
# or ssl_openssl must be loaded. This module also adds the
# "* <user> is using a secure connection" whois line, the ability for
# opers to use SSL cert fingerprints to verify their identity and the
# ability to force opers to use SSL connections in order to oper up.
# It is highly recommended to load this module if you use SSL on your
# network.
# For how to use the oper features, please see the first example <oper> tag
# in opers.conf.example.
# users' peer SSL certificates and keys via the SSLINFO command.
# This can be used by client scripts to validate users. For this to
# work, one of ssl_gnutls, ssl_mbedtls or ssl_openssl must be loaded.
# This module also adds the "<user> is using a secure connection"
# and "<user> has client certificate fingerprint <fingerprint>"
# WHOIS lines, the ability for opers to use SSL cert fingerprints to
# verify their identity and the ability to force opers to use SSL
# connections in order to oper up. It is highly recommended to load
# this module if you use SSL on your network.
# For how to use the oper features, please see the first
# example <oper> tag in opers.conf.example.
#
#<module name="sslinfo">
#
# If you want to prevent users from viewing SSL certificate information
# and fingerprints of other users, set operonly to yes.
#<sslinfo operonly="no">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# mbedTLS SSL module: Adds support for SSL/TLS connections using mbedTLS.
#<module name="ssl_mbedtls">
#
#-#-#-#-#-#-#-#-#-#-#- MBEDTLS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#
# #
# ssl_mbedtls is too complex to describe here, see the docs: #
# https://docs.inspircd.org/3/modules/ssl_mbedtls #
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# OpenSSL SSL module: Adds support for SSL connections using OpenSSL,
# OpenSSL SSL module: Adds support for SSL/TLS connections using OpenSSL,
# if enabled. You must answer 'yes' in ./configure when asked or symlink
# the source for this module from the directory src/modules/extra, if
# you want to enable this, or it will not load.
@ -2012,8 +2068,8 @@
#
#-#-#-#-#-#-#-#-#-#-#- OPENSSL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#
# #
# ssl_openssl is too complex to describe here, see the wiki: #
# https://wiki.inspircd.org/Modules/3.0/ssl_openssl #
# ssl_openssl is too complex to describe here, see the docs: #
# https://docs.inspircd.org/3/modules/ssl_openssl #
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Strip color module: Adds channel mode +S that strips color codes and
@ -2042,8 +2098,8 @@
#
#-#-#-#-#-#-#-#-#-#-#-#- SQL CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#-#
# #
# sqlite is more complex than described here, see the wiki for more #
# info: https://wiki.inspircd.org/Modules/3.0/sqlite3 #
# sqlite is more complex than described here, see the docs for more #
# info: https://docs.inspircd.org/3/modules/sqlite3 #
#
#<database module="sqlite" hostname="/full/path/to/database.db" id="anytext">
@ -2055,8 +2111,8 @@
#
#-#-#-#-#-#-#-#-#-#-#- SQLAUTH CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-#
# #
# sqlauth is too complex to describe here, see the wiki: #
# https://wiki.inspircd.org/Modules/3.0/sqlauth #
# sqlauth is too complex to describe here, see the docs: #
# https://docs.inspircd.org/3/modules/sqlauth #
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# SQL oper module: Allows you to store oper credentials in an SQL
@ -2070,14 +2126,14 @@
# #
# dbid - Database ID to use (see SQL modules). #
# #
# See also: https://wiki.inspircd.org/Modules/3.0/sqloper #
# See also: https://docs.inspircd.org/3/modules/sqloper #
# #
#<sqloper dbid="1">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# StartTLS module: Implements STARTTLS, which allows clients #
# connected to non SSL enabled ports to enable SSL, if a proper SSL #
# module is loaded (either ssl_gnutls or ssl_openssl). #
# module is loaded (either ssl_gnutls, ssl_mbedtls or ssl_openssl). #
#<module name="starttls">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
@ -2174,10 +2230,10 @@
# which are allowed to connect to the server. You should set this as
# strict as possible to prevent malicious webpages from connecting to
# your server.
# <wsorigin allow="https://*.example.com/">
# <wsorigin allow="https://*.example.com">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# XLine database: Stores all *-lines (G/Z/K/R/any added by other modules)
# X-line database: Stores all *-lines (G/Z/K/R/any added by other modules)
# in a file which is re-loaded on restart. This is useful
# for two reasons: it keeps bans so users may not evade them, and on
# bigger networks, server connections will take less time as there will

View File

@ -28,7 +28,7 @@
/ \
/ * Web: https://www.inspircd.org \
| * IRC: irc.inspircd.org #inspircd |
| * Docs: https://wiki.inspircd.org |
| * Docs: https://docs.inspircd.org |
| * Bugs: https://inspircd.org/bugs |
| |
| We hope you like this software. Please do |

View File

@ -28,7 +28,7 @@
/ \
/ * Web: https://www.inspircd.org \
| * IRC: irc.inspircd.org #inspircd |
| * Docs: https://wiki.inspircd.org |
| * Docs: https://docs.inspircd.org |
| * Bugs: https://inspircd.org/bugs |
| |
| We hope you like this software. Please do |

View File

@ -23,18 +23,20 @@
# - users/auspex: allows opers with this priv to view more details about users than normal users, e.g. real host and IP.
# - users/channel-spy: allows opers with this priv to view the private/secret channels that a user is on.
# - servers/auspex: allows opers with this priv to see more details about server information than normal users.
# ACTIONS:
# ACTIONS:
# - users/mass-message: allows opers with this priv to PRIVMSG and NOTICE to a server mask (e.g. NOTICE $*).
# - users/samode-usermodes: allows opers with this priv to change the user modes of any other user using /SAMODE.
# PERMISSIONS:
# PERMISSIONS:
# - channels/ignore-noctcp: allows opers with this priv to send a CTCP to a +C channel.
# - channels/ignore-nonicks: allows opers with this priv to change their nick when on a +N channel.
# - channels/restricted-create: allows opers with this priv to create channels if the restrictchans module is loaded.
# - users/flood/increased-buffers: allows opers with this priv to send and receive data without worrying about being disconnected for exceeding limits (*NOTE).
# - users/flood/no-fakelag: prevents opers from being penalized with fake lag for flooding (*NOTE).
# - users/flood/no-throttle: allows opers with this priv to send commands without being throttled (*NOTE).
# - users/flood/increased-buffers: allows opers with this priv to send and receive data without worrying about being disconnected for exceeding limits (*NOTE).
# - users/callerid-override: allows opers with this priv to message people using callerid without being on their callerid list.
# - users/ignore-callerid: allows opers with this priv to message people using callerid without being on their callerid list.
# - users/ignore-commonchans: allows opers with this priv to send a message to a +c user without sharing common channels.
# - users/ignore-noctcp: allows opers with this priv to send a CTCP to a +T user.
# - users/ignore-privdeaf: allows opers with this priv to message users with +D set.
# - users/sajoin-others: allows opers with this priv to /SAJOIN users other than themselves.
# - servers/use-disabled-commands: allows opers with this priv to use disabled commands.
# - servers/use-disabled-modes: allows opers with this priv to use disabled modes.
@ -42,7 +44,7 @@
# *NOTE: These privs are potentially dangerous, as they grant users with them the ability to hammer your server's CPU/RAM as much as they want, essentially.
privs="users/auspex channels/auspex servers/auspex users/mass-message users/flood/no-throttle users/flood/increased-buffers"
# usermodes: Oper-only usermodes that opers with this class can use.
# usermodes: Oper-only user modes that opers with this class can use.
usermodes="*"
# chanmodes: Oper-only channel modes that opers with this class can use.
@ -80,7 +82,7 @@
# Requires the opermodes module to be loaded.
modes="+s +cCqQ">
<type name="GlobalOp" classes="SACommands OperChat BanControl HostCloak ServerLink" vhost="ircop.omega.example.org">
<type name="GlobalOp" classes="SACommands OperChat BanControl HostCloak ServerLink" vhost="serverop.omega.example.org">
<type name="Helper" classes="HostCloak" vhost="helper.omega.example.org">

View File

@ -82,7 +82,7 @@ It just keeps going and going and going and going and goi <BANG>
All that I know is that nukes are comming from 127.0.0.1
I know all about the irc and the mirc cops.
M re ink n ed d, ple s r fil
Please refrain from feeding the IRC Operators. Thank you.
Please refrain from feeding the server operators. Thank you.
I know all about mirc stuff, hmm.. I think this channel is experiencing packet loss..
MacDonalds claims Macintosh stole their next idea of the iMac
I can't hold her any longer, captain, she's gonna bl.. sorry, got caught up in the moment

View File

@ -6,4 +6,4 @@
# /GLOBAL <message>
# Sends a global notice.
<alias text="GLOBAL" format="*" replace="PRIVMSG $requirement :GLOBAL $2-" requires="Global" uline="yes" operonly="yes">
<alias text="GLOBAL" format="*" replace="SQUERY $requirement :GLOBAL $2-" requires="Global" uline="yes" operonly="yes">

View File

@ -6,29 +6,29 @@
<include file="examples/services/generic.conf.example">
# Long hand aliases for services pseudoclients.
<alias text="ALIS" replace="PRIVMSG $requirement :$2-" requires="ALIS" uline="yes">
<alias text="CHANFIX" replace="PRIVMSG $requirement :$2-" requires="ChanFix" uline="yes">
<alias text="GAMESERV" replace="PRIVMSG $requirement :$2-" requires="GameServ" uline="yes">
<alias text="GLOBAL" replace="PRIVMSG $requirement :$2-" requires="Global" uline="yes" operonly="yes">
<alias text="GROUPSERV" replace="PRIVMSG $requirement :$2-" requires="GroupServ" uline="yes">
<alias text="HELPSERV" replace="PRIVMSG $requirement :$2-" requires="HelpServ" uline="yes">
<alias text="INFOSERV" replace="PRIVMSG $requirement :$2-" requires="InfoServ" uline="yes">
<alias text="PROXYSCAN" replace="PRIVMSG $requirement :$2-" requires="Proxyscan" uline="yes" operonly="yes">
<alias text="RPGSERV" replace="PRIVMSG $requirement :$2-" requires="RPGServ" uline="yes">
<alias text="ALIS" replace="SQUERY $requirement :$2-" requires="ALIS" uline="yes">
<alias text="CHANFIX" replace="SQUERY $requirement :$2-" requires="ChanFix" uline="yes">
<alias text="GAMESERV" replace="SQUERY $requirement :$2-" requires="GameServ" uline="yes">
<alias text="GLOBAL" replace="SQUERY $requirement :$2-" requires="Global" uline="yes" operonly="yes">
<alias text="GROUPSERV" replace="SQUERY $requirement :$2-" requires="GroupServ" uline="yes">
<alias text="HELPSERV" replace="SQUERY $requirement :$2-" requires="HelpServ" uline="yes">
<alias text="INFOSERV" replace="SQUERY $requirement :$2-" requires="InfoServ" uline="yes">
<alias text="PROXYSCAN" replace="SQUERY $requirement :$2-" requires="Proxyscan" uline="yes" operonly="yes">
<alias text="RPGSERV" replace="SQUERY $requirement :$2-" requires="RPGServ" uline="yes">
# Short hand aliases for services pseudoclients.
<alias text="CF" replace="PRIVMSG $requirement :$2-" requires="ChanFix" uline="yes">
<alias text="GL" replace="PRIVMSG $requirement :$2-" requires="Global" uline="yes" operonly="yes">
<alias text="GS" replace="PRIVMSG $requirement :$2-" requires="GroupServ" uline="yes">
<alias text="IS" replace="PRIVMSG $requirement :$2-" requires="InfoServ" uline="yes">
<alias text="LS" replace="PRIVMSG $requirement :$2-" requires="ALIS" uline="yes">
<alias text="PS" replace="PRIVMSG $requirement :$2-" requires="Proxyscan" uline="yes" operonly="yes">
<alias text="RS" replace="PRIVMSG $requirement :$2-" requires="RPGServ" uline="yes">
<alias text="CF" replace="SQUERY $requirement :$2-" requires="ChanFix" uline="yes">
<alias text="GL" replace="SQUERY $requirement :$2-" requires="Global" uline="yes" operonly="yes">
<alias text="GS" replace="SQUERY $requirement :$2-" requires="GroupServ" uline="yes">
<alias text="IS" replace="SQUERY $requirement :$2-" requires="InfoServ" uline="yes">
<alias text="LS" replace="SQUERY $requirement :$2-" requires="ALIS" uline="yes">
<alias text="PS" replace="SQUERY $requirement :$2-" requires="Proxyscan" uline="yes" operonly="yes">
<alias text="RS" replace="SQUERY $requirement :$2-" requires="RPGServ" uline="yes">
# These short hand aliases conflict with other pseudoclients. You can enable
# them but you will need to comment out the uncommented ones above first,
#<alias text="GS" replace="PRIVMSG $requirement :$2-" requires="GameServ" uline="yes">
#<alias text="HS" replace="PRIVMSG $requirement :$2-" requires="HelpServ" uline="yes">
#<alias text="GS" replace="SQUERY $requirement :$2-" requires="GameServ" uline="yes">
#<alias text="HS" replace="SQUERY $requirement :$2-" requires="HelpServ" uline="yes">
# Prevent clients from using the nicknames of services pseudoclients.
<badnick nick="ALIS" reason="Reserved for a network service">

View File

@ -4,27 +4,27 @@
<module name="alias">
# Long hand aliases for services pseudoclients.
<alias text="BOTSERV" replace="PRIVMSG $requirement :$2-" requires="BotServ" uline="yes">
<alias text="CHANSERV" replace="PRIVMSG $requirement :$2-" requires="ChanServ" uline="yes">
<alias text="HOSTSERV" replace="PRIVMSG $requirement :$2-" requires="HostServ" uline="yes">
<alias text="MEMOSERV" replace="PRIVMSG $requirement :$2-" requires="MemoServ" uline="yes">
<alias text="NICKSERV" replace="PRIVMSG $requirement :$2-" requires="NickServ" uline="yes">
<alias text="OPERSERV" replace="PRIVMSG $requirement :$2-" requires="OperServ" uline="yes" operonly="yes">
<alias text="STATSERV" replace="PRIVMSG $requirement :$2-" requires="StatServ" uline="yes">
<alias text="BOTSERV" replace="SQUERY $requirement :$2-" requires="BotServ" uline="yes">
<alias text="CHANSERV" replace="SQUERY $requirement :$2-" requires="ChanServ" uline="yes">
<alias text="HOSTSERV" replace="SQUERY $requirement :$2-" requires="HostServ" uline="yes">
<alias text="MEMOSERV" replace="SQUERY $requirement :$2-" requires="MemoServ" uline="yes">
<alias text="NICKSERV" replace="SQUERY $requirement :$2-" requires="NickServ" uline="yes">
<alias text="OPERSERV" replace="SQUERY $requirement :$2-" requires="OperServ" uline="yes" operonly="yes">
<alias text="STATSERV" replace="SQUERY $requirement :$2-" requires="StatServ" uline="yes">
# Short hand aliases for services pseudoclients.
<alias text="BS" replace="PRIVMSG $requirement :$2-" requires="BotServ" uline="yes">
<alias text="CS" replace="PRIVMSG $requirement :$2-" requires="ChanServ" uline="yes">
<alias text="HS" replace="PRIVMSG $requirement :$2-" requires="HostServ" uline="yes">
<alias text="MS" replace="PRIVMSG $requirement :$2-" requires="MemoServ" uline="yes">
<alias text="NS" replace="PRIVMSG $requirement :$2-" requires="NickServ" uline="yes">
<alias text="OS" replace="PRIVMSG $requirement :$2-" requires="OperServ" uline="yes" operonly="yes">
<alias text="SS" replace="PRIVMSG $requirement :$2-" requires="StatServ" uline="yes">
<alias text="BS" replace="SQUERY $requirement :$2-" requires="BotServ" uline="yes">
<alias text="CS" replace="SQUERY $requirement :$2-" requires="ChanServ" uline="yes">
<alias text="HS" replace="SQUERY $requirement :$2-" requires="HostServ" uline="yes">
<alias text="MS" replace="SQUERY $requirement :$2-" requires="MemoServ" uline="yes">
<alias text="NS" replace="SQUERY $requirement :$2-" requires="NickServ" uline="yes">
<alias text="OS" replace="SQUERY $requirement :$2-" requires="OperServ" uline="yes" operonly="yes">
<alias text="SS" replace="SQUERY $requirement :$2-" requires="StatServ" uline="yes">
# /ID [account] <password>
# Identifies to a services account.
<alias text="ID" format="*" replace="PRIVMSG $requirement :IDENTIFY $2-" requires="NickServ" uline="yes">
<alias text="IDENTIFY" format="*" replace="PRIVMSG $requirement :IDENTIFY $2-" requires="NickServ" uline="yes">
<alias text="ID" format="*" replace="SQUERY $requirement :IDENTIFY $2-" requires="NickServ" uline="yes">
<alias text="IDENTIFY" format="*" replace="SQUERY $requirement :IDENTIFY $2-" requires="NickServ" uline="yes">
# Prevent clients from using the nicknames of services pseudoclients.
<badnick nick="BotServ" reason="Reserved for a network service">

View File

@ -6,8 +6,8 @@ CREATE TABLE ircd_opers (
"host" text NOT NULL,
"type" text NOT NULL,
"fingerprint" text,
"autologin" boolean NOT NULL DEFAULT 0,
"active" boolean NOT NULL DEFAULT 1
"autologin" smallint NOT NULL DEFAULT 0,
"active" smallint NOT NULL DEFAULT 1
);
ALTER TABLE ONLY ircd_opers
ADD CONSTRAINT ircd_opers_pkey PRIMARY KEY (id);

View File

@ -293,7 +293,7 @@ class CoreExport InspIRCd
*/
std::vector<ListenSocket*> ports;
/** Set to the current signal recieved
/** Set to the current signal received
*/
static sig_atomic_t s_signal;
@ -396,12 +396,12 @@ class CoreExport InspIRCd
static bool IsSID(const std::string& sid);
/** Handles incoming signals after being set
* @param signal the signal recieved
* @param signal the signal received
*/
void SignalHandler(int signal);
/** Sets the signal recieved
* @param signal the signal recieved
/** Sets the signal received
* @param signal the signal received
*/
static void SetSignal(int signal);

View File

@ -380,12 +380,11 @@ class CoreExport BufferedSocket : public StreamSocket
* This will create a socket, register with socket engine, and start the asynchronous
* connection process. If an error is detected at this point (such as out of file descriptors),
* OnError will be called; otherwise, the state will become CONNECTING.
* @param ipaddr Address to connect to
* @param aport Port to connect on
* @param dest Remote endpoint to connect to.
* @param bind Local endpoint to connect from.
* @param maxtime Time to wait for connection
* @param connectbindip Address to bind to (if NULL, no bind will be done)
*/
void DoConnect(const std::string& ipaddr, int aport, unsigned int maxtime, const std::string& connectbindip);
void DoConnect(const irc::sockets::sockaddrs& dest, const irc::sockets::sockaddrs& bind, unsigned int maxtime);
/** This method is called when an outbound connection on your socket is
* completed.
@ -412,7 +411,6 @@ class CoreExport BufferedSocket : public StreamSocket
protected:
void OnEventHandlerWrite() override;
BufferedSocketError BeginConnect(const irc::sockets::sockaddrs& dest, const irc::sockets::sockaddrs& bind, unsigned int timeout);
BufferedSocketError BeginConnect(const std::string& ipaddr, int aport, unsigned int maxtime, const std::string& connectbindip);
};
inline IOHook* StreamSocket::GetIOHook() const { return iohook; }

View File

@ -202,7 +202,7 @@ class CoreExport LogManager
*/
bool AddLogType(const std::string &type, LogStream *l, bool autoclose);
/** Removes a logstream from the core. After removal, it will not recieve further events.
/** Removes a logstream from the core. After removal, it will not receive further events.
* If the LogStream was ever added with autoclose, it will be closed after this call (this means the pointer won't be valid anymore).
*/
void DelLogStream(LogStream* l);

View File

@ -99,7 +99,7 @@ struct ModResult {
/** InspIRCd major version.
* 1.2 -> 102; 2.1 -> 201; 2.12 -> 212
*/
#define INSPIRCD_VERSION_MAJ 300
#define INSPIRCD_VERSION_MAJ 400
/** InspIRCd API version.
* If you change any API elements, increment this value. This counter should be
@ -107,7 +107,7 @@ struct ModResult {
* and numerical comparisons in preprocessor macros if they wish to support
* multiple versions of InspIRCd in one file.
*/
#define INSPIRCD_VERSION_API 2
#define INSPIRCD_VERSION_API 0
/**
* This #define allows us to call a method in all
@ -216,7 +216,7 @@ enum Implementation
I_OnSendSnotice, I_OnUserPreJoin, I_OnUserPreKick, I_OnUserKick, I_OnOper,
I_OnUserPreInvite, I_OnUserInvite, I_OnUserPreMessage, I_OnUserPreNick,
I_OnUserPostMessage, I_OnUserMessageBlocked, I_OnMode,
I_OnDecodeMetaData, I_OnAcceptConnection, I_OnUserInit,
I_OnDecodeMetaData, I_OnAcceptConnection, I_OnUserInit, I_OnUserPostInit,
I_OnChangeHost, I_OnChangeRealName, I_OnAddLine, I_OnDelLine, I_OnExpireLine,
I_OnUserPostNick, I_OnPreMode, I_On005Numeric, I_OnKill, I_OnLoadModule,
I_OnUnloadModule, I_OnBackgroundTimer, I_OnPreCommand, I_OnCheckReady, I_OnCheckInvite,
@ -226,7 +226,7 @@ enum Implementation
I_OnPreChangeRealName, I_OnUserRegister, I_OnChannelPreDelete, I_OnChannelDelete,
I_OnPostOper, I_OnPostCommand, I_OnPostJoin,
I_OnBuildNeighborList, I_OnGarbageCollect, I_OnSetConnectClass,
I_OnUserMessage, I_OnPassCompare, I_OnNamesListItem, I_OnNumeric,
I_OnUserMessage, I_OnPassCompare, I_OnNumeric,
I_OnPreRehash, I_OnModuleRehash, I_OnChangeIdent, I_OnSetUserIP,
I_OnServiceAdd, I_OnServiceDel, I_OnUserWrite,
I_END
@ -722,11 +722,20 @@ class CoreExport Module : public classbase, public usecountbase
*/
virtual void OnPostCommand(Command* command, const CommandBase::Params& parameters, LocalUser* user, CmdResult result, bool loop);
/** Called when a user is first connecting, prior to starting DNS lookups, checking initial
* connect class, or accepting any commands.
/** Called after a user object is initialised and added to the user list.
* When this is called the user has not had their I/O hooks checked or had their initial
* connect class assigned and may not yet have a serialiser. You probably want to use
* the OnUserPostInit or OnUserSetIP hooks instead of this one.
* @param user The connecting user.
*/
virtual void OnUserInit(LocalUser* user);
/** Called after a user object has had their I/O hooks checked, their initial connection
* class assigned, and had a serialiser set.
* @param user The connecting user.
*/
virtual void OnUserPostInit(LocalUser* user);
/** Called to check if a user who is connecting can now be allowed to register
* If any modules return false for this function, the user is held in the waiting
* state until all modules return true. For example a module which implements ident
@ -896,18 +905,6 @@ class CoreExport Module : public classbase, public usecountbase
*/
virtual ModResult OnSetConnectClass(LocalUser* user, ConnectClass* myclass);
/** Called for every item in a NAMES list, so that modules may reformat portions of it as they see fit.
* For example NAMESX, channel mode +u and +I, and UHNAMES.
* @param issuer The user who is going to receive the NAMES list being built
* @param item The channel member being considered for inclusion
* @param prefixes The prefix character(s) to display, initially set to the prefix char of the most powerful
* prefix mode the member has, can be changed
* @param nick The nick to display, initially set to the member's nick, can be changed
* @return Return MOD_RES_PASSTHRU to allow the member to be displayed, MOD_RES_DENY to cause them to be
* excluded from this NAMES list
*/
virtual ModResult OnNamesListItem(User* issuer, Membership* item, std::string& prefixes, std::string& nick);
virtual ModResult OnNumeric(User* user, const Numeric::Numeric& numeric);
/** Called whenever a local user's IP is set for the first time, or when a local user's IP changes due to

View File

@ -0,0 +1,80 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2019 Peter Powell <petpow@saberuk.com>
*
* This file is part of InspIRCd. InspIRCd 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, version 2.
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#pragma once
namespace Geolocation
{
class APIBase;
class API;
class Location;
}
class Geolocation::APIBase : public DataProvider
{
public:
APIBase(Module* parent)
: DataProvider(parent, "geolocationapi")
{
}
/** Looks up the location of the specified user.
* @param user The user to look up the location of.
* @return Either an instance of the Location class or NULL if no location could be found.
*/
virtual Location* GetLocation(User* user) = 0;
/** Looks up the location of the specified IP address.
* @param sa The IP address to look up the location of.
* @return Either an instance of the Location class or NULL if no location could be found.
*/
virtual Location* GetLocation(irc::sockets::sockaddrs& sa) = 0;
};
class Geolocation::API : public dynamic_reference<Geolocation::APIBase>
{
public:
API(Module* parent)
: dynamic_reference<Geolocation::APIBase>(parent, "geolocationapi")
{
}
};
class Geolocation::Location : public usecountbase
{
private:
/** The two character country code for this location. */
std::string code;
/** The country name for this location. */
std::string name;
public:
Location(const std::string& Code, const std::string& Name)
: code(Code)
, name(Name)
{
}
/** Retrieves the two character country code for this location. */
std::string GetCode() const { return code; }
/** Retrieves the country name for this location. */
std::string GetName() const { return name; }
};

46
include/modules/names.h Normal file
View File

@ -0,0 +1,46 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2019 Peter Powell <petpow@saberuk.com>
*
* This file is part of InspIRCd. InspIRCd 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, version 2.
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "event.h"
namespace Names
{
class EventListener;
}
class Names::EventListener : public Events::ModuleEventListener
{
public:
EventListener(Module* mod)
: ModuleEventListener(mod, "event/names")
{
}
/* Called for every item in a NAMES list.
* @param issuer The user who initiated the NAMES request.
* @param memb The channel membership of the user who is being considered for inclusion.
* @param prefixes The prefix character(s) to show in front of the user's nickname.
* @param nick The nickname of the user to show.
* @return Return MOD_RES_PASSTHRU to allow the member to be displayed, MOD_RES_DENY to cause them to be
* excluded from this NAMES list
*/
virtual ModResult OnNamesListItem(LocalUser* issuer, Membership* memb, std::string& prefixes, std::string& nick) = 0;
};

View File

@ -193,7 +193,7 @@ class SSLIOHook : public IOHook
* Get the certificate sent by this peer
* @return The SSL certificate sent by the peer, NULL if no cert was sent
*/
ssl_cert* GetCertificate() const
virtual ssl_cert* GetCertificate() const
{
return certificate;
}
@ -203,7 +203,7 @@ class SSLIOHook : public IOHook
* @return The fingerprint of the SSL client certificate sent by the peer,
* empty if no cert was sent
*/
std::string GetFingerprint() const
virtual std::string GetFingerprint() const
{
ssl_cert* cert = GetCertificate();
if (cert && cert->IsUsable())

View File

@ -124,7 +124,7 @@ enum
/*
* A quick side-rant about the next group of numerics..
* There are clients out there that like to assume that just because they don't recieve a numeric
* There are clients out there that like to assume that just because they don't receive a numeric
* they know, that they have joined the channel.
*
* If IRC was at all properly standardised, this may even be a semi-acceptable assumption to make,
@ -133,7 +133,7 @@ enum
* instead!
*
* tl;dr version:
* DON'T MAKE YOUR CLIENT ASSUME YOU JOINED UNLESS YOU RECIEVE A JOIN WITH YOUR DAMN NICK ON IT.
* DON'T MAKE YOUR CLIENT ASSUME YOU JOINED UNLESS YOU RECEIVE A JOIN WITH YOUR DAMN NICK ON IT.
* Thanks.
*
* -- A message from the IRC group for coder sanity, and w00t

View File

@ -104,7 +104,7 @@ class CoreExport ProtocolInterface
/** Send a message to a channel.
* @param target The channel to message.
* @param status The status character (e.g. %) required to recieve.
* @param status The status character (e.g. %) required to receive.
* @param text The message to send.
* @param type The message type (MSG_PRIVMSG or MSG_NOTICE)
*/
@ -119,7 +119,7 @@ class CoreExport ProtocolInterface
/** Send a notice to a channel.
* @param target The channel to message.
* @param status The status character (e.g. %) required to recieve.
* @param status The status character (e.g. %) required to receive.
* @param text The message to send.
*/
void SendChannelNotice(Channel* target, char status, const std::string &text)

View File

@ -298,7 +298,7 @@ class CoreExport SocketEngine
static void ResizeDouble(std::vector<T>& vect)
{
if (SocketEngine::CurrentSetSize > vect.size())
vect.resize(vect.size() * 2);
vect.resize(SocketEngine::CurrentSetSize * 2);
}
public:

View File

@ -456,17 +456,16 @@ class CoreExport User : public Extensible
* @param command A command (should be all CAPS)
* @return True if this user can execute the command
*/
virtual bool HasPermission(const std::string &command);
virtual bool HasCommandPermission(const std::string& command);
/** Returns true if a user has a given permission.
* This is used to check whether or not users may perform certain actions which admins may not wish to give to
* all operators, yet are not commands. An example might be oper override, mass messaging (/notice $*), etc.
*
* @param privstr The priv to chec, e.g. "users/override/topic". These are loaded free-form from the config file.
* @param noisy If set to true, the user is notified that they do not have the specified permission where applicable. If false, no notification is sent.
* @return True if this user has the permission in question.
*/
virtual bool HasPrivPermission(const std::string &privstr, bool noisy = false);
virtual bool HasPrivPermission(const std::string& privstr);
/** Returns true or false if a user can set a privileged user or channel mode.
* This is done by looking up their oper type from User::oper, then referencing
@ -749,17 +748,16 @@ class CoreExport LocalUser : public User, public insp::intrusive_list_node<Local
* @param command A command (should be all CAPS)
* @return True if this user can execute the command
*/
bool HasPermission(const std::string &command) override;
bool HasCommandPermission(const std::string& command) override;
/** Returns true if a user has a given permission.
* This is used to check whether or not users may perform certain actions which admins may not wish to give to
* all operators, yet are not commands. An example might be oper override, mass messaging (/notice $*), etc.
*
* @param privstr The priv to chec, e.g. "users/override/topic". These are loaded free-form from the config file.
* @param noisy If set to true, the user is notified that they do not have the specified permission where applicable. If false, no notification is sent.
* @return True if this user has the permission in question.
*/
bool HasPrivPermission(const std::string &privstr, bool noisy = false) override;
bool HasPrivPermission(const std::string& privstr) override;
/** Returns true or false if a user can set a privileged user or channel mode.
* This is done by looking up their oper type from User::oper, then referencing

View File

@ -68,6 +68,7 @@ sub get_version {
# If the user has specified a distribution label then we use it in
# place of the label from src/version.sh or Git.
$version{REAL_LABEL} = $version{LABEL};
$version{LABEL} = shift // $version{LABEL};
# If any of these fields are missing then the user has deleted the

View File

@ -154,6 +154,8 @@ MISC OPTIONS
--clean Remove the configuration cache file and start
the interactive configuration wizard.
--disable-auto-extras Disables automatically enabling extra modules
for which the dependencies are available.
--disable-interactive Disables the interactive configuration wizard.
--distribution-label=[text] Sets a distribution specific version label in
the build configuration.

View File

@ -19,17 +19,40 @@
#pragma once
#define INSPIRCD_BRANCH "InspIRCd-@VERSION_MAJOR@"
#define INSPIRCD_VERSION "InspIRCd-@VERSION_FULL@"
/*** The branch version that is shown to unprivileged users. */
#define INSPIRCD_BRANCH "InspIRCd-@VERSION_MAJOR@"
/*** The full version that is shown to privileged users. */
#define INSPIRCD_VERSION "InspIRCd-@VERSION_FULL@"
/*** Determines whether this version of InspIRCd is older than the requested version. */
#define INSPIRCD_VERSION_BEFORE(MAJOR, MINOR) (((@VERSION_MAJOR@ << 8) | @VERSION_MINOR@) < ((MAJOR << 8) | (MINOR)))
/*** Determines whether this version of InspIRCd is equal to or newer than the requested version. */
#define INSPIRCD_VERSION_SINCE(MAJOR, MINOR) (((@VERSION_MAJOR@ << 16) | @VERSION_MINOR@) >= ((MAJOR << 8) | (MINOR)))
/*** The default location that config files are stored in. */
#define INSPIRCD_CONFIG_PATH "@CONFIG_DIR@"
#define INSPIRCD_DATA_PATH "@DATA_DIR@"
#define INSPIRCD_LOG_PATH "@LOG_DIR@"
/*** The default location that data files are stored in. */
#define INSPIRCD_DATA_PATH "@DATA_DIR@"
/*** The default location that log files are stored in. */
#define INSPIRCD_LOG_PATH "@LOG_DIR@"
/*** The default location that module files are stored in. */
#define INSPIRCD_MODULE_PATH "@MODULE_DIR@"
#ifndef _WIN32
%target include/config.h
/*** Whether the arc4random_buf() function was available at compile time. */
%define HAS_ARC4RANDOM_BUF
/*** Whether the clock_gettime() function was available at compile time. */
%define HAS_CLOCK_GETTIME
/*** Whether the eventfd() function was available at compile time. */
%define HAS_EVENTFD
#endif

View File

@ -32,7 +32,7 @@
CXX = @CXX@ -std=c++14
COMPILER = @COMPILER_NAME@
SYSTEM = @SYSTEM_NAME@
BUILDPATH ?= $(PWD)/build
BUILDPATH ?= $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/build
SOCKETENGINE = @SOCKETENGINE@
CORECXXFLAGS = -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -pipe -Iinclude -Wall -Wextra -Wfatal-errors -Wno-unused-parameter -Wshadow
LDLIBS = -lstdc++
@ -46,10 +46,11 @@ LOGPATH = "$(DESTDIR)@LOG_DIR@"
DATPATH = "$(DESTDIR)@DATA_DIR@"
BINPATH = "$(DESTDIR)@BINARY_DIR@"
SCRPATH = "$(DESTDIR)@SCRIPT_DIR@"
INSTALL = install
INSTMODE_DIR = 0750
INSTMODE_BIN = 0750
INSTMODE_LIB = 0640
INSTALL ?= install
INSTMODE_DIR ?= 0755
INSTMODE_BIN ?= 0755
INSTMODE_TXT ?= 0644
INSTMODE_PRV ?= 0640
ifneq ($(COMPILER), ICC)
CORECXXFLAGS += -Woverloaded-virtual -Wshadow
@ -77,7 +78,6 @@ ifeq ($(SYSTEM), gnu)
endif
ifeq ($(SYSTEM), solaris)
LDLIBS += -lsocket -lnsl -lrt -lresolv
INSTALL = ginstall
endif
ifeq ($(SYSTEM), darwin)
LDLIBS += -ldl
@ -113,6 +113,11 @@ ifeq ($(INSPIRCD_DEBUG), 2)
HEADER = debug-header
DBGOK=1
endif
ifeq ($(INSPIRCD_DEBUG), 3)
CORECXXFLAGS += -fno-rtti -O0 -g0
HEADER = std-header
DBGOK=1
endif
FOOTER = finishmessage
MAKEFLAGS += --no-print-directory
@ -187,8 +192,8 @@ std-header:
@echo "* BUILDING INSPIRCD *"
@echo "* *"
@echo "* This will take a *long* time. *"
@echo "* Why not read our wiki at *"
@echo "* https://wiki.inspircd.org *"
@echo "* Why not read our docs at *"
@echo "* https://docs.inspircd.org *"
@echo "* while you wait for Make to run? *"
@echo "*************************************"
@ -212,22 +217,22 @@ install: target
@-$(INSTALL) -d -g @GID@ -o @UID@ -m $(INSTMODE_DIR) $(MODPATH)
@-$(INSTALL) -d -g @GID@ -o @UID@ -m $(INSTMODE_DIR) $(SCRPATH)
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_BIN) "$(BUILDPATH)/bin/inspircd" $(BINPATH)
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_LIB) "$(BUILDPATH)/modules/"*.so $(MODPATH)
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_BIN) "$(BUILDPATH)/modules/"*.so $(MODPATH)
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_BIN) @CONFIGURE_DIRECTORY@/inspircd $(SCRPATH) 2>/dev/null
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_LIB) .gdbargs $(SCRPATH)/.gdbargs 2>/dev/null
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_TXT) .gdbargs $(SCRPATH)/.gdbargs 2>/dev/null
ifeq ($(SYSTEM), darwin)
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_BIN) @CONFIGURE_DIRECTORY@/org.inspircd.plist $(SCRPATH) 2>/dev/null
endif
ifeq ($(SYSTEM), linux)
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_LIB) @CONFIGURE_DIRECTORY@/inspircd.service $(SCRPATH) 2>/dev/null
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_TXT) @CONFIGURE_DIRECTORY@/inspircd.service $(SCRPATH) 2>/dev/null
endif
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_LIB) @CONFIGURE_DIRECTORY@/inspircd.1 $(MANPATH) 2>/dev/null
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_LIB) @CONFIGURE_DIRECTORY@/inspircd-genssl.1 $(MANPATH) 2>/dev/null
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_TXT) @CONFIGURE_DIRECTORY@/inspircd.1 $(MANPATH) 2>/dev/null
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_TXT) @CONFIGURE_DIRECTORY@/inspircd-genssl.1 $(MANPATH) 2>/dev/null
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_BIN) tools/genssl $(BINPATH)/inspircd-genssl 2>/dev/null
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_LIB) docs/conf/*.example $(CONPATH)/examples
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_LIB) docs/conf/services/*.example $(CONPATH)/examples/services
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_LIB) docs/sql/*.sql $(CONPATH)/examples/sql
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_LIB) *.pem $(CONPATH) 2>/dev/null
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_TXT) docs/conf/*.example $(CONPATH)/examples
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_TXT) docs/conf/services/*.example $(CONPATH)/examples/services
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_TXT) docs/sql/*.sql $(CONPATH)/examples/sql
-$(INSTALL) -g @GID@ -o @UID@ -m $(INSTMODE_PRV) *.pem $(CONPATH) 2>/dev/null
@echo ""
@echo "*************************************"
@echo "* INSTALL COMPLETE! *"
@ -284,6 +289,7 @@ help:
@echo ' INSPIRCD_VERBOSE=1 Show the full command being executed instead of "BUILD: dns.cpp"'
@echo ' INSPIRCD_DEBUG=1 Enable debug build, for module development or crash tracing'
@echo ' INSPIRCD_DEBUG=2 Enable debug build with optimizations, for detailed backtraces'
@echo ' INSPIRCD_DEBUG=3 Enable fast build with no optimisations or symbols, for Travis CI'
@echo ' DESTDIR= Specify a destination root directory (for tarball creation)'
@echo ' -j <N> Run a parallel build using N jobs'
@echo ''

View File

@ -78,7 +78,7 @@ sub do_link_dir {
for my $file (<$dir/*.cpp>) {
$link_flags .= rpath(get_directive($file, 'LinkerFlags', '')) . ' ';
}
my $execstr = "$ENV{CXX} -o $out $ENV{PICLDFLAGS} $link_flags @_";
my $execstr = "$ENV{CXX} -o $out $ENV{PICLDFLAGS} @_ $link_flags";
message 'LINK', $out, $execstr;
exec $execstr;
}

View File

@ -123,8 +123,8 @@ while (<SRC>) {
close SRC;
# determine core version
`./src/version.sh` =~ /InspIRCd-([0-9.]+)/ or die "Cannot determine inspircd version";
$installed{core} = $1;
my %version = get_version();
$installed{core} = "$version{MAJOR}.$version{MINOR}.$version{PATCH}";
for my $mod (keys %modules) {
MODVER: for my $mver (keys %{$modules{$mod}}) {
for my $dep (@{$modules{$mod}{$mver}{depends}}) {
@ -137,7 +137,7 @@ for my $mod (keys %modules) {
}
delete $modules{$mod} unless %{$modules{$mod}};
}
$modules{core}{$1} = {
$modules{core}{$installed{core}} = {
url => 'NONE',
depends => [],
conflicts => [],

View File

@ -239,7 +239,7 @@ Channel* Channel::JoinUser(LocalUser* user, std::string cname, bool override, co
{
if (chan->IsBanned(user))
{
user->WriteNumeric(ERR_BANNEDFROMCHAN, chan->name, "Cannot join channel (You're banned)");
user->WriteNumeric(ERR_BANNEDFROMCHAN, chan->name, "Cannot join channel (you're banned)");
return NULL;
}
}

View File

@ -139,7 +139,7 @@ CmdResult CommandParser::CallHandler(const std::string& commandname, const Comma
if (user->IsModeSet(n->second->flags_needed))
{
/* if user has the flags, and now has the permissions, go ahead */
if (user->HasPermission(commandname))
if (user->HasCommandPermission(commandname))
bOkay = true;
}
}
@ -257,7 +257,7 @@ void CommandParser::ProcessCommand(LocalUser* user, std::string& command, Comman
return;
}
if (!user->HasPermission(command))
if (!user->HasCommandPermission(command))
{
user->CommandFloodPenalty += failpenalty;
user->WriteNumeric(ERR_NOPRIVILEGES, InspIRCd::Format("Permission Denied - Oper type %s does not have access to command %s",

View File

@ -20,14 +20,16 @@
#include "inspircd.h"
#include "core_channel.h"
#include "modules/names.h"
CommandNames::CommandNames(Module* parent)
: SplitCommand(parent, "NAMES", 0, 0)
, secretmode(parent, "secret")
, privatemode(parent, "private")
, invisiblemode(parent, "invisible")
, namesevprov(parent, "event/names")
{
syntax = "<channel>[,<channel>]+";
syntax = "[<channel>[,<channel>]+]";
}
/** Handle /NAMES
@ -100,13 +102,9 @@ void CommandNames::SendNames(LocalUser* user, Channel* chan, bool show_invisible
nick = i->first->nick;
ModResult res;
FIRST_MOD_RESULT(OnNamesListItem, res, (user, memb, prefixlist, nick));
// See if a module wants us to exclude this user from NAMES
if (res == MOD_RES_DENY)
continue;
reply.Add(prefixlist, nick);
FIRST_MOD_RESULT_CUSTOM(namesevprov, Names::EventListener, OnNamesListItem, res, (user, memb, prefixlist, nick));
if (res != MOD_RES_DENY)
reply.Add(prefixlist, nick);
}
reply.Flush();

View File

@ -251,7 +251,7 @@ class CoreModChannel : public Module, public CheckExemption::EventListener
if (!MOD_RESULT.check(InspIRCd::TimingSafeCompare(ckey, keygiven)))
{
// If no key provided, or key is not the right one, and can't bypass +k (not invited or option not enabled)
user->WriteNumeric(ERR_BADCHANNELKEY, chan->name, "Cannot join channel (Incorrect channel key)");
user->WriteNumeric(ERR_BADCHANNELKEY, chan->name, "Cannot join channel (incorrect channel key)");
return MOD_RES_DENY;
}
}
@ -263,7 +263,7 @@ class CoreModChannel : public Module, public CheckExemption::EventListener
FIRST_MOD_RESULT(OnCheckInvite, MOD_RESULT, (user, chan));
if (MOD_RESULT != MOD_RES_ALLOW)
{
user->WriteNumeric(ERR_INVITEONLYCHAN, chan->name, "Cannot join channel (Invite only)");
user->WriteNumeric(ERR_INVITEONLYCHAN, chan->name, "Cannot join channel (invite only)");
return MOD_RES_DENY;
}
}
@ -275,7 +275,7 @@ class CoreModChannel : public Module, public CheckExemption::EventListener
FIRST_MOD_RESULT(OnCheckLimit, MOD_RESULT, (user, chan));
if (!MOD_RESULT.check(chan->GetUserCounter() < static_cast<size_t>(limitmode.ext.get(chan))))
{
user->WriteNumeric(ERR_CHANNELISFULL, chan->name, "Cannot join channel (Channel is full)");
user->WriteNumeric(ERR_CHANNELISFULL, chan->name, "Cannot join channel (channel is full)");
return MOD_RES_DENY;
}
}

View File

@ -116,9 +116,11 @@ class CommandTopic : public SplitCommand
*/
class CommandNames : public SplitCommand
{
private:
ChanModeReference secretmode;
ChanModeReference privatemode;
UserModeReference invisiblemode;
Events::ModuleEventProvider namesevprov;
public:
/** Constructor for names.

View File

@ -36,7 +36,7 @@ namespace DNS
using namespace DNS;
/** A full packet sent or recieved to/from the nameserver
/** A full packet sent or received to/from the nameserver
*/
class Packet : public Query
{
@ -842,7 +842,7 @@ class ModuleDNS : public Module
Version GetVersion() override
{
return Version("DNS support", VF_CORE|VF_VENDOR);
return Version("Provides support for DNS lookups", VF_CORE|VF_VENDOR);
}
};

View File

@ -36,8 +36,8 @@ CmdResult CommandAdmin::Handle(User* user, const Params& parameters)
return CMD_SUCCESS;
user->WriteRemoteNumeric(RPL_ADMINME, ServerInstance->Config->ServerName, "Administrative info");
if (!AdminName.empty())
user->WriteRemoteNumeric(RPL_ADMINLOC1, InspIRCd::Format("Name - %s", AdminName.c_str()));
user->WriteRemoteNumeric(RPL_ADMINLOC2, InspIRCd::Format("Nickname - %s", AdminNick.c_str()));
user->WriteRemoteNumeric(RPL_ADMINEMAIL, InspIRCd::Format("E-Mail - %s", AdminEmail.c_str()));
user->WriteRemoteNumeric(RPL_ADMINLOC1, InspIRCd::Format("Name: %s", AdminName.c_str()));
user->WriteRemoteNumeric(RPL_ADMINLOC2, InspIRCd::Format("Nickname: %s", AdminNick.c_str()));
user->WriteRemoteNumeric(RPL_ADMINEMAIL, InspIRCd::Format("Email: %s", AdminEmail.c_str()));
return CMD_SUCCESS;
}

View File

@ -31,14 +31,14 @@ CommandInfo::CommandInfo(Module* parent)
}
static const char* const lines[] = {
" -/\\- \2InspIRCd\2 -\\/-",
" -/\\- \002InspIRCd\002 -\\/-",
" November 2002 - Present",
" ",
"\2Core Developers\2:",
"\002Core Developers\002:",
" Attila Molnar, Attila, <attilamolnar@hush.com>",
" Peter Powell, SaberUK, <petpow@saberuk.com>",
" ",
"\2Former Developers\2:",
"\002Former Developers\002:",
" Oliver Lupton, Om, <om@inspircd.org>",
" John Brooks, Special, <special@inspircd.org>",
" Dennis Friis, peavey, <peavey@inspircd.org>",
@ -47,15 +47,15 @@ static const char* const lines[] = {
" Matt Smith, dz, <dz@inspircd.org>",
" Daniel De Graaf, danieldg, <danieldg@inspircd.org>",
" ",
"\2Founding Developers\2:",
"\002Founding Developers\002:",
" Craig Edwards, Brain, <brain@inspircd.org>",
" Craig McLure, Craig, <craig@inspircd.org>",
" Robin Burchell, w00t, <w00t@inspircd.org>",
" ",
"\2Active Contributors\2:",
"\002Active Contributors\002:",
" Adam linuxdaemon Sheogorath",
" ",
"\2Former Contributors\2:",
"\002Former Contributors\002:",
" dmb Zaba skenmy GreenReaper",
" Dan Jason satmd owine",
" Adremelech John2 jilles HiroP",
@ -67,10 +67,10 @@ static const char* const lines[] = {
" Namegduf Ankit Phoenix Taros",
" jackmcbarn ChrisTX Shawn Shutter",
" ",
"\2Thanks To\2:",
"\002Thanks To\002:",
" Asmo Brik fraggeln genius3000",
" ",
" Best experienced with: \2An IRC client\2",
" Best experienced with: \002An IRC client\002",
NULL
};

View File

@ -174,7 +174,7 @@ class CoreModInfo : public Module
Version GetVersion() override
{
return Version("Provides the ADMIN, COMMANDS, INFO, MODULES, MOTD, TIME and VERSION commands", VF_VENDOR|VF_CORE);
return Version("Provides the ADMIN, COMMANDS, INFO, MODULES, MOTD, TIME, and VERSION commands", VF_VENDOR|VF_CORE);
}
};

View File

@ -48,6 +48,7 @@ class CommandList : public Command
, secretmode(creator, "secret")
, privatemode(creator, "private")
{
allow_empty_last_param = false;
Penalty = 5;
}
@ -87,36 +88,37 @@ CmdResult CommandList::Handle(User* user, const Params& parameters)
size_t minusers = 0;
size_t maxusers = 0;
if ((parameters.size() == 1) && (!parameters[0].empty()))
for (Params::const_iterator iter = parameters.begin(); iter != parameters.end(); ++iter)
{
if (parameters[0][0] == '<')
const std::string& constraint = *iter;
if (constraint[0] == '<')
{
maxusers = ConvToNum<size_t>(parameters[0].c_str() + 1);
maxusers = ConvToNum<size_t>(constraint.c_str() + 1);
}
else if (parameters[0][0] == '>')
else if (constraint[0] == '>')
{
minusers = ConvToNum<size_t>(parameters[0].c_str() + 1);
minusers = ConvToNum<size_t>(constraint.c_str() + 1);
}
else if (!parameters[0].compare(0, 2, "C<", 2))
else if (!constraint.compare(0, 2, "C<", 2) || !constraint.compare(0, 2, "c<", 2))
{
mincreationtime = ParseMinutes(parameters[0]);
mincreationtime = ParseMinutes(constraint);
}
else if (!parameters[0].compare(0, 2, "C>", 2))
else if (!constraint.compare(0, 2, "C>", 2) || !constraint.compare(0, 2, "c>", 2))
{
maxcreationtime = ParseMinutes(parameters[0]);
maxcreationtime = ParseMinutes(constraint);
}
else if (!parameters[0].compare(0, 2, "T<", 2))
else if (!constraint.compare(0, 2, "T<", 2) || !constraint.compare(0, 2, "t<", 2))
{
mintopictime = ParseMinutes(parameters[0]);
mintopictime = ParseMinutes(constraint);
}
else if (!parameters[0].compare(0, 2, "T>", 2))
else if (!constraint.compare(0, 2, "T>", 2) || !constraint.compare(0, 2, "t>", 2))
{
maxtopictime = ParseMinutes(parameters[0]);
maxtopictime = ParseMinutes(constraint);
}
else
{
// If the glob is prefixed with ! it is inverted.
match = parameters[0].c_str();
match = constraint.c_str();
if (match[0] == '!')
{
match_inverted = true;

View File

@ -166,7 +166,7 @@ class ModuleLusers : public Module
Version GetVersion() override
{
return Version("LUSERS", VF_VENDOR | VF_CORE);
return Version("Provides the LUSERS command", VF_VENDOR | VF_CORE);
}
};

View File

@ -138,8 +138,6 @@ class CommandMessage : public Command
{
private:
const MessageType msgtype;
ChanModeReference moderatedmode;
ChanModeReference noextmsgmode;
CmdResult HandleChannelTarget(User* source, const Params& parameters, const char* target, PrefixMode* pm)
{
@ -151,32 +149,6 @@ class CommandMessage : public Command
return CMD_FAILURE;
}
if (IS_LOCAL(source))
{
if (chan->IsModeSet(noextmsgmode) && !chan->HasUser(source))
{
// The noextmsg mode is set and the source is not in the channel.
source->WriteNumeric(ERR_CANNOTSENDTOCHAN, chan->name, "Cannot send to channel (no external messages)");
return CMD_FAILURE;
}
bool no_chan_priv = chan->GetPrefixValue(source) < VOICE_VALUE;
if (no_chan_priv && chan->IsModeSet(moderatedmode))
{
// The moderated mode is set and the source has no status rank.
source->WriteNumeric(ERR_CANNOTSENDTOCHAN, chan->name, "Cannot send to channel (+m)");
return CMD_FAILURE;
}
if (no_chan_priv && ServerInstance->Config->RestrictBannedUsers != ServerConfig::BUT_NORMAL && chan->IsBanned(source))
{
// The source is banned in the channel and restrictbannedusers is enabled.
if (ServerInstance->Config->RestrictBannedUsers == ServerConfig::BUT_RESTRICT_NOTIFY)
source->WriteNumeric(ERR_CANNOTSENDTOCHAN, chan->name, "Cannot send to channel (you're banned)");
return CMD_FAILURE;
}
}
// Fire the pre-message events.
MessageTarget msgtarget(chan, pm ? pm->GetPrefix() : 0);
MessageDetailsImpl msgdetails(msgtype, parameters[1], parameters.GetTags());
@ -300,8 +272,6 @@ class CommandMessage : public Command
CommandMessage(Module* parent, MessageType mt)
: Command(parent, ClientProtocol::Messages::Privmsg::CommandStrFromMsgType(mt), 2, 2)
, msgtype(mt)
, moderatedmode(parent, "moderated")
, noextmsgmode(parent, "noextmsg")
{
syntax = "<target>[,<target>]+ :<message>";
}
@ -413,15 +383,51 @@ class ModuleCoreMessage : public Module
CommandMessage cmdprivmsg;
CommandMessage cmdnotice;
CommandSQuery cmdsquery;
ChanModeReference moderatedmode;
ChanModeReference noextmsgmode;
public:
ModuleCoreMessage()
: cmdprivmsg(this, MSG_PRIVMSG)
, cmdnotice(this, MSG_NOTICE)
, cmdsquery(this)
, moderatedmode(this, "moderated")
, noextmsgmode(this, "noextmsg")
{
}
ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) override
{
if (!IS_LOCAL(user) || target.type != MessageTarget::TYPE_CHANNEL)
return MOD_RES_PASSTHRU;
Channel* chan = target.Get<Channel>();
if (chan->IsModeSet(noextmsgmode) && !chan->HasUser(user))
{
// The noextmsg mode is set and the user is not in the channel.
user->WriteNumeric(ERR_CANNOTSENDTOCHAN, chan->name, "Cannot send to channel (no external messages)");
return MOD_RES_DENY;
}
bool no_chan_priv = chan->GetPrefixValue(user) < VOICE_VALUE;
if (no_chan_priv && chan->IsModeSet(moderatedmode))
{
// The moderated mode is set and the user has no status rank.
user->WriteNumeric(ERR_CANNOTSENDTOCHAN, chan->name, "Cannot send to channel (+m is set)");
return MOD_RES_DENY;
}
if (no_chan_priv && ServerInstance->Config->RestrictBannedUsers != ServerConfig::BUT_NORMAL && chan->IsBanned(user))
{
// The user is banned in the channel and restrictbannedusers is enabled.
if (ServerInstance->Config->RestrictBannedUsers == ServerConfig::BUT_RESTRICT_NOTIFY)
user->WriteNumeric(ERR_CANNOTSENDTOCHAN, chan->name, "Cannot send to channel (you're banned)");
return MOD_RES_DENY;
}
return MOD_RES_PASSTHRU;
}
Version GetVersion() override
{
return Version("Provides the NOTICE, PRIVMSG, and SQUERY commands", VF_CORE|VF_VENDOR);

View File

@ -19,8 +19,42 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "inspircd.h"
#include "core_user.h"
class CommandMode : public Command
{
unsigned int sent[256];
unsigned int seq;
/** Show the list of one or more list modes to a user.
* @param user User to send to.
* @param chan Channel whose lists to show.
* @param mode_sequence Mode letters to show the lists of.
*/
void DisplayListModes(User* user, Channel* chan, const std::string& mode_sequence);
/** Show the current modes of a channel or a user to a user.
* @param user User to show the modes to.
* @param targetuser User whose modes to show. NULL if showing the modes of a channel.
* @param targetchannel Channel whose modes to show. NULL if showing the modes of a user.
*/
void DisplayCurrentModes(User* user, User* targetuser, Channel* targetchannel);
public:
/** Constructor for mode.
*/
CommandMode(Module* parent);
/** Handle command.
* @param parameters The parameters to the command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
CmdResult Handle(User* user, const Params& parameters) override;
RouteDescriptor GetRouting(User* user, const Params& parameters) override;
};
CommandMode::CommandMode(Module* parent)
: Command(parent, "MODE", 1)
@ -221,3 +255,22 @@ void CommandMode::DisplayCurrentModes(User* user, User* targetuser, Channel* tar
}
}
}
class CoreModMode : public Module
{
private:
CommandMode cmdmode;
public:
CoreModMode()
: cmdmode(this)
{
}
Version GetVersion() override
{
return Version("Provides the MODE command", VF_VENDOR|VF_CORE);
}
};
MODULE_INIT(CoreModMode)

View File

@ -66,7 +66,7 @@ CmdResult CommandDie::Handle(User* user, const Params& parameters)
else
{
ServerInstance->Logs.Log(MODNAME, LOG_SPARSE, "Failed /DIE command from %s", user->GetFullRealHost().c_str());
ServerInstance->SNO.WriteGlobalSno('a', "Failed DIE Command from %s.", user->GetFullRealHost().c_str());
ServerInstance->SNO.WriteGlobalSno('a', "Failed DIE command from %s.", user->GetFullRealHost().c_str());
return CMD_FAILURE;
}
return CMD_SUCCESS;

View File

@ -19,26 +19,7 @@
#include "inspircd.h"
/** Handle /ISON.
*/
class CommandIson : public SplitCommand
{
public:
/** Constructor for ison.
*/
CommandIson(Module* parent)
: SplitCommand(parent, "ISON", 1)
{
syntax = "<nick> [<nick>]+";
}
/** Handle command.
* @param parameters The parameters to the command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
CmdResult HandleLocal(LocalUser* user, const Params& parameters) override;
};
#include "core_user.h"
class IsonReplyBuilder : public Numeric::Builder<' ', true>
{
@ -76,22 +57,3 @@ CmdResult CommandIson::HandleLocal(LocalUser* user, const Params& parameters)
reply.Flush();
return CMD_SUCCESS;
}
class CoreModIson : public Module
{
private:
CommandIson cmd;
public:
CoreModIson()
: cmd(this)
{
}
Version GetVersion() override
{
return Version("Provides the ISON command", VF_CORE | VF_VENDOR);
}
};
MODULE_INIT(CoreModIson)

View File

@ -19,29 +19,7 @@
#include "inspircd.h"
/** Handle /USERHOST.
*/
class CommandUserhost : public Command
{
UserModeReference hideopermode;
public:
/** Constructor for userhost.
*/
CommandUserhost(Module* parent)
: Command(parent,"USERHOST", 1)
, hideopermode(parent, "hideoper")
{
syntax = "<nick> [<nick>]+";
}
/** Handle command.
* @param parameters The parameters to the command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
CmdResult Handle(User* user, const Params& parameters) override;
};
#include "core_user.h"
CmdResult CommandUserhost::Handle(User* user, const Params& parameters)
{
@ -81,22 +59,3 @@ CmdResult CommandUserhost::Handle(User* user, const Params& parameters)
return CMD_SUCCESS;
}
class CoreModUserhost : public Module
{
private:
CommandUserhost cmd;
public:
CoreModUserhost()
: cmd(this)
{
}
Version GetVersion() override
{
return Version("Provides the USERHOST command", VF_CORE | VF_VENDOR);
}
};
MODULE_INIT(CoreModUserhost)

View File

@ -140,7 +140,6 @@ void MessageWrapper::ReadConfig(const char* prefixname, const char* suffixname,
class CoreModUser : public Module
{
CommandAway cmdaway;
CommandMode cmdmode;
CommandNick cmdnick;
CommandPart cmdpart;
CommandPass cmdpass;
@ -148,6 +147,8 @@ class CoreModUser : public Module
CommandPong cmdpong;
CommandQuit cmdquit;
CommandUser cmduser;
CommandIson cmdison;
CommandUserhost cmduserhost;
SimpleUserModeHandler invisiblemode;
ModeUserOperator operatormode;
ModeUserServerNoticeMask snomaskmode;
@ -155,7 +156,6 @@ class CoreModUser : public Module
public:
CoreModUser()
: cmdaway(this)
, cmdmode(this)
, cmdnick(this)
, cmdpart(this)
, cmdpass(this)
@ -163,6 +163,8 @@ class CoreModUser : public Module
, cmdpong(this)
, cmdquit(this)
, cmduser(this)
, cmdison(this)
, cmduserhost(this)
, invisiblemode(this, "invisible", 'i')
, operatormode(this)
, snomaskmode(this)
@ -177,7 +179,7 @@ class CoreModUser : public Module
Version GetVersion() override
{
return Version("Provides the AWAY, MODE, NICK, PART, PASS, PING, PONG, QUIT and USER commands", VF_VENDOR|VF_CORE);
return Version("Provides the AWAY, ISON, NICK, PART, PASS, PING, PONG, QUIT, USERHOST, and USER commands", VF_VENDOR|VF_CORE);
}
};

View File

@ -70,40 +70,28 @@ class CommandAway : public Command
RouteDescriptor GetRouting(User* user, const Params& parameters) override;
};
class CommandMode : public Command
/** Handle /ISON.
*/
class CommandIson : public SplitCommand
{
unsigned int sent[256];
unsigned int seq;
/** Show the list of one or more list modes to a user.
* @param user User to send to.
* @param chan Channel whose lists to show.
* @param mode_sequence Mode letters to show the lists of.
*/
void DisplayListModes(User* user, Channel* chan, const std::string& mode_sequence);
/** Show the current modes of a channel or a user to a user.
* @param user User to show the modes to.
* @param targetuser User whose modes to show. NULL if showing the modes of a channel.
* @param targetchannel Channel whose modes to show. NULL if showing the modes of a user.
*/
void DisplayCurrentModes(User* user, User* targetuser, Channel* targetchannel);
public:
/** Constructor for mode.
/** Constructor for ison.
*/
CommandMode(Module* parent);
CommandIson(Module* parent)
: SplitCommand(parent, "ISON", 1)
{
allow_empty_last_param = false;
syntax = "<nick> [<nick>]+";
}
/** Handle command.
* @param parameters The parameters to the command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
CmdResult Handle(User* user, const Params& parameters) override;
RouteDescriptor GetRouting(User* user, const Params& parameters) override;
CmdResult HandleLocal(LocalUser* user, const Params& parameters) override;
};
/** Handle /NICK.
*/
class CommandNick : public SplitCommand
@ -191,6 +179,30 @@ class CommandUser : public SplitCommand
static CmdResult CheckRegister(LocalUser* user);
};
/** Handle /USERHOST.
*/
class CommandUserhost : public Command
{
UserModeReference hideopermode;
public:
/** Constructor for userhost.
*/
CommandUserhost(Module* parent)
: Command(parent,"USERHOST", 1)
, hideopermode(parent, "hideoper")
{
allow_empty_last_param = false;
syntax = "<nick> [<nick>]+";
}
/** Handle command.
* @param parameters The parameters to the command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
CmdResult Handle(User* user, const Params& parameters) override;
};
/** User mode +s
*/
class ModeUserServerNoticeMask : public ModeHandler

View File

@ -100,7 +100,7 @@ std::string ModeUserServerNoticeMask::ProcessNoticeMasks(User* user, const std::
{
if (!ServerInstance->SNO.IsSnomaskUsable(*i))
{
user->WriteNumeric(ERR_UNKNOWNSNOMASK, *i, "is unknown snomask char to me");
user->WriteNumeric(ERR_UNKNOWNSNOMASK, *i, "is an unknown snomask character");
continue;
}
}

View File

@ -88,7 +88,7 @@ class CommandWhois : public SplitCommand
void SendChanList(WhoisContextImpl& whois);
public:
/** If true then all opers are shown with a generic 'is an IRC operator' line rather than the oper type. */
/** If true then all opers are shown with a generic 'is a server operator' line rather than the oper type. */
bool genericoper;
/** How to handle private/secret channels in the WHOIS response. */
@ -242,7 +242,7 @@ void CommandWhois::DoWhois(LocalUser* user, User* dest, time_t signon, unsigned
if (dest->IsOper())
{
if (genericoper)
whois.SendLine(RPL_WHOISOPERATOR, "is an IRC operator");
whois.SendLine(RPL_WHOISOPERATOR, "is a server operator");
else
whois.SendLine(RPL_WHOISOPERATOR, InspIRCd::Format("is %s %s on %s", (strchr("AEIOUaeiou",dest->oper->name[0]) ? "an" : "a"), dest->oper->name.c_str(), ServerInstance->Config->Network.c_str()));
}

View File

@ -303,7 +303,7 @@ class ModuleWhoWas : public Module, public Stats::EventListener
Version GetVersion() override
{
return Version("WHOWAS", VF_VENDOR);
return Version("Provides the WHOWAS command", VF_VENDOR);
}
};

View File

@ -94,7 +94,7 @@ CmdResult CommandEline::Handle(User* user, const Params& parameters)
}
else
{
user->WriteNotice("*** E-line " + target + " not found in list, try /stats e.");
user->WriteNotice("*** E-line " + target + " not found on the list.");
}
}

View File

@ -103,7 +103,7 @@ CmdResult CommandGline::Handle(User* user, const Params& parameters)
}
else
{
user->WriteNotice("*** G-line " + target + " not found in list, try /stats g.");
user->WriteNotice("*** G-line " + target + " not found on the list.");
}
}

View File

@ -102,7 +102,7 @@ CmdResult CommandKline::Handle(User* user, const Params& parameters)
}
else
{
user->WriteNotice("*** K-line " + target + " not found in list, try /stats k.");
user->WriteNotice("*** K-line " + target + " not found on the list.");
}
}

View File

@ -81,7 +81,7 @@ CmdResult CommandQline::Handle(User* user, const Params& parameters)
}
else
{
user->WriteNotice("*** Q-line " + parameters[0] + " not found in list, try /stats q.");
user->WriteNotice("*** Q-line " + parameters[0] + " not found on the list.");
return CMD_FAILURE;
}
}

View File

@ -99,7 +99,7 @@ CmdResult CommandZline::Handle(User* user, const Params& parameters)
}
else
{
user->WriteNotice("*** Z-line " + target + " not found in list, try /stats Z.");
user->WriteNotice("*** Z-line " + target + " not found on the list.");
return CMD_FAILURE;
}
}

View File

@ -38,7 +38,7 @@ bool InsaneBan::MatchesEveryone(const std::string& mask, MatcherBase& test, User
float percent = ((float)matches / (float)ServerInstance->Users.GetUsers().size()) * 100;
if (percent > itrigger)
{
ServerInstance->SNO.WriteToSnoMask('a', "\2WARNING\2: %s tried to set a %s-line mask of %s, which covers %.2f%% of the network!", user->nick.c_str(), bantype, mask.c_str(), percent);
ServerInstance->SNO.WriteToSnoMask('a', "\002WARNING\002: %s tried to set a %s-line mask of %s, which covers %.2f%% of the network!", user->nick.c_str(), bantype, mask.c_str(), percent);
return true;
}
return false;

View File

@ -48,9 +48,9 @@ BufferedSocket::BufferedSocket(int newfd)
SocketEngine::AddFd(this, FD_WANT_FAST_READ | FD_WANT_EDGE_WRITE);
}
void BufferedSocket::DoConnect(const std::string& ipaddr, int aport, unsigned int maxtime, const std::string& connectbindip)
void BufferedSocket::DoConnect(const irc::sockets::sockaddrs& dest, const irc::sockets::sockaddrs& bind, unsigned int maxtime)
{
BufferedSocketError err = BeginConnect(ipaddr, aport, maxtime, connectbindip);
BufferedSocketError err = BeginConnect(dest, bind, maxtime);
if (err != I_ERR_NONE)
{
state = I_ERROR;
@ -59,27 +59,6 @@ void BufferedSocket::DoConnect(const std::string& ipaddr, int aport, unsigned in
}
}
BufferedSocketError BufferedSocket::BeginConnect(const std::string& ipaddr, int aport, unsigned int maxtime, const std::string& connectbindip)
{
irc::sockets::sockaddrs addr, bind;
if (!irc::sockets::aptosa(ipaddr, aport, addr))
{
ServerInstance->Logs.Log("SOCKET", LOG_DEBUG, "BUG: Hostname passed to BufferedSocket, rather than an IP address!");
return I_ERR_CONNECT;
}
bind.sa.sa_family = 0;
if (!connectbindip.empty())
{
if (!irc::sockets::aptosa(connectbindip, 0, bind))
{
return I_ERR_BIND;
}
}
return BeginConnect(addr, bind, maxtime);
}
BufferedSocketError BufferedSocket::BeginConnect(const irc::sockets::sockaddrs& dest, const irc::sockets::sockaddrs& bind, unsigned int timeout)
{
if (fd < 0)

View File

@ -64,6 +64,7 @@ void ListModeBase::DoRehash()
{
ConfigTagList tags = ServerInstance->Config->ConfTags("maxlist");
limitlist newlimits;
bool seen_default = false;
for (ConfigIter i = tags.first; i != tags.second; i++)
{
ConfigTag* c = i->second;
@ -72,20 +73,24 @@ void ListModeBase::DoRehash()
if (!mname.empty() && !stdalgo::string::equalsci(mname, name) && !(mname.length() == 1 && GetModeChar() == mname[0]))
continue;
ListLimit limit(c->getString("chan", "*"), c->getUInt("limit", 0));
ListLimit limit(c->getString("chan", "*", 1), c->getUInt("limit", DEFAULT_LIST_SIZE));
if (limit.mask.empty())
throw ModuleException(InspIRCd::Format("<maxlist:chan> is empty, at %s", c->getTagLocation().c_str()));
if (limit.limit <= 0)
throw ModuleException(InspIRCd::Format("<maxlist:limit> must be non-zero, at %s", c->getTagLocation().c_str()));
if (limit.mask == "*" || limit.mask == "#*")
seen_default = true;
newlimits.push_back(limit);
}
// Add the default entry. This is inserted last so if the user specifies a
// wildcard record in the config it will take precedence over this entry.
newlimits.push_back(ListLimit("*", DEFAULT_LIST_SIZE));
// If no default limit has been specified then insert one.
if (!seen_default)
{
ServerInstance->Logs.Log("MODE", LOG_DEBUG, "No default <maxlist> entry was found for the %s mode; defaulting to %u",
name.c_str(), DEFAULT_LIST_SIZE);
newlimits.push_back(ListLimit("*", DEFAULT_LIST_SIZE));
}
// Most of the time our settings are unchanged, so we can avoid iterating the chanlist
if (chanlimits == newlimits)
@ -112,7 +117,7 @@ unsigned int ListModeBase::FindLimit(const std::string& channame)
return it->limit;
}
}
return DEFAULT_LIST_SIZE;
return 0;
}
unsigned int ListModeBase::GetLimitInternal(const std::string& channame, ChanData* cd)
@ -133,13 +138,16 @@ unsigned int ListModeBase::GetLimit(Channel* channel)
unsigned int ListModeBase::GetLowerLimit()
{
if (chanlimits.empty())
return DEFAULT_LIST_SIZE;
unsigned int limit = UINT_MAX;
for (limitlist::iterator iter = chanlimits.begin(); iter != chanlimits.end(); ++iter)
{
if (iter->limit < limit)
limit = iter->limit;
}
return limit == UINT_MAX ? DEFAULT_LIST_SIZE : limit;
return limit;
}
ModeAction ListModeBase::OnModeChange(User* source, User*, Channel* channel, std::string &parameter, bool adding)

View File

@ -371,7 +371,7 @@ void ModeParser::ModeParamsToChangeList(User* user, ModeType type, const std::ve
if (!mh)
{
/* No mode handler? Unknown mode character then. */
user->WriteNumeric(type == MODETYPE_CHANNEL ? ERR_UNKNOWNMODE : ERR_UNKNOWNSNOMASK, modechar, "is unknown mode char to me");
user->WriteNumeric(type == MODETYPE_CHANNEL ? ERR_UNKNOWNMODE : ERR_UNKNOWNSNOMASK, modechar, "is an unknown mode character");
continue;
}

View File

@ -24,9 +24,9 @@
*/
#include <iostream>
#include "inspircd.h"
#include "exitcodes.h"
#include <iostream>
#ifndef _WIN32
#include <dirent.h>
@ -102,6 +102,7 @@ void Module::OnBackgroundTimer(time_t) { DetachEvent(I_OnBackgroundTimer); }
ModResult Module::OnPreCommand(std::string&, CommandBase::Params&, LocalUser*, bool) { DetachEvent(I_OnPreCommand); return MOD_RES_PASSTHRU; }
void Module::OnPostCommand(Command*, const CommandBase::Params&, LocalUser*, CmdResult, bool) { DetachEvent(I_OnPostCommand); }
void Module::OnUserInit(LocalUser*) { DetachEvent(I_OnUserInit); }
void Module::OnUserPostInit(LocalUser*) { DetachEvent(I_OnUserPostInit); }
ModResult Module::OnCheckReady(LocalUser*) { DetachEvent(I_OnCheckReady); return MOD_RES_PASSTHRU; }
ModResult Module::OnUserRegister(LocalUser*) { DetachEvent(I_OnUserRegister); return MOD_RES_PASSTHRU; }
ModResult Module::OnUserPreKick(User*, Membership*, const std::string&) { DetachEvent(I_OnUserPreKick); return MOD_RES_PASSTHRU; }
@ -136,7 +137,6 @@ void Module::OnBuildNeighborList(User*, IncludeChanList&, std::map<User*,bool>&
void Module::OnGarbageCollect() { DetachEvent(I_OnGarbageCollect); }
ModResult Module::OnSetConnectClass(LocalUser* user, ConnectClass* myclass) { DetachEvent(I_OnSetConnectClass); return MOD_RES_PASSTHRU; }
void Module::OnUserMessage(User*, const MessageTarget&, const MessageDetails&) { DetachEvent(I_OnUserMessage); }
ModResult Module::OnNamesListItem(User*, Membership*, std::string&, std::string&) { DetachEvent(I_OnNamesListItem); return MOD_RES_PASSTHRU; }
ModResult Module::OnNumeric(User*, const Numeric::Numeric&) { DetachEvent(I_OnNumeric); return MOD_RES_PASSTHRU; }
ModResult Module::OnAcceptConnection(int, ListenSocket*, irc::sockets::sockaddrs*, irc::sockets::sockaddrs*) { DetachEvent(I_OnAcceptConnection); return MOD_RES_PASSTHRU; }
void Module::OnSetUserIP(LocalUser*) { DetachEvent(I_OnSetUserIP); }

View File

@ -1,8 +1,8 @@
This directory stores modules which require external libraries to compile.
For example, m_filter_pcre requires the PCRE libraries.
For example, m_regex_pcre requires the PCRE libraries.
To compile any of these modules first ensure you have the required dependencies
(read the online documentation at https://wiki.inspircd.org) and then symlink
(read the online documentation at https://docs.inspircd.org) and then symlink
the .cpp file from this directory into the parent directory (src/modules/).
Alternatively, use the command: ./configure --enable-extras=m_extra.cpp, which will

View File

@ -0,0 +1,202 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2019 Peter Powell <petpow@saberuk.com>
*
* This file is part of InspIRCd. InspIRCd 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, version 2.
*
* 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, see <http://www.gnu.org/licenses/>.
*/
/// $CompilerFlags: find_compiler_flags("libmaxminddb" "")
/// $LinkerFlags: find_linker_flags("libmaxminddb" "-lmaxminddb")
/// $PackageInfo: require_system("darwin") libmaxminddb pkg-config
/// $PackageInfo: require_system("debian" "9.0") libmaxminddb-dev pkg-config
/// $PackageInfo: require_system("ubuntu" "16.04") libmaxminddb-dev pkg-config
#ifdef _WIN32
# pragma comment(lib, "libmaxminddb.lib")
#endif
#include "inspircd.h"
#include "modules/geolocation.h"
#include <maxminddb.h>
class GeolocationExtItem : public LocalExtItem
{
public:
GeolocationExtItem(Module* parent)
: LocalExtItem("geolocation", ExtensionItem::EXT_USER, parent)
{
}
void free(Extensible* container, void* item) override
{
Geolocation::Location* old = static_cast<Geolocation::Location*>(item);
if (old)
old->refcount_dec();
}
Geolocation::Location* get(const Extensible* item) const
{
return static_cast<Geolocation::Location*>(get_raw(item));
}
void set(Extensible* item, Geolocation::Location* value)
{
value->refcount_inc();
free(item, set_raw(item, value));
}
void unset(Extensible* container)
{
free(container, unset_raw(container));
}
};
typedef insp::flat_map<std::string, Geolocation::Location*> LocationMap;
class GeolocationAPIImpl : public Geolocation::APIBase
{
public:
GeolocationExtItem ext;
LocationMap locations;
MMDB_s mmdb;
GeolocationAPIImpl(Module* parent)
: Geolocation::APIBase(parent)
, ext(parent)
{
}
Geolocation::Location* GetLocation(User* user) override
{
// If we have the location cached then use that instead.
Geolocation::Location* location = ext.get(user);
if (location)
return location;
// Attempt to locate this user.
location = GetLocation(user->client_sa);
if (!location)
return NULL;
// We found the user. Cache their location for future use.
ext.set(user, location);
return location;
}
Geolocation::Location* GetLocation(irc::sockets::sockaddrs& sa) override
{
// Attempt to look up the socket address.
int result;
MMDB_lookup_result_s lookup = MMDB_lookup_sockaddr(&mmdb, &sa.sa, &result);
if (result != MMDB_SUCCESS || !lookup.found_entry)
return NULL;
// Attempt to retrieve the country code.
MMDB_entry_data_s country_code;
result = MMDB_get_value(&lookup.entry, &country_code, "country", "iso_code", NULL);
if (result != MMDB_SUCCESS || !country_code.has_data || country_code.type != MMDB_DATA_TYPE_UTF8_STRING || country_code.data_size != 2)
return NULL;
// If the country has been seen before then use our cached Location object.
const std::string code(country_code.utf8_string, country_code.data_size);
LocationMap::iterator liter = locations.find(code);
if (liter != locations.end())
return liter->second;
// Attempt to retrieve the country name.
MMDB_entry_data_s country_name;
result = MMDB_get_value(&lookup.entry, &country_name, "country", "names", "en", NULL);
if (result != MMDB_SUCCESS || !country_name.has_data || country_name.type != MMDB_DATA_TYPE_UTF8_STRING)
return NULL;
// Create a Location object and cache it.
const std::string cname(country_name.utf8_string, country_name.data_size);
Geolocation::Location* location = new Geolocation::Location(code, cname);
locations[code] = location;
return location;
}
};
class ModuleGeoMaxMind : public Module
{
private:
GeolocationAPIImpl geoapi;
public:
ModuleGeoMaxMind()
: geoapi(this)
{
memset(&geoapi.mmdb, 0, sizeof(geoapi.mmdb));
}
~ModuleGeoMaxMind()
{
MMDB_close(&geoapi.mmdb);
}
Version GetVersion() override
{
return Version("Provides Geolocation lookups using the libMaxMindDB library", VF_VENDOR);
}
void ReadConfig(ConfigStatus& status) override
{
ConfigTag* tag = ServerInstance->Config->ConfValue("maxmind");
const std::string file = ServerInstance->Config->Paths.PrependConfig(tag->getString("file", "GeoLite2-Country.mmdb"));
// Try to read the new database.
MMDB_s mmdb;
int result = MMDB_open(file.c_str(), MMDB_MODE_MMAP, &mmdb);
if (result != MMDB_SUCCESS)
throw ModuleException(InspIRCd::Format("Unable to load the MaxMind database (%s): %s",
file.c_str(), MMDB_strerror(result)));
// Swap the new database with the old database.
std::swap(mmdb, geoapi.mmdb);
// Free the old database.
MMDB_close(&mmdb);
}
void OnGarbageCollect() override
{
for (LocationMap::iterator iter = geoapi.locations.begin(); iter != geoapi.locations.end(); )
{
Geolocation::Location* location = iter->second;
if (location->GetUseCount())
{
ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Preserving geolocation data for %s (%s) with use count %u... ",
location->GetName().c_str(), location->GetCode().c_str(), location->GetUseCount());
iter++;
}
else
{
ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Deleting unused geolocation data for %s (%s)",
location->GetName().c_str(), location->GetCode().c_str());
delete location;
iter = geoapi.locations.erase(iter);
}
}
}
void OnSetUserIP(LocalUser* user) override
{
// Unset the extension so that the location of this user is looked
// up again next time it is requested.
geoapi.ext.unset(user);
}
};
MODULE_INIT(ModuleGeoMaxMind)

View File

@ -617,7 +617,7 @@ class ModuleLDAP : public Module
Version GetVersion() override
{
return Version("LDAP support", VF_VENDOR);
return Version("Provides LDAP support", VF_VENDOR);
}
};

View File

@ -493,7 +493,7 @@ void ModuleSQL::OnUnloadModule(Module* mod)
Version ModuleSQL::GetVersion()
{
return Version("MySQL support", VF_VENDOR);
return Version("Provides MySQL support", VF_VENDOR);
}
void DispatcherThread::Run()

View File

@ -298,6 +298,7 @@ class SQLConn : public SQL::Provider, public EventHandler
SocketEngine::ChangeEventMask(this, FD_WANT_POLL_READ | FD_WANT_NO_WRITE);
status = WWRITE;
DoConnectedPoll();
return true;
default:
return true;
}
@ -391,6 +392,7 @@ restart:
SocketEngine::ChangeEventMask(this, FD_WANT_POLL_READ | FD_WANT_NO_WRITE);
status = WWRITE;
DoConnectedPoll();
return true;
default:
return true;
}

View File

@ -257,7 +257,7 @@ class ModuleSQLite3 : public Module
Version GetVersion() override
{
return Version("sqlite3 provider", VF_VENDOR);
return Version("Provides SQLite3 support", VF_VENDOR);
}
};

View File

@ -1263,7 +1263,7 @@ class ModuleSSLGnuTLS : public Module
Version GetVersion() override
{
return Version("Provides SSL support for clients", VF_VENDOR);
return Version("Provides SSL support via GnuTLS", VF_VENDOR);
}
ModResult OnCheckReady(LocalUser* user) override

View File

@ -1002,7 +1002,7 @@ class ModuleSSLOpenSSL : public Module
Version GetVersion() override
{
return Version("Provides SSL support for clients", VF_VENDOR);
return Version("Provides SSL support via OpenSSL", VF_VENDOR);
}
};

View File

@ -35,7 +35,7 @@ class ModuleAbbreviation : public Module
Version GetVersion() override
{
return Version("Provides the ability to abbreviate commands a-la BBC BASIC keywords.",VF_VENDOR);
return Version("Provides the ability to abbreviate commands a-la BBC BASIC keywords", VF_VENDOR);
}
ModResult OnPreCommand(std::string& command, CommandBase::Params& parameters, LocalUser* user, bool validated) override

View File

@ -113,7 +113,7 @@ class ModuleAlias : public Module
Version GetVersion() override
{
return Version("Provides aliases of commands.", VF_VENDOR);
return Version("Provides aliases of commands", VF_VENDOR);
}
std::string GetVar(std::string varname, const std::string &original_line)
@ -282,8 +282,8 @@ class ModuleAlias : public Module
if ((a->ULineOnly) && (!u->server->IsULine()))
{
ServerInstance->SNO.WriteToSnoMask('a', "NOTICE -- Service "+a->RequiredNick+" required by alias "+a->AliasedCommand+" is not on a u-lined server, possibly underhanded antics detected!");
user->WriteNumeric(ERR_NOSUCHNICK, a->RequiredNick, "is an imposter! Please inform an IRC operator as soon as possible.");
ServerInstance->SNO.WriteToSnoMask('a', "NOTICE -- Service "+a->RequiredNick+" required by alias "+a->AliasedCommand+" is not on a U-lined server, possibly underhanded antics detected!");
user->WriteNumeric(ERR_NOSUCHNICK, a->RequiredNick, "is an imposter! Please inform a server operator as soon as possible.");
return 1;
}
}

View File

@ -57,7 +57,7 @@ class ModuleAllowInvite : public Module
Version GetVersion() override
{
return Version("Provides support for channel mode +A, allowing /invite freely on a channel and extban A to deny specific users it",VF_VENDOR);
return Version("Provides channel mode +A to allow /INVITE freely on a channel, and extban 'A' to deny specific users it", VF_VENDOR);
}
};

View File

@ -58,7 +58,7 @@ class Modulealltime : public Module
Version GetVersion() override
{
return Version("Display timestamps from all servers connected to the network", VF_OPTCOMMON | VF_VENDOR);
return Version("Provides the ALLTIME command, displays timestamps from all servers connected to the network", VF_OPTCOMMON | VF_VENDOR);
}
};

View File

@ -297,7 +297,7 @@ class ModuleAntiCaps : public Module
Version GetVersion() override
{
return Version("Provides support for punishing users that send capitalised messages.", VF_COMMON|VF_VENDOR);
return Version("Provides support for punishing users that send capitalised messages", VF_COMMON|VF_VENDOR);
}
};

View File

@ -22,6 +22,7 @@
#include "inspircd.h"
#include "modules/exemption.h"
#include "modules/names.h"
#include "modules/who.h"
class AuditoriumMode : public SimpleChannelModeHandler
@ -58,6 +59,7 @@ class JoinHook : public ClientProtocol::EventHook
class ModuleAuditorium
: public Module
, public Names::EventListener
, public Who::EventListener
{
CheckExemption::EventProvider exemptionprov;
@ -69,7 +71,8 @@ class ModuleAuditorium
public:
ModuleAuditorium()
: Who::EventListener(this)
: Names::EventListener(this)
, Who::EventListener(this)
, exemptionprov(this)
, aum(this)
, joinhook(this)
@ -86,7 +89,7 @@ class ModuleAuditorium
Version GetVersion() override
{
return Version("Allows for auditorium channels (+u) where nobody can see others joining and parting or the nick list", VF_VENDOR);
return Version("Provides channel mode +u, auditorium channels where nobody can see others joining and parting or the nick list", VF_VENDOR);
}
/* Can they be seen by everyone? */
@ -118,7 +121,7 @@ class ModuleAuditorium
return false;
}
ModResult OnNamesListItem(User* issuer, Membership* memb, std::string& prefixes, std::string& nick) override
ModResult OnNamesListItem(LocalUser* issuer, Membership* memb, std::string& prefixes, std::string& nick) override
{
if (IsVisible(memb))
return MOD_RES_PASSTHRU;

View File

@ -112,7 +112,7 @@ class ModuleAutoOp : public Module
Version GetVersion() override
{
return Version("Provides support for the +w channel mode", VF_VENDOR);
return Version("Provides channel mode +w, basic channel access controls", VF_VENDOR);
}
};

View File

@ -107,7 +107,7 @@ class ModuleBanException : public Module
Version GetVersion() override
{
return Version("Provides support for the +e channel mode", VF_VENDOR);
return Version("Provides channel mode +e, ban exceptions", VF_VENDOR);
}
};

View File

@ -325,13 +325,13 @@ class ModuleBanRedirect : public Module
if(destchan && destchan->IsModeSet(redirectmode) && !destlimit.empty() && (destchan->GetUserCounter() >= ConvToNum<size_t>(destlimit)))
{
user->WriteNumeric(ERR_BANNEDFROMCHAN, chan->name, "Cannot join channel (You are banned)");
user->WriteNumeric(ERR_BANNEDFROMCHAN, chan->name, "Cannot join channel (you're banned)");
return MOD_RES_DENY;
}
else
{
user->WriteNumeric(ERR_BANNEDFROMCHAN, chan->name, "Cannot join channel (You are banned)");
user->WriteNumeric(470, chan->name, redir->targetchan, "You are banned from this channel, so you are automatically transferred to the redirected channel.");
user->WriteNumeric(ERR_BANNEDFROMCHAN, chan->name, "Cannot join channel (you're banned)");
user->WriteNumeric(470, chan->name, redir->targetchan, "You are banned from this channel, so you are automatically being transferred to the redirected channel.");
nofollow = true;
Channel::JoinUser(user, redir->targetchan);
nofollow = false;

View File

@ -60,7 +60,7 @@ class ModuleBlockAmsg : public Module
Version GetVersion() override
{
return Version("Attempt to block /amsg, at least some of the irritating mIRC scripts.",VF_VENDOR);
return Version("Attempt to block /amsg or /ame, at least some of the irritating client scripts", VF_VENDOR);
}
void ReadConfig(ConfigStatus& status) override
@ -120,12 +120,12 @@ class ModuleBlockAmsg : public Module
{
// Block it...
if (action == IBLOCK_KILLOPERS || action == IBLOCK_NOTICEOPERS)
ServerInstance->SNO.WriteToSnoMask('a', "%s had an /amsg or /ame denied", user->nick.c_str());
ServerInstance->SNO.WriteToSnoMask('a', "%s had an /amsg or /ame blocked", user->nick.c_str());
if (action == IBLOCK_KILL || action == IBLOCK_KILLOPERS)
ServerInstance->Users.QuitUser(user, "Attempted to global message (/amsg or /ame)");
else if (action == IBLOCK_NOTICE || action == IBLOCK_NOTICEOPERS)
user->WriteNotice("Global message (/amsg or /ame) denied");
user->WriteNotice("Global message (/amsg or /ame) blocked");
return MOD_RES_DENY;
}

View File

@ -58,7 +58,7 @@ class ModuleBlockColor : public Module
// Block all control codes except \001 for CTCP
if ((*i >= 0) && (*i < 32) && (*i != 1))
{
user->WriteNumeric(ERR_CANNOTSENDTOCHAN, c->name, "Can't send colors to channel (+c set)");
user->WriteNumeric(ERR_CANNOTSENDTOCHAN, c->name, "Can't send colors to channel (+c is set)");
return MOD_RES_DENY;
}
}

View File

@ -22,6 +22,7 @@
#include "inspircd.h"
#include "modules/callerid.h"
#include "modules/ctctags.h"
enum
{
@ -345,7 +346,9 @@ class CallerIDAPIImpl : public CallerID::APIBase
};
class ModuleCallerID : public Module
class ModuleCallerID
: public Module
, public CTCTags::EventListener
{
CommandAccept cmd;
CallerIDAPIImpl api;
@ -380,7 +383,8 @@ class ModuleCallerID : public Module
public:
ModuleCallerID()
: cmd(this)
: CTCTags::EventListener(this)
, cmd(this)
, api(this, cmd.extInfo)
, myumode(this, "callerid", 'g')
{
@ -388,7 +392,7 @@ public:
Version GetVersion() override
{
return Version("Implementation of callerid, usermode +g, /accept", VF_COMMON | VF_VENDOR);
return Version("Implementation of callerid, provides user mode +g and the ACCEPT command", VF_COMMON | VF_VENDOR);
}
void On005Numeric(std::map<std::string, std::string>& tokens) override
@ -397,7 +401,7 @@ public:
tokens["CALLERID"] = ConvToStr(myumode.GetModeChar());
}
ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) override
ModResult HandleMessage(User* user, const MessageTarget& target)
{
if (!IS_LOCAL(user) || target.type != MessageTarget::TYPE_USER)
return MOD_RES_PASSTHRU;
@ -406,7 +410,7 @@ public:
if (!dest->IsModeSet(myumode) || (user == dest))
return MOD_RES_PASSTHRU;
if (user->HasPrivPermission("users/callerid-override"))
if (user->HasPrivPermission("users/ignore-callerid"))
return MOD_RES_PASSTHRU;
callerid_data* dat = cmd.extInfo.get(dest, true);
@ -418,7 +422,7 @@ public:
if (now > (dat->lastnotify + (time_t)notify_cooldown))
{
user->WriteNumeric(RPL_TARGNOTIFY, dest->nick, "has been informed that you messaged them.");
dest->WriteRemoteNumeric(RPL_UMODEGMSG, user->nick, InspIRCd::Format("%s@%s", user->ident.c_str(), user->GetDisplayedHost().c_str()), InspIRCd::Format("is messaging you, and you have umode +g. Use /ACCEPT +%s to allow.",
dest->WriteRemoteNumeric(RPL_UMODEGMSG, user->nick, InspIRCd::Format("%s@%s", user->ident.c_str(), user->GetDisplayedHost().c_str()), InspIRCd::Format("is messaging you, and you have user mode +g set. Use /ACCEPT +%s to allow.",
user->nick.c_str()));
dat->lastnotify = now;
}
@ -427,6 +431,16 @@ public:
return MOD_RES_PASSTHRU;
}
ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) override
{
return HandleMessage(user, target);
}
ModResult OnUserPreTagMessage(User* user, const MessageTarget& target, CTCTags::TagMessageDetails& details) override
{
return HandleMessage(user, target);
}
void OnUserPostNick(User* user, const std::string& oldnick) override
{
if (!tracknick)

View File

@ -407,13 +407,21 @@ class CommandCap : public SplitCommand
}
else if ((subcommand == "LS") || (subcommand == "LIST"))
{
Cap::Protocol capversion = Cap::CAP_LEGACY;
const bool is_ls = (subcommand.length() == 2);
if ((is_ls) && (parameters.size() > 1) && (parameters[1] == "302"))
manager.Set302Protocol(user);
if ((is_ls) && (parameters.size() > 1))
{
unsigned int version = ConvToNum<unsigned int>(parameters[1]);
if (version >= 302)
{
capversion = Cap::CAP_302;
manager.Set302Protocol(user);
}
}
std::string result;
// Show values only if supports v3.2 and doing LS
manager.HandleList(result, user, is_ls, ((is_ls) && (manager.GetProtocol(user) != Cap::CAP_LEGACY)));
manager.HandleList(result, user, is_ls, ((is_ls) && (capversion != Cap::CAP_LEGACY)));
DisplayResult(user, subcommand, result);
}
else if ((subcommand == "CLEAR") && (manager.GetProtocol(user) == Cap::CAP_LEGACY))

View File

@ -106,7 +106,7 @@ class CommandCBan : public Command
}
else
{
user->WriteNotice("*** CBan " + parameters[0] + " not found in list, try /stats C.");
user->WriteNotice("*** CBan " + parameters[0] + " not found on the list.");
return CMD_FAILURE;
}
}
@ -204,7 +204,7 @@ class ModuleCBan : public Module, public Stats::EventListener
Version GetVersion() override
{
return Version("Gives /cban, aka C-lines. Think Q-lines, for channels.", VF_COMMON | VF_VENDOR);
return Version("Provides the CBAN command, like Q-lines, but for channels", VF_COMMON | VF_VENDOR);
}
};

View File

@ -122,7 +122,7 @@ class ModuleCensor : public Module
Version GetVersion() override
{
return Version("Provides user and channel +G mode",VF_VENDOR);
return Version("Provides user and channel mode +G", VF_VENDOR);
}
};

View File

@ -31,7 +31,7 @@ class ModuleChanCreate : public Module
Version GetVersion() override
{
return Version("Provides snomasks 'j' and 'J', to which notices about newly created channels are sent",VF_VENDOR);
return Version("Provides snomasks 'j' and 'J', to which notices about newly created channels are sent", VF_VENDOR);
}
void OnUserJoin(Membership* memb, bool sync, bool created, CUList& except) override

View File

@ -207,7 +207,7 @@ class ModuleChanHistory
Version GetVersion() override
{
return Version("Provides channel history replayed on join", VF_VENDOR);
return Version("Provides channel mode +H, allows for the channel message history to be replayed on join", VF_VENDOR);
}
};

View File

@ -62,7 +62,7 @@ class ModuleChanLog : public Module
if (itpair.first == itpair.second)
return MOD_RES_PASSTHRU;
const std::string snotice = "\2" + desc + "\2: " + msg;
const std::string snotice = "\002" + desc + "\002: " + msg;
for (ChanLogTargets::const_iterator it = itpair.first; it != itpair.second; ++it)
{
@ -80,7 +80,7 @@ class ModuleChanLog : public Module
Version GetVersion() override
{
return Version("Logs snomask output to channel(s).", VF_VENDOR);
return Version("Logs snomask output to channel(s)", VF_VENDOR);
}
};

View File

@ -25,7 +25,7 @@ class ModuleBadChannelExtban : public Module
public:
Version GetVersion() override
{
return Version("Extban 'j' - channel status/join ban", VF_OPTCOMMON|VF_VENDOR);
return Version("Provides extban 'j', ban users that are present in another channel, and optionally on their status there", VF_OPTCOMMON|VF_VENDOR);
}
ModResult OnCheckBan(User *user, Channel *c, const std::string& mask) override

View File

@ -322,7 +322,7 @@ class ModuleCheck : public Module
Version GetVersion() override
{
return Version("CHECK command, view user, channel, IP address or hostname information", VF_VENDOR|VF_OPTCOMMON);
return Version("Provides the CHECK command to view user, channel, IP address or hostname information", VF_VENDOR|VF_OPTCOMMON);
}
};

View File

@ -103,7 +103,7 @@ class ModuleChgHost : public Module
Version GetVersion() override
{
return Version("Provides support for the CHGHOST command", VF_OPTCOMMON | VF_VENDOR);
return Version("Provides the CHGHOST command", VF_OPTCOMMON | VF_VENDOR);
}
};

View File

@ -85,7 +85,7 @@ public:
Version GetVersion() override
{
return Version("Provides support for the CHGIDENT command", VF_OPTCOMMON | VF_VENDOR);
return Version("Provides the CHGIDENT command", VF_OPTCOMMON | VF_VENDOR);
}
};

View File

@ -81,7 +81,7 @@ public:
Version GetVersion() override
{
return Version("Provides support for the CHGNAME command", VF_OPTCOMMON | VF_VENDOR);
return Version("Provides the CHGNAME command", VF_OPTCOMMON | VF_VENDOR);
}
};

View File

@ -40,7 +40,7 @@ class ModuleClassBan : public Module
Version GetVersion() override
{
return Version("Class 'n' - Connection class ban", VF_VENDOR | VF_OPTCOMMON);
return Version("Provides extban 'n', connection class bans", VF_VENDOR | VF_OPTCOMMON);
}
};

View File

@ -211,7 +211,7 @@ class ModuleClearChan : public Module
Version GetVersion() override
{
return Version("Adds /CLEARCHAN that allows opers to masskick, masskill or mass G/Z-line users on a channel.", VF_VENDOR|VF_OPTCOMMON);
return Version("Provides the CLEARCHAN command that allows opers to masskick, masskill or mass G/Z-line users on a channel", VF_VENDOR|VF_OPTCOMMON);
}
};

View File

@ -96,7 +96,7 @@ class ModuleClones : public Module
Version GetVersion() override
{
return Version("Provides the /CLONES command to retrieve information on clones.", VF_VENDOR);
return Version("Provides the CLONES command to retrieve information on clones", VF_VENDOR);
}
};

View File

@ -1,6 +1,7 @@
/*
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2019 Peter Powell <petpow@saberuk.com>
* Copyright (C) 2007 Craig Edwards <craigedwards@brainbox.cc>
*
* This file is part of InspIRCd. InspIRCd is free software: you can
@ -18,34 +19,52 @@
#include "inspircd.h"
#include "modules/ctctags.h"
class ModulePrivacyMode : public Module
class ModuleCommonChans
: public CTCTags::EventListener
, public Module
{
SimpleUserModeHandler pm;
private:
SimpleUserModeHandler mode;
ModResult HandleMessage(User* user, const MessageTarget& target)
{
if (target.type != MessageTarget::TYPE_USER)
return MOD_RES_PASSTHRU;
User* targuser = target.Get<User>();
if (!targuser->IsModeSet(mode) || user->SharesChannelWith(targuser))
return MOD_RES_PASSTHRU;
if (user->HasPrivPermission("users/ignore-commonchans") || user->server->IsULine())
return MOD_RES_PASSTHRU;
user->WriteNumeric(ERR_CANTSENDTOUSER, targuser->nick, "You are not permitted to send private messages to this user (+c is set)");
return MOD_RES_DENY;
}
public:
ModulePrivacyMode()
: pm(this, "deaf_commonchan", 'c')
ModuleCommonChans()
: CTCTags::EventListener(this)
, mode(this, "deaf_commonchan", 'c')
{
}
Version GetVersion() override
{
return Version("Adds user mode +c, which if set, users must be on a common channel with you to private message you", VF_VENDOR);
return Version("Provides user mode +c, requires users to share a common channel with you to private message you", VF_VENDOR);
}
ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) override
{
if (target.type == MessageTarget::TYPE_USER)
{
User* t = target.Get<User>();
if (!user->IsOper() && (t->IsModeSet(pm)) && (!user->server->IsULine()) && !user->SharesChannelWith(t))
{
user->WriteNumeric(ERR_CANTSENDTOUSER, t->nick, "You are not permitted to send private messages to this user (+c set)");
return MOD_RES_DENY;
}
}
return MOD_RES_PASSTHRU;
return HandleMessage(user, target);
}
ModResult OnUserPreTagMessage(User* user, const MessageTarget& target, CTCTags::TagMessageDetails& details) override
{
return HandleMessage(user, target);
}
};
MODULE_INIT(ModulePrivacyMode)
MODULE_INIT(ModuleCommonChans)

View File

@ -75,7 +75,7 @@ class ModuleConnJoin : public Module
{
ConfigTag* tag = ServerInstance->Config->ConfValue("autojoin");
defchans = tag->getString("channel");
defdelay = tag->getDuration("delay", 0, 0, 60);
defdelay = tag->getDuration("delay", 0, 0, 60*15);
}
void Prioritize() override
@ -95,7 +95,7 @@ class ModuleConnJoin : public Module
return;
std::string chanlist = localuser->GetClass()->config->getString("autojoin");
unsigned int chandelay = localuser->GetClass()->config->getDuration("autojoindelay", 0, 0, 60);
unsigned int chandelay = localuser->GetClass()->config->getDuration("autojoindelay", 0, 0, 60*15);
if (chanlist.empty())
{

Some files were not shown because too many files have changed in this diff Show More