Peter Powell [Mon, 11 Dec 2017 19:42:52 +0000 (19:42 +0000)]
Rework message handling.
- Move all message-related types to their own header to make moving
them to a cross-module events easier.
- Rename OnUserMessage to OnUserPostMessage.
- Rename OnText to OnUserMessage.
- Replace the dest, target_type, and status parameters with the
MessageTarget class.
- Replace the text, exempt_list, and msgtype parameters with the
MessageDetails struct.
- Add echooriginal and originaltext to the MessageDetails struct
to allow spam filtering to not be broken by cap echo-message.
Peter Powell [Mon, 1 Jan 2018 18:01:47 +0000 (18:01 +0000)]
Improve the method that blockcaps uses to block messages.
Previously it had a list of upper case letters and assumed that all
other characters were lower case. This method is flawed as it can
be evaded by using non-alphanumeric characters.
The new method takes a list of lower case letters as well as upper
case letters and ignores any letters which are not listed in one of
the two lists.
The majority of the code for this was borrowed from the m_anticaps
module in inspircd-extras.
Peter Powell [Mon, 1 Jan 2018 23:56:35 +0000 (23:56 +0000)]
Make InspIRCd::Format return std::string instead of const char*.
Using the latter is problematic as if you don't copy the return
value before calling Format again your formatted message will be
overwritten by something else. This bug was observed in m_callerid
where InspIRCd::Format was being used for formatting two arguments
the latter of which was being overwritten with the former.
We could have preserved the return type and just copied the string
but then callers would have had to deallocate the string once they
have finished with it which is an undesirabable burden to put on
callers.
Peter Powell [Wed, 27 Dec 2017 13:06:12 +0000 (13:06 +0000)]
Fix various issues with the cgiirc module.
- Respect the value of <cgiirc:opernotice> when sending snotices
to operators.
- Write to the log file if opernotice is disabled.
- Log to the correct snomask in all cases. This was caused by an
oversight when merging insp20 into master.
- Replace the full user mask in log messages with a uuid/ip. The
WEBIRC command is sent as the first command so there will not be
a nickname or username at this point.
Peter Powell [Fri, 22 Dec 2017 02:47:54 +0000 (02:47 +0000)]
Improve and modernize the SQL system API.
- Move everything into the SQL namespace and drop the SQL prefix.
- Move SQLProvider::PopulateUserInfo to SQL::PopulateUserInfo.
- Rename SQLEntry to SQL::Field and clean up.
- Rename SQLEntries to SQL::Row.
- Rename SQLerror to SQL::Error and clean up.
- Rename SQLerrorNum to SQL::ErrorCode and drop the SQL_ prefix.
- Rename ParamL to SQL::ParamList.
- Rename ParamM to SQL::ParamMap;
- Make implementing SQLQuery::OnError mandatory.
- Redo most of the documentation in the sql header.
The 'crlfile' argument can point to a file that contains valid CRLs.
The 'crlpath' argument can point to a directory which contains CRLs,
albeit in OpenSSL's special hashed/symlink format. The 'crlmode' option
'chain' checks all certificates in the chain while the option 'leaf'
checks only the leaf certificate in a chain.
Peter Powell [Sun, 3 Dec 2017 21:55:01 +0000 (21:55 +0000)]
Clean up m_password_hash slightly.
- Get rid of MakeHash and inline the logic into the actual handler.
- Return CMD_FAILURE when password hashing fails for some reason.
- Change the module name and description to be more accurate.
Peter Powell [Wed, 15 Nov 2017 02:35:15 +0000 (02:35 +0000)]
Improve LIST and implement more extended list features.
- Move the ISUPPORT token from the core into core_user and start
sending the SAFELIST token to let clients know that they can
safely run LIST on big servers.
- Add support for the channel creation time (C), topic set time
(T), and inverted glob match (N) filters as specified in the
draft-hardy-irc-isupport-00 specification.
- Clean up the logic for filtering channels by user count.
Peter Powell [Sun, 12 Nov 2017 11:58:49 +0000 (11:58 +0000)]
Various minor documentation fixes.
- Remind admins that not setting a DIE/RESTART password does not
disable use of those commands.
- Remove references to 1.2 and modules being able to create custom
logging methods. This was never implemented in the 2.0 branch.
- Remove references to an SASL improvement that was reverted.
- Update various InspIRCd website links to use HTTPS over HTTP.
- Update a link to the IRCv3 website to point to the new website.
Peter Powell [Fri, 20 Oct 2017 07:01:27 +0000 (08:01 +0100)]
Enable using m_customprefix to alter core prefix modes.
This replaces the devoice module which has now been removed. If you
want users to be able to devoice themselves then you can load the
customprefix module add the following config tag:
<customprefix name="voice" depriv="yes">
If you wish to keep identical behaviour rather than allowing users
to use "MODE #YourChannel -v TheirNick" then you can load the alias
module and add the following config tag:
Inform the client when a SASL message cannot be sent
When SASL is properly configured with a 'target' server, we are able
to inform the client when the message fails to send.
Currently if a target is configured and it is offline, no response is
sent. This can cause some clients to time out while waiting for a response.
If a target isn't configured, behaviour will not change with this commit.
The default of '*' will still send to all servers.
Updated example config with 'target' variable.
Peter Powell [Mon, 30 Oct 2017 19:34:56 +0000 (19:34 +0000)]
Make core_hostname_lookup redo the lookup when a user's IP changes.
This removes the need to do lookups in the cgiirc module. This is
useful as relying on gateways to do proper DNS checks is unreliable
and has resulted in issues like 5fc4403f62. Its more sane if we do
our own lookups.
This change has been okayed by multiple WEBIRC gateway authors so
I don't think it will cause many problems.