]> git.netwichtig.de Git - user/henk/code/inspircd.git/log
user/henk/code/inspircd.git
5 years agoAdd a silent option to <options:restrictbannedusers>.
Peter Powell [Tue, 10 Jul 2018 19:32:08 +0000 (20:32 +0100)]
Add a silent option to <options:restrictbannedusers>.

This is useful when dealing with spambots that switch method when
they receive ERR_CANNOTSENDTOCHAN.

5 years agoUse !empty() instead of 'size() > 0' when checking parameter count.
B00mX0r [Tue, 3 Jul 2018 15:07:39 +0000 (16:07 +0100)]
Use !empty() instead of 'size() > 0' when checking parameter count.

6 years agoAlways show Make commands for the user to execute in quotes.
Peter Powell [Tue, 26 Jun 2018 15:38:34 +0000 (16:38 +0100)]
Always show Make commands for the user to execute in quotes.

Fixes #1189.

6 years agoAllow relative paths to be passed in --config on boot.
Peter Powell [Mon, 25 Jun 2018 11:56:14 +0000 (12:56 +0100)]
Allow relative paths to be passed in --config on boot.

Closes #1115.

6 years agoShow the package name in the message when doing pkg-config lookups.
Peter Powell [Fri, 25 May 2018 10:09:51 +0000 (11:09 +0100)]
Show the package name in the message when doing pkg-config lookups.

6 years agoAdd --nopid command line option (#1497).
Chris Novakovic [Mon, 4 Jun 2018 11:40:32 +0000 (12:40 +0100)]
Add --nopid command line option (#1497).

Add a --nopid command line option, which causes a PID file not to be
written to the file system regardless of the presence of the <pid> tag
in the configuration file or the value of its "file" variable if it is
present.

6 years agoUse the `pwd` tool that is in the path rather than `/bin/pwd`.
Peter Powell [Tue, 1 May 2018 17:47:08 +0000 (19:47 +0200)]
Use the `pwd` tool that is in the path rather than `/bin/pwd`.

6 years agoImprove support for MOTD escape codes.
Peter Powell [Thu, 29 Mar 2018 18:04:11 +0000 (19:04 +0100)]
Improve support for MOTD escape codes.

- Implement escapes for italic, monospace, and strikethrough.
- Use the escape codes in the example MOTDs to demonstrate their
  formatting effects.
- Remove support for octal escape codes. In modern computing octal
  is rarely used and is confusing for users who might confuse it
  for decimal.

6 years agoAlways process MOTD formatting escape codes.
Peter Powell [Thu, 29 Mar 2018 16:45:56 +0000 (17:45 +0100)]
Always process MOTD formatting escape codes.

The options for disabling these were added to keep compatibility
with previous 2.0 releases and are not needed any more.

6 years agoFix some oversights relating to numerics.
Peter Powell [Sun, 22 Apr 2018 20:58:15 +0000 (21:58 +0100)]
Fix some oversights relating to numerics.

- ERR_CANNOTSENDTOCHAN only takes the channel name and a message.
- ERR_INVALIDCAPCMD is 410 not 232.

6 years agoRelease v3.0.0 alpha 7.
Peter Powell [Sun, 22 Apr 2018 14:18:28 +0000 (15:18 +0100)]
Release v3.0.0 alpha 7.

6 years agoMove a bunch of optional module numerics to the module source file.
Peter Powell [Sun, 22 Apr 2018 13:31:28 +0000 (14:31 +0100)]
Move a bunch of optional module numerics to the module source file.

6 years agoReplace ERR_{NOCTCPALLOWED,WORDFILTERED} with ERR_CANNOTSENDTOCHAN.
Peter Powell [Sun, 22 Apr 2018 12:31:00 +0000 (13:31 +0100)]
Replace ERR_{NOCTCPALLOWED,WORDFILTERED} with ERR_CANNOTSENDTOCHAN.

There is no reason for these responses to have their own numerics
when other modules do not. The only thing this does is make life
harder for client developers.

6 years agoMerge tag 'v2.0.26' into master.
Peter Powell [Sat, 21 Apr 2018 11:04:43 +0000 (12:04 +0100)]
Merge tag 'v2.0.26' into master.

6 years agoRelease v2.0.26
Peter Powell [Fri, 20 Apr 2018 18:53:01 +0000 (19:53 +0100)]
Release v2.0.26

6 years agoOptionally do not notify users if their messages are blocked by certain modules ...
Robby [Fri, 20 Apr 2018 14:28:28 +0000 (16:28 +0200)]
Optionally do not notify users if their messages are blocked by certain modules (#1134).

Closes #711.

6 years agoTell the rehasher if an exception is thrown by a module on rehash.
Peter Powell [Mon, 16 Apr 2018 18:07:53 +0000 (19:07 +0100)]
Tell the rehasher if an exception is thrown by a module on rehash.

6 years agoRewrite m_denychans.
Peter Powell [Thu, 15 Feb 2018 11:30:57 +0000 (11:30 +0000)]
Rewrite m_denychans.

- The configuration is now validated on ReadConfig and parsed into
  objects.

- Allow redirecting to channels that don't yet exist. There is no
  technical reason to not allow this and I believe that it would
  be a lot less confusing to users if we allowed this.

- Flatten a bunch of nested if statements.

6 years agoConvert some usages of ato[il] to use ConvToNum.
Peter Powell [Mon, 16 Apr 2018 21:20:29 +0000 (22:20 +0100)]
Convert some usages of ato[il] to use ConvToNum.

6 years agoFix m_ircv3_sts not having the VF_VENDOR flag set.
Peter Powell [Mon, 16 Apr 2018 17:32:55 +0000 (18:32 +0100)]
Fix m_ircv3_sts not having the VF_VENDOR flag set.

6 years agoCall OnUserMessageBlocked when a PRIVMSG or a NOTICE is blocked.
Peter Powell [Mon, 16 Apr 2018 16:02:42 +0000 (17:02 +0100)]
Call OnUserMessageBlocked when a PRIVMSG or a NOTICE is blocked.

This is necessary to allow m_ircv3_echomessage to pretend that a
message was echoed successfully. This is useful as it doesn't let
spammers know that their message was blocked.

6 years agoAdd range checking to ConfigTag::getFloat.
Peter Powell [Sat, 14 Apr 2018 15:11:57 +0000 (16:11 +0100)]
Add range checking to ConfigTag::getFloat.

6 years agoAdd ConfigTag::getUInt for reading unsigned config values.
Peter Powell [Sat, 14 Apr 2018 14:43:03 +0000 (15:43 +0100)]
Add ConfigTag::getUInt for reading unsigned config values.

6 years agoConvert ConfigTag::getDuration to return an unsigned long.
Peter Powell [Sat, 14 Apr 2018 13:59:35 +0000 (14:59 +0100)]
Convert ConfigTag::getDuration to return an unsigned long.

6 years agoExtract ConfigTag::getInt magnitude logic to a function template.
Peter Powell [Sat, 14 Apr 2018 13:04:12 +0000 (14:04 +0100)]
Extract ConfigTag::getInt magnitude logic to a function template.

6 years agoConvert ConfigTag::CheckRange to a function template.
Peter Powell [Sat, 14 Apr 2018 12:17:20 +0000 (13:17 +0100)]
Convert ConfigTag::CheckRange to a function template.

6 years agoRemove the default value in ConfigTag::get{Duration,Float,Int}.
Peter Powell [Sat, 14 Apr 2018 15:53:03 +0000 (16:53 +0100)]
Remove the default value in ConfigTag::get{Duration,Float,Int}.

6 years agoUse an oper priv instead of a config flag for overriding nonicks.
Peter Powell [Mon, 16 Apr 2018 14:04:45 +0000 (15:04 +0100)]
Use an oper priv instead of a config flag for overriding nonicks.

6 years agoImprove some documentation (#1483).
Matt Schatz [Mon, 16 Apr 2018 09:02:49 +0000 (03:02 -0600)]
Improve some documentation (#1483).

* Improve exemptchanops in inspircd.conf.example (<options>)
  and modules.conf.example; along with both helpop examples.
* Add "the" to all "requires X module" in both helpop examples.
* Refer to customprefix instead of chanprotect and halfop.
* Add SNOMASK 'r' and 'R' (OPERLOG) to both helpop examples.
* Clean up unnecessarily split SNOMASK lines in both helpop examples.
* Move chmode 'g' to be in alphabetical order in both helpops examples.
* Specify the needed mask formats for TLINE in helpop-full example.
* Remove extra '\' in RLINE mask format in helpop-full example.
  Force xml format in helpop-full
* Generalize "color codes" to "formatting codes"
* Fix file name in include for example helpop-full

6 years agoUse an oper priv instead of a config flag for overriding callerid.
Peter Powell [Sun, 15 Apr 2018 21:37:04 +0000 (22:37 +0100)]
Use an oper priv instead of a config flag for overriding callerid.

6 years agoReplace the remaining use of irc::string with irc::find.
Peter Powell [Sat, 14 Apr 2018 23:20:56 +0000 (00:20 +0100)]
Replace the remaining use of irc::string with irc::find.

6 years agoRemove helpop sections which are now incorrect.
Peter Powell [Sat, 14 Apr 2018 19:02:44 +0000 (20:02 +0100)]
Remove helpop sections which are now incorrect.

Both the static module flag and the CLEARCHAN command have been
removed.

6 years agoFix customprefix modes not being deleted when the module unloads.
Peter Powell [Sat, 14 Apr 2018 16:30:30 +0000 (17:30 +0100)]
Fix customprefix modes not being deleted when the module unloads.

6 years agoFix ModuleManager's external source lists not working with HTTPS.
Peter Powell [Wed, 11 Apr 2018 23:30:53 +0000 (00:30 +0100)]
Fix ModuleManager's external source lists not working with HTTPS.

6 years agoFix blank instead of empty PART message when a user is shunned
B00mX0r [Mon, 9 Apr 2018 00:28:37 +0000 (17:28 -0700)]
Fix blank instead of empty PART message when a user is shunned

6 years agoChange some usage of "gecos" to "real name"
genius3000 [Tue, 10 Apr 2018 17:05:11 +0000 (11:05 -0600)]
Change some usage of "gecos" to "real name"

Within the example configs, helpops, some server sent messages, and
simple code comments: change the primary usage of "gecos" to
"real name" (or "realname" where fitting).

6 years agoChange ServerInfo::gecos to description
genius3000 [Tue, 10 Apr 2018 16:33:46 +0000 (10:33 -0600)]
Change ServerInfo::gecos to description

6 years agoRemove swhois messages set in the oper block on deoper.
Peter Powell [Sun, 21 Jan 2018 13:33:44 +0000 (13:33 +0000)]
Remove swhois messages set in the oper block on deoper.

Closes #1240.

6 years agoOptimize some behaviour in the core (#1476).
Dylan Frank [Mon, 9 Apr 2018 03:41:04 +0000 (20:41 -0700)]
Optimize some behaviour in the core  (#1476).

6 years agoFix an invalid mode parameters numeric upon attempting to view a list mode
B00mX0r [Sat, 7 Apr 2018 23:11:40 +0000 (16:11 -0700)]
Fix an invalid mode parameters numeric upon attempting to view a list mode

6 years agoInclude modules/whois.h directly from files that use it.
Peter Powell [Sat, 7 Apr 2018 14:48:30 +0000 (15:48 +0100)]
Include modules/whois.h directly from files that use it.

6 years agoMove OnStats from the core to a cross-module event.
Peter Powell [Sat, 7 Apr 2018 14:07:24 +0000 (15:07 +0100)]
Move OnStats from the core to a cross-module event.

Some core code still exists in the XLine system but this will be
replaced when the XLine system is replaced later.

6 years agoFix some more oversights in m_geoip.
Peter Powell [Sat, 7 Apr 2018 14:14:53 +0000 (15:14 +0100)]
Fix some more oversights in m_geoip.

- Add the G: extban to the EXTBAN 005 token.
- Use CXX11_OVERRIDE with ReadConfig and OnCheckBan.

Thanks to @genius3000 for pointing these out.

6 years agoFix disabling the GeoIP extban in m_geoip.
Peter Powell [Sat, 7 Apr 2018 13:06:25 +0000 (14:06 +0100)]
Fix disabling the GeoIP extban in m_geoip.

6 years agom_sqlauth: Allow specifying what hash algos to provide hashes from.
Daniel Vassdal [Sat, 21 Feb 2015 10:50:09 +0000 (11:50 +0100)]
m_sqlauth: Allow specifying what hash algos to provide hashes from.

Defaults to md5,sha256 to be compatible with old configs.

Adds new parameter `kdf`. If this is set (to e.g. bcrypt), the hash
will be compared locally. This requires the password column to be
specified in <sqlauth:column>.

Closes #741

6 years agoSQL: Add HasColumn() to check if a result contains a named column.
Daniel Vassdal [Mon, 2 Mar 2015 02:06:55 +0000 (03:06 +0100)]
SQL: Add HasColumn() to check if a result contains a named column.

6 years agoFix ELine::Matches returning false on existing match
genius3000 [Mon, 26 Mar 2018 11:57:22 +0000 (05:57 -0600)]
Fix ELine::Matches returning false on existing match
When checking for an E-Line match, we want to actually check for a
current match even if we previously matched and are set exempt.

This fixes situations where you have an E-Lined CGI:IRC address,
a G-Lined IP range for some area/host/etc and a smaller E-Lined
IP range for known good clients. Currently when CGI:IRC changes
the IP, E-Lines are rechecked but because the user is already exempt
(from the CGI:IRC E-Line), they are set no longer exempt and match
a G-Line, when they should match an E-Line.

This exact change has been done before in commit 'c8b344e' and shortly
reverted in 'c490a90' to fix issue #989 (CGI:IRC users remaining exempt
when the CGI:IRC address is E-Lined but they are not).
The actual cause to this issue was likely that the user's hostname was
not changed from the CGI:IRC hostname/IP prior to rechecking E-Lines.
This is being fixed in a separate commit.

6 years agoSet User::host before calling ChangeIP()
Peter Powell [Mon, 26 Mar 2018 11:52:35 +0000 (05:52 -0600)]
Set User::host before calling ChangeIP()
ChangeIP() calls SetClientIP() which revalidates whether the user
matches an ELine. However, because the hostname has not changed yet
the user may incorrectly be marked as non-exempt.

6 years agoRefactor m_sqloper to be a full opers.conf replacement (#983).
Dylan Frank [Fri, 6 Apr 2018 17:34:15 +0000 (10:34 -0700)]
Refactor m_sqloper to be a full opers.conf replacement (#983).

m_sqloper now supports dynamic fields, works with m_sslinfo, and works with /stats o.

6 years agoImplement support for banning users from channels by country code.
Peter Powell [Fri, 6 Apr 2018 16:53:14 +0000 (17:53 +0100)]
Implement support for banning users from channels by country code.

6 years agoValidate settings in order in ValidateSettings() (#1475).
genius3000 [Fri, 6 Apr 2018 15:08:30 +0000 (09:08 -0600)]
Validate settings in order in ValidateSettings() (#1475).

* Validate the settings in the same order as the parameter syntax
* Always validate Lines and Secs regardless of having a Diff
* Check Backlog for greater than Max as well as being disabled

6 years agoPrioritize checking for +ikl last to match previous behavior (#1474).
Dylan Frank [Sat, 31 Mar 2018 21:51:51 +0000 (14:51 -0700)]
Prioritize checking for +ikl last to match previous behavior (#1474).

6 years agoMove <security:announceinvites> to core_channel.
Peter Powell [Sat, 31 Mar 2018 12:02:57 +0000 (13:02 +0100)]
Move <security:announceinvites> to core_channel.

6 years agoMove checking for +ikl from the core to to core_channel.
Peter Powell [Sat, 31 Mar 2018 10:50:36 +0000 (11:50 +0100)]
Move checking for +ikl from the core to to core_channel.

6 years agoUpdate the GeoIP ExtItem when CGI:IRC sets the real IP (#1471)
genius3000 [Fri, 30 Mar 2018 16:08:22 +0000 (10:08 -0600)]
Update the GeoIP ExtItem when CGI:IRC sets the real IP (#1471)

Since CGI:IRC calls it's 'ChangeIP()' either from 'OnCheckReady()'
or 'OnUserRegister()', both of which are called after the user has
sent NICK/USER, we can safely skip re-setting the ExtItem prior to
this point.

This skips the first 'OnSetUserIP()' from 'User::AddUser()' as
the 'OnSetConnectClass()' catch handles the initial setting.

6 years agoIgnore expired or invalid client certificates (#1468).
Dylan Frank [Thu, 29 Mar 2018 18:11:55 +0000 (11:11 -0700)]
Ignore expired or invalid client certificates (#1468).

Fixes #1345.

6 years agoDo not send unset topics on channel join per RFC (#1469)
Dylan Frank [Sun, 25 Mar 2018 20:24:38 +0000 (13:24 -0700)]
Do not send unset topics on channel join per RFC (#1469)

Fixes #1091.

6 years agoSeparate secret and private channels on whois for non-opers (#1447)
Dylan Frank [Sun, 25 Mar 2018 16:02:00 +0000 (09:02 -0700)]
Separate secret and private channels on whois for non-opers (#1447)

Separate secret and private channels on WHOIS for all users.

- Move the config parsing from the core to core_whois.
- Replace <security:operspywhois> with an oper privilege.
- Introduce <options:splitwhois> to split WHOIS channel lists.

Closes #969.

6 years agoMerge pull request #1461 from puckipedia/haiku-support
Peter Powell [Tue, 13 Mar 2018 19:31:43 +0000 (19:31 +0000)]
Merge pull request #1461 from puckipedia/haiku-support

Add Haiku support.

6 years agoAdd Haiku support
Puck Meerburg [Sat, 10 Mar 2018 19:44:09 +0000 (20:44 +0100)]
Add Haiku support

6 years agoMerge pull request #1463 from clinew/insp20+openssl-v1.1-compat
Peter Powell [Sun, 4 Mar 2018 13:58:00 +0000 (13:58 +0000)]
Merge pull request #1463 from clinew/insp20+openssl-v1.1-compat

m_ssl_openssl: Remove deprecated API members.

6 years agom_ssl_openssl: Remove deprecated API members.
Wade Cline [Sat, 3 Mar 2018 05:05:05 +0000 (21:05 -0800)]
m_ssl_openssl: Remove deprecated API members.

Backported from 2afc1af4639ae2bbef397f4f6acc834950017d91.

6 years agoImprove the message shown to the admin when generating SSL certs.
Peter Powell [Thu, 1 Mar 2018 19:43:36 +0000 (19:43 +0000)]
Improve the message shown to the admin when generating SSL certs.

Self-signed SSL certificates are intended for testing purposes. A
production server should be using a CA-signed certificate instead.

6 years agoMerge pull request #1458 from linuxdaemon/insp20+duplicate-redir-meta
Peter Powell [Sat, 24 Feb 2018 11:50:54 +0000 (11:50 +0000)]
Merge pull request #1458 from linuxdaemon/insp20+duplicate-redir-meta

[2.0] Make sure banredirect metadata can not be duplicated

6 years agoAppend LDFLAGS at the same time as CPPFLAGS and CXXFLAGS.
Peter Powell [Sat, 24 Feb 2018 11:48:02 +0000 (11:48 +0000)]
Append LDFLAGS at the same time as CPPFLAGS and CXXFLAGS.

This deduplicates the addition of these flags.

6 years agoRelease v3.0.0 alpha 6.
Peter Powell [Sat, 17 Feb 2018 21:48:53 +0000 (21:48 +0000)]
Release v3.0.0 alpha 6.

6 years agoMove m_sslrehashsignal to the extra directory.
Peter Powell [Sat, 17 Feb 2018 17:44:17 +0000 (17:44 +0000)]
Move m_sslrehashsignal to the extra directory.

This module uses platform-specific behaviour that does not work on
Windows.

6 years agoFix building on Windows (mostly).
Peter Powell [Sat, 17 Feb 2018 17:12:26 +0000 (17:12 +0000)]
Fix building on Windows (mostly).

6 years agoMerge pull request #1460 from genius3000/insp20+helpop_fix
Peter Powell [Mon, 12 Feb 2018 10:41:03 +0000 (10:41 +0000)]
Merge pull request #1460 from genius3000/insp20+helpop_fix

[2.0]: Helpop: Move extban 'U' from acting to matching

6 years ago[2.0]: Helpop: Move extban 'U' from acting to matching
genius3000 [Mon, 12 Feb 2018 01:40:23 +0000 (18:40 -0700)]
[2.0]: Helpop: Move extban 'U' from acting to matching
Already fixed in master in 8587df2

6 years agoImport the anticaps module from inspircd-extras.
Peter Powell [Tue, 30 Jan 2018 12:30:54 +0000 (12:30 +0000)]
Import the anticaps module from inspircd-extras.

6 years agoSend the ACCEPT and KEYLEN ISUPPORT tokens.
Peter Powell [Tue, 6 Feb 2018 15:01:30 +0000 (15:01 +0000)]
Send the ACCEPT and KEYLEN ISUPPORT tokens.

- The ACCEPT=[count] token specifies the maximum amount of nicks
  which can be added to a m_callerid accept list. This token was
  added by ircd-ratbox in 3.0.9.

- The KEYLEN=[length] token specifies the maximum length of a
  channel key. This token was added by ircd-ratbox in 3.1 beta.

For more info see http://defs.ircdocs.horse/defs/isupport.html

6 years agoAllow the maximum length of a chanfilter message to be configured.
Peter Powell [Wed, 6 Sep 2017 07:48:19 +0000 (08:48 +0100)]
Allow the maximum length of a chanfilter message to be configured.

6 years agoAdd names for a bunch of numerics.
Peter Powell [Sat, 27 Jan 2018 12:24:47 +0000 (12:24 +0000)]
Add names for a bunch of numerics.

6 years agoAdd ERR_INVALIDMODEPARAM for responding to invalid mode params.
Peter Powell [Sat, 27 Jan 2018 13:05:14 +0000 (13:05 +0000)]
Add ERR_INVALIDMODEPARAM for responding to invalid mode params.

Currently on invalid modes we do a combination of different things:

1. Send a custom mode-specific numeric (which often collides with
   other modes).

2. Send a server notice.

3. Do absolutely nothing.

This new numeric is a generic way of handling invalid parameters
when setting a mode that avoids all of the mistakes of the previous
behaviour.

6 years agoRevert std::set changes and add duplicate checking in m_banredirect instead, as reque...
linuxdaemon [Fri, 26 Jan 2018 03:34:40 +0000 (21:34 -0600)]
Revert std::set changes and add duplicate checking in m_banredirect instead, as requested by @Adam-

6 years agoFix comparator logic for ordering by channel
linuxdaemon [Fri, 26 Jan 2018 01:12:23 +0000 (19:12 -0600)]
Fix comparator logic for ordering by channel

6 years agoMake sure banredirect metadata can not be duplicated
linuxdaemon [Thu, 25 Jan 2018 22:07:30 +0000 (16:07 -0600)]
Make sure banredirect metadata can not be duplicated

6 years agoImprove performance under load of OnDataReady and remove C-isms.
systocrat [Mon, 1 Jan 2018 23:01:00 +0000 (01:01 +0200)]
Improve performance under load of OnDataReady and remove C-isms.

Re-use variables initialized within loop, const-ify config variables
accessed repeatedly, remove eol_found label.

Merges #1451.

6 years agoAdd a module which rehashes SSL modules on receiving SIGUSR1.
Peter Powell [Thu, 25 Jan 2018 11:51:14 +0000 (11:51 +0000)]
Add a module which rehashes SSL modules on receiving SIGUSR1.

This has been imported from inspircd-extras where it was known as
m_rehashsslsignal. The name has been changed slightly to match the
other modules which do SSL stuff (sslmodes, sslinfo).

6 years agoPass an irc::socket::sockaddrs to SocketEngine::SendTo().
Peter Powell [Sat, 20 Jan 2018 12:24:35 +0000 (12:24 +0000)]
Pass an irc::socket::sockaddrs to SocketEngine::SendTo().

6 years agoPass an irc::socket::sockaddrs to SocketEngine::Connect().
Peter Powell [Sat, 20 Jan 2018 12:08:09 +0000 (12:08 +0000)]
Pass an irc::socket::sockaddrs to SocketEngine::Connect().

6 years agoRemove duplicated code in LocalUser::GetServerPort().
Peter Powell [Sat, 20 Jan 2018 00:32:31 +0000 (00:32 +0000)]
Remove duplicated code in LocalUser::GetServerPort().

6 years agoFix some minor Doxygen errors.
Peter Powell [Sun, 14 Jan 2018 18:07:05 +0000 (18:07 +0000)]
Fix some minor Doxygen errors.

6 years agoRelease v3.0.0 alpha 5.
Peter Powell [Fri, 12 Jan 2018 14:57:56 +0000 (14:57 +0000)]
Release v3.0.0 alpha 5.

6 years agoFix some char signedness oversights when using bitsets.
Peter Powell [Sun, 7 Jan 2018 23:28:01 +0000 (23:28 +0000)]
Fix some char signedness oversights when using bitsets.

6 years agoAdd user mode +z for ssl-only private messages.
Shawn Smith [Wed, 3 Apr 2013 14:59:12 +0000 (10:59 -0400)]
Add user mode +z for ssl-only private messages.

Closes #468.

6 years agoStrip commas from channel keys like Charybdis and others do.
Peter Powell [Fri, 10 Nov 2017 16:03:37 +0000 (16:03 +0000)]
Strip commas from channel keys like Charybdis and others do.

6 years agoRework message handling.
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.

6 years agoImprove the method that blockcaps uses to block messages.
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.

6 years agoFix m_chanhistory sending the history notice directly to the user.
Peter Powell [Wed, 3 Jan 2018 16:24:19 +0000 (16:24 +0000)]
Fix m_chanhistory sending the history notice directly to the user.

Closes #1452.

6 years agoMake InspIRCd::Format return std::string instead of const char*.
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.

6 years agoIncrease the config default for <chanhistory:maxlines> to 50.
Peter Powell [Sun, 31 Dec 2017 18:38:21 +0000 (18:38 +0000)]
Increase the config default for <chanhistory:maxlines> to 50.

6 years agom_chanhistory: optionally exempt bots from receiving history.
Michael Hazell [Fri, 29 Dec 2017 23:16:39 +0000 (18:16 -0500)]
m_chanhistory: optionally exempt bots from receiving history.

Sending history to some bots can cause problems as without the
IRCv3 chathistory batch they have no way of knowing what messages
are history and what they should respond to.

Closes #1450.

6 years agoDon't hardcode mode characters which are sent in 005 tokens.
Peter Powell [Fri, 29 Dec 2017 23:53:44 +0000 (23:53 +0000)]
Don't hardcode mode characters which are sent in 005 tokens.

6 years agoFix various issues with the cgiirc module.
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.

6 years agoUse a bitset in blockcaps instead of a char array.
Peter Powell [Sat, 23 Dec 2017 15:56:23 +0000 (15:56 +0000)]
Use a bitset in blockcaps instead of a char array.

6 years agoUse a bitset in chghost/sethost instead of a char array.
Peter Powell [Sat, 23 Dec 2017 14:53:57 +0000 (14:53 +0000)]
Use a bitset in chghost/sethost instead of a char array.

6 years agoFix User::ChangeRealHost() to change the real host properly.
Peter Powell [Sat, 23 Dec 2017 14:45:36 +0000 (14:45 +0000)]
Fix User::ChangeRealHost() to change the real host properly.

6 years agoAdd ISUPPORT tokens for the host, line, and user length.
Peter Powell [Sun, 3 Dec 2017 13:40:33 +0000 (13:40 +0000)]
Add ISUPPORT tokens for the host, line, and user length.

This allows clients to accurately predict the maximum safe length
of a NOTICE or PRIVMSG and truncate/split as appropriate.

As proposed at https://defs.ircdocs.horse/defs/isupport.html