170 Commits

Author SHA1 Message Date
Sadie Powell
6597fe5d4f Add Channel::WriteRemoteNotice and revert WriteNotice changes.
This is a partial reversion of 687778b72e.

See also: #1749.
2020-01-29 12:00:32 +00:00
InspIRCd Robot
aa692dc103 Update copyright headers. 2020-01-11 22:14:43 +00:00
Peter Powell
687778b72e Allow Channel::WriteNotice send to other servers and status ranks. 2019-11-17 22:17:42 +00:00
Peter Powell
18678c6a22 Add ParamMode::IsParameterSecret and remove special casing of keys. 2019-01-28 17:26:15 +00:00
Peter Powell
0e6b18ff91 Fix warnings from Doxygen. 2018-10-21 19:18:08 +01:00
Peter Powell
58a0a7e014 Implement IRCv3 message tag support.
Co-authored-by: Attila Molnar <attilamolnar@hush.com>
2018-08-13 21:51:11 +01:00
Peter Powell
36040be295 Fix a ton of -Wsign-conversion warnings. 2017-11-17 15:33:01 +00: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
e17fcc226b Return true from Channel::PartUser() if the user was on the channel 2015-12-28 17:27:40 +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
930fd98e48 Move Channel::UserList() from core to cmd_names 2015-05-16 16:49:37 +02:00
Attila Molnar
8c2cdeaf33 Store Membership objects physically in the nodes of Channel::MemberMap 2014-09-27 18:30:01 +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
04ece67c3d Rename UserMembList to Channel::MemberMap, switch all code to use it 2014-07-14 16:10:12 +02:00
Attila Molnar
173bc63cb5 Change return type of Channel::GetUsers() to reference from pointer as it is never NULL 2014-07-14 16:04:38 +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
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
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
Attila Molnar
8bdc2313a6 Move GetAllPrefixChars() from Channel to Membership 2014-02-14 12:16:31 +01:00
Attila Molnar
74ccc28da3 Move GetPrefixChar() from Channel to Membership 2014-02-14 12:15:00 +01:00
Attila Molnar
458168b575 Convert InviteBase::invites to an intrusively linked list 2014-01-24 13:20:11 +01:00
attilamolnar
34fa5627de Create a base class for prefix modes
Move Channel::SetPrefix() into Membership
2013-09-11 12:10:07 +02:00
attilamolnar
37394a80c2 Clean up a few constructors
Do not silently correct a zero TS in Channel::Channel(); require callers to supply a valid TS instead
2013-08-12 20:10:06 +02:00
attilamolnar
b954283ccc Replace hardcoded mode letters, part 2
This changes all remaining Channel::IsModeSet() and Channel::GetModeParameter() calls to use ModeReferences for modes that were created by other modules or the core
2013-07-19 19:40:03 +02:00
attilamolnar
f2cdf27dd9 Replace hardcoded mode letters passed to IsModeSet() and GetModeParameter() with ModeHandlers, part 1 2013-07-01 19:21:08 +02:00
Peter Powell
146d72fddb Fix Doxygen comments. 2013-06-21 03:52:56 +01:00
attilamolnar
a85bc774f9 Always set the topic in Channel::SetTopic(), move access checks into cmd_topic 2013-06-16 21:53:05 +02:00
attilamolnar
8e8a4df17e Remove the now unused Channel::RemoveAllPrefixes() and CountInvisible() 2013-06-04 02:06:50 +02:00
attilamolnar
2ac7d154d9 Reduce User* -> Membership* lookups on part and kick 2013-06-04 02:06:50 +02:00
attilamolnar
b01dc3cb86 Move a few trivial functions into headers 2013-06-02 00:28:55 +02:00
attilamolnar
712a0e5ff3 Get rid of strlcpy(), strlcat(), charlcat() and charremove() 2013-05-16 02:23:45 +02:00
Peter Powell
accccc212c Replace some C-isms with C++-isms.
* 'const char*' to 'const std::string&'.
* snprintf to std::string concatenation.
* Replace duplicated OneOfMatches with InspIRCd::MatchMask.
2013-05-15 03:32:56 +01:00
attilamolnar
b98acac5c9 Channel::JoinUser() and Channel::ForceChan() changes
Convert static Channel::ForceChan() to non-static Channel::ForceJoin() that joins a user to a channel, no permission checks

The (static) Channel::JoinUser() now has a LocalUser parameter, and no longer have TS and bursting parameters. If the channel doesn't exist, it is created using current time as TS
2013-04-13 16:05:54 +02:00
Peter Powell
11cafc12d5 Tidy up source files:
- Use #pragma once instead of include guards.
- Move header files in src/modules to include/modules.
- Fixed various spacing issues.
2013-04-12 17:03:05 +01:00
attilamolnar
ebe5b201aa Migrate u_listmode.h into the core, change +b to use it 2013-04-08 23:13:24 +02:00
attilamolnar
1cb05553e2 Change channel name parameter of Module::OnUserPreJoin() and Channel::JoinUser() to std::string from char* 2013-04-01 02:13:43 +02:00
Peter Powell
808a0a0957 Fix Doxygen syntax errors. 2012-07-05 21:00:35 +01:00
attilamolnar
d2e189102b Fix pending invites not being removed when a channel was deleted or had its TS lowered 2012-06-17 17:54:49 +02:00
Robby-
46a3904619 Replace copyright headers with headers granting specific authors copyright 2012-04-19 20:58:29 +02:00
Justin Crawford
df5f76832e Fixes for bug #12 2012-04-14 18:03:25 -07:00
brain
cd712c40e1 ...because every now and again, i have to do a massive commit.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12248 e03df62e-2008-0410-955e-edbf42e46eb7
2010-01-11 03:07:32 +00:00
danieldg
dd2ace5916 Disallow adding prefix-mode when it is already set (fixes bug #935)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12245 e03df62e-2008-0410-955e-edbf42e46eb7
2010-01-09 17:29:28 +00:00
danieldg
d3747f2943 Add ModeHandler* versions of channel mode access
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12133 e03df62e-2008-0410-955e-edbf42e46eb7
2009-11-15 18:26:35 +00:00
danieldg
df37ab42f4 Hide channel mode structures
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12132 e03df62e-2008-0410-955e-edbf42e46eb7
2009-11-15 18:26:25 +00:00
danieldg
6b2ea83367 Move forward declarations to typedefs.h
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11967 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-24 20:03:53 +00:00
danieldg
b16e16ac1b Make User::uuid and User::server const
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11962 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-23 22:47:39 +00:00
danieldg
e50d016aa2 Cull channels, warn when Extensible objects are not culled as they must be
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11901 e03df62e-2008-0410-955e-edbf42e46eb7
2009-10-18 02:57:46 +00:00