412 Commits

Author SHA1 Message Date
Peter Powell
b3a728d93f Move checking for +ikl from the core to to core_channel. 2018-03-31 13:00:57 +01:00
Peter Powell
57e4bf9725 Fix m_chanhistory sending the history notice directly to the user.
Closes #1452.
2018-01-03 16:24:19 +00:00
Peter Powell
565544fac9 Merge branch 'insp20' into master. 2017-12-11 11:41:44 +00:00
Peter Powell
98372c3cf2 Extract RFC modes from the core to core_channel and core_user. 2017-12-10 12:38:45 +00:00
Peter Powell
25c1319e0d Add length checking to GetExtBanStatus and m_banexception.
As far as I can tell this is not a problem as all ban masks are
canonicalised but its better to be safe than sorry.
2017-11-28 13:48:50 +00:00
B00mX0r
d2f4558bcc
Fix action extbans not triggering
This fixes a reversion from ebe5b20
2017-11-26 14:16:29 -08:00
Peter Powell
36040be295 Fix a ton of -Wsign-conversion warnings. 2017-11-17 15:33:01 +00:00
Peter Powell
d865b43486 Hide User#host and User#dhost and use accessors to modify them.
This removes the need to invalidate the cache after changing a
user's hostname.
2017-10-28 16:16:10 +01:00
Peter Powell
caded702bf Fix compatibility with the legacy <channels> tag.
We should only use OperMaxChans if they have the right privilege.
2016-09-20 05:38:03 +01:00
Attila Molnar
6a35f493f3 Return std::string from Membership::GetAllPrefixChars() 2016-08-30 16:33:46 +02:00
Attila Molnar
19f0c09aa7 Convert ModeHandler::GetNumParams() to NeedsParam() that returns a bool 2016-08-29 14:50:08 +02:00
Peter Powell
4a12fc9d4b Add a method which calculates the maximum mask length. (#1171) 2016-07-22 12:26:11 +02:00
Attila Molnar
2706a993b3 Refactor topic setting logic to go through Channel::SetTopic() in all cases
- Pass topic set time and optionally the setter to SetTopic()
- Don't do anything if the topic is changed by a local user to what it is currently
2016-04-11 15:53:01 +02:00
Attila Molnar
0586ec9baa Add Channel::WriteNotice() 2016-03-05 16:41:24 +01:00
Attila Molnar
da29af8cba Convert WriteNumeric() calls to pass the parameters of the numeric as method parameters 2016-02-25 16:12:09 +01:00
Attila Molnar
e17fcc226b Return true from Channel::PartUser() if the user was on the channel 2015-12-28 17:27:40 +01:00
Attila Molnar
419537e745 Invert if in Channel::PartUser() 2015-12-28 17:25:30 +01:00
Attila Molnar
30fc51c6dd Rewrite invite system
- Moved out of core, now lives entirely in core_channel
- Accessible using the provided API after including the appropriate header
- Invites are stored in an extension attached to LocalUser/Channel objects, they no longer need special handling when destroying these objects or when lowering TS
- Expiration of timed invites are implemented using Timers
- When creating a new invite let a non-timed invite override a timed one
2015-11-02 13:28:55 +01:00
Attila Molnar
a95853c964 Move handling of <options:invitebypassmodes> into core_channel 2015-11-02 12:32:20 +01:00
Peter Powell
8c90682adc Update another password check to use InspIRCd::TimingSafeCompare. 2015-10-14 06:25:35 +01:00
Attila Molnar
8adc04585d Revert "Fix sending the wrong numerics on join when a topic is empty."
This reverts commit b0e64b8cea2d721588d92072a8d16fdd99a9c945.

The original behavior isn't RFC incompliant, see #1095.
2015-10-11 16:27:10 +02:00
Peter Powell
b0e64b8cea Fix sending the wrong numerics on join when a topic is empty. 2015-08-26 12:02:31 +01:00
Attila Molnar
930fd98e48 Move Channel::UserList() from core to cmd_names 2015-05-16 16:49:37 +02:00
Attila Molnar
127fe6ed10 Move topic and NAMES sending on join from core into core_channel 2015-05-16 16:40:22 +02:00
Attila Molnar
245c2d9d43 Fix miscalculation of maxlen in Channel::UserList() introduced by the WriteNumeric() conversion 2015-02-27 01:30:40 +01:00
Attila Molnar
4b6f7d7893 Verify that the chan in chanlist is in fact the same object as us in Channel::CheckDestroy() before proceeding 2015-01-16 11:01:50 +01:00
Attila Molnar
30610582c7 Gracefully handle multiple Channel::CheckDestroy() calls on the same object
Don't add the channel to the cull list more than once
2015-01-16 10:58:28 +01:00
Attila Molnar
47dda4f615 Reduce std::string::substr() usage
substr() returns a new string while erase() and assign() modify the existing one
2015-01-10 15:16:03 +01:00
Attila Molnar
3a3ff94967 Merge insp20 2014-10-27 15:26:20 +01:00
Attila Molnar
8c2cdeaf33 Store Membership objects physically in the nodes of Channel::MemberMap 2014-09-27 18:30:01 +02:00
Attila Molnar
4343bbb67a Reject parameters that begin with a colon in Channel::SetDefaultModes() 2014-09-26 21:07:24 +02:00
Attila Molnar
aa5a97bfd6 Don't try to set a mode in Channel::SetDefaultModes() if it needs a parameter but does not have one
Thanks to @docwhat for helping to track this down, fixes issue #924
2014-09-26 20:58:55 +02:00
Attila Molnar
63601e946e Remove typedef UserMembIter, use Channel::MemberMap::iterator instead
Remove the now unused UserMembList typedef too
2014-07-14 16:19:34 +02:00
Attila Molnar
82435b6fa8 Kill needless #includes in source files 2014-06-14 15:30:14 +02:00
Attila Molnar
106c0889b3 Return the newly created Membership object from Channel::ForceJoin() 2014-06-10 17:45:41 +02:00
Attila Molnar
854af2945e Change Channel::KickUser() to accept an iterator, add overload that accepts a User
Remove srcmemb parameter
2014-06-10 17:12:00 +02:00
Attila Molnar
bef2d3f462 Move pre-kick checks from core to cmd_kick (core_channel) 2014-06-10 17:04:42 +02:00
Attila Molnar
3e3ede8c30 Remove needless checks from Invitation::Find() 2014-05-06 15:17:12 +02:00
Attila Molnar
5ebb49de65 Change the OnNamesListItem() hook to return ModResult
Return MOD_RES_DENY to exclude the user from the NAMES list
2014-04-20 14:05:21 +02:00
Peter Powell
c511bb56f5 Kill <channels> in favour of <connect:maxchans> and <oper:maxchans>.
Remove channels/high-join-limit privilege
2014-04-11 16:14:10 +02:00
Attila Molnar
0c476dd0ca Avoid double Membership lookup in Channel::UserList()
The user is always inside if UserList() is called from ForceJoin() and the HasUser() result obtained in the /NAMES handler can be reused
2014-04-09 15:02:10 +02:00
Attila Molnar
6dc4436ae4 Move checks determining whether a user is allowed to view the NAMES list of a channel from Channel::UserList() to cmd_names 2014-04-09 14:57:42 +02:00
Attila Molnar
b4a7847bb8 Eliminate usage of has_one in Channel::UserList() 2014-04-09 14:50:37 +02:00
Attila Molnar
f71e6bf9cb Merge insp20 2014-04-07 13:40:51 +02:00
Attila Molnar
02e935ec75 Check if Membership::GetPrefixChar() returns 0 before appending it to a string
Spotted by @barosl
2014-03-31 11:35:03 +02:00
Attila Molnar
da45f24ff1 Change allocation of InspIRCd::chanlist to be physically part of the object containing it 2014-03-14 12:59:19 +01:00
Attila Molnar
5c96689b17 Fix NAMES list getting truncated on servers having an excessively long server name 2014-03-13 15:41:10 +01:00
Attila Molnar
b183197698 Backport "Refactor Channel::UserList() to use std::string"
This gets rid of questionable snprintf() usage, reported by @hifi

Backported commit: 8a06d54076551387f83a29360478ee6605e241b6
2014-03-13 15:37:19 +01:00
Attila Molnar
7ffef79f97 Index Channel::modes and User::modes with the id of the mode instead of its letter 2014-02-21 15:11:24 +01:00
Attila Molnar
0556720b55 Add ParamModeBase and ParamMode, change all parameter modes to inherit from ParamMode
- Type of the extension used to store data is a template parameter
- The extension is automatically unset when the mode is unset
- Handlers inheriting from ParamMode have to provide OnSet() and SerializeParam(); may optionally provide OnUnset()
- Transparently handle the case when OnSet() modifies the mode parameter
- Remove Channel::custom_mode_params map; ask the mode handlers to serialize their parameters instead
2014-02-15 14:38:24 +01:00