Commit Graph

54 Commits

Author SHA1 Message Date
LucentW 4da04640e6 Keep track of who placed bans/invites/excepts
Implements #203.
WARNING: it does not track the time of placement of invites, since the
time_t is already used as a flag for single use invites!
2015-05-11 22:15:00 +02:00
Federico G. Schwindt c74115f25c Simplify mode checking on channels and users within a channel
Add Channel_HasMode() and Channel_UserHasMode() and use it where
possible.
2013-08-04 18:28:04 +01:00
Alexander Barton f2fa1045e2 Implement channel exception list (mode 'e')
This allows a channel operator to define exception masks that allow users
to join the channel even when a "ban" would match and prevent them from
joining: the exception list (e) overrides the ban list (b).
2012-01-21 19:59:57 +01:00
Alexander Barton 69fa6f268a LUSERS reply: only count "visible" channels
Rename Channel_Count() to Channel_CountVisible() and only count channels
that are visible to the requesting client, so the existence of secret
channels is no longer revealed by using LUSERS.

Reported by Cahata -- thanks!
2011-12-28 15:11:01 +01:00
Alexander Barton 2a7dd06ebd Code cleanup: mostly removing empty lines 2011-02-13 17:52:38 +01:00
Alexander Barton 03628dbeaf Add Doxygen @file documentation to each source and header file 2011-02-13 17:52:38 +01:00
Alexander Barton ba32d594fd Channel_CheckAdminRights(): test if client can admin a channel
This generic function tests if a client is allowed to do administrative
tasks to a specific channel:

 - servers and services are always truested ("allowed everything"),
 - channel operators are allowed,
 - IRC operarors are allowed if OperCanUseMode is set in the config.
2011-01-09 22:40:11 +01:00
Alexander Barton 9bc5d565bb Save channel creation time; new function Channel_CreationTime() 2010-11-11 12:39:19 +01:00
Florian Westphal ea041b8838 add const qualifier to pointers where possible 2009-04-21 20:58:23 +02:00
Florian Westphal e9e7fc33f1 add and use Channel_IsModeless()
avoid "name[0] == '+'" where possible, having Channel_IsModeless()
makes things much more obvious.
2009-03-07 00:13:25 +01:00
Alexander Barton d09094812f Channel key file: store file name and open on each access.
Store the file name of channel key files and reopen them on each access
(on each JOIN command) insted of just storing the file handles.

This eliminates the special requirements (no delete) and makes sure
that always the actual file contents are used in all circumstances.
2009-01-20 17:20:30 +01:00
Alexander Barton c5000694d1 Support individual channel keys for pre-defined channels.
This patch introduces the new configuration variable "KeyFile" for
[Channel] sections in ngircd.conf. Here a file can be configured for each
pre-defined channel which contains individual channel keys for different
users. This file is line-based and must have the following syntax:

  <user>:<nick>:<key>

<user> and <nick> can contain the wildcard character "*".

Please not that these channel keys are only in effect, when the channel
has a regular key set using channel mode "k"!
2009-01-20 17:20:30 +01:00
Florian Westphal 6500d443fc channel.c: constify a few function arguments. 2008-12-26 01:07:52 +01:00
Alexander Barton 0eda085f1e Create local &SERVER channel and log server messages to it
ngIRCd now creates a server-local channel &SERVER with channel modes
+mnPt (moderated, no messages from outside the channel, persistent and
with the topic locked) and logs all the messages to it that a user with
mode +s ("server messages") receives.

If an IRC operator withdraws the +P ("persistent") mode and the &SERVER
channel is freed because of no members, nothing special happens. The
channel can be recerated any time later and ngIRCd would begin logging
to it again.
2008-11-17 23:27:06 +01:00
Alexander Barton 2cc21caf32 Implement local channels (prefix "&")
This patch implements server-local channels, prefix "&", that are only
visible to users of the same local server and not in the network.

Patch written by Scott Perry (2008-06-04), see:
 - http://arthur.barton.de/cgi-bin/bugzilla/show_bug.cgi?id=87
 - http://arthur.barton.de/cgi-bin/bugzilla/attachment.cgi?id=24&action=view
2008-11-17 21:52:56 +01:00
Alexander Barton f92a614a35 Enable KICK to be handled from remote servers and from services. 2008-09-23 11:53:16 +02:00
Alexander Barton 3913de3cff Fix PRIVMSG/NOTICE handler (II): keep command when forwarding to channels.
- new function ngt_UpperStr().
- change Channel_Write() to take command name and error flag.
- remove now unneeded function Channel_Notice().
2008-09-23 11:53:15 +02:00
Eric Grunow 75b719a0c8 Anglified and improved comments in channel.c and channel.h
[Dana Dahlstrom: repair tab/space conversion in patch]
2008-05-08 03:15:04 +02:00
Florian Westphal 0428a1c4ea Constify some of Channel_Kick()s arguments. 2008-05-05 15:38:47 +02:00
Florian Westphal cb0d594e61 Make Channel_Part name and reason parameters 'const'. 2008-02-26 23:49:33 +01:00
Florian Westphal 59b19ea6a3 This adds support for sending NOTICEs to a channel.
[also see Bug #70 in ngircd bugzilla].

Based on a patch by Fabian Schlager <fabian.schlager@gmail.com>.
2008-02-26 23:49:33 +01:00
Florian Westphal fb0fbe908d remove unused function Channel_PCount 2006-12-07 22:23:39 +00:00
Florian Westphal fa7bb2790a moved invite/ban lists to channel structure 2006-12-07 17:57:20 +00:00
Florian Westphal 6e105bf87e channel maxusers now unsigned long 2006-10-06 21:32:58 +00:00
Florian Westphal d8950c5dd0 cleaned up Channel_IsValidName (now uses strcspn()) 2006-10-02 21:55:49 +00:00
Alexander Barton ca32c1b311 Implementec numeric "333": Time and user name who set a channel topic. 2005-09-02 12:50:25 +00:00
Florian Westphal 84706af7fe topic no longer limited to 127 chars (now only limited by protocol) 2005-07-28 16:23:55 +00:00
Florian Westphal 8adff59223 Remove INT, LONG, BOOLEAN, STATIC, CONST, CHAR datatypes.
use stdbool.h / inttypes.h if available.
2005-03-19 18:43:48 +00:00
Alexander Barton 2e88dd72d1 - New functions Channel_[Set]Key(), Channel_[Set]MaxUsers. 2002-12-16 23:05:24 +00:00
Alexander Barton e907816380 - fixed up Channel_PCount() and Channel_CountForUser(). 2002-12-14 13:21:56 +00:00
Alexander Barton b7eb5f66dc - new function Channel_CountForUser(). 2002-12-13 17:22:57 +00:00
Alexander Barton c7f075236b - new file header format (in english). 2002-12-12 12:23:43 +00:00
Alexander Barton c7b55aa6f4 - verwendete Datentypen aufgeraumt: beispielsweise INT32 ist nun oft ein LONG. 2002-10-09 16:53:02 +00:00
Alexander Barton 378e511e04 - New_Chan() in Channel_Create() umbenannt; entsprechende Anpassungen.
- Neue Funktion Channel_SetModes().
2002-09-03 23:57:57 +00:00
Alexander Barton 04162c3944 - Neue Funktion Channel_InitPredefined(). 2002-06-02 17:13:07 +00:00
Alexander Barton bec858c77f - neue Funktionen Channel_Kick() und Channel_Quit();
- Channel_RemoveClient() ist entfallen.
2002-06-01 14:36:05 +00:00
Alexander Barton c2f60abe55 - Anpassungen an pre-ANSI-Compiler,
- Includes aufgeraumt: Header includieren keine anderen mehr.
2002-05-27 13:09:26 +00:00
Alexander Barton f22f1cf4f4 - neue Funktion Channel_MemberCount() implementiert. 2002-04-23 19:51:31 +00:00
Alexander Barton 95a4b1b158 - einige Anpassungen nach Code-Check mit SPLint ;-) 2002-03-25 19:11:01 +00:00
Alexander Barton cec0e2a4d7 - Channel-Struktur um Hash-Wert ueber Namen ergaenzt.
- Neue Funktion Channel_Write().
2002-03-25 16:55:14 +00:00
Alexander Barton ca33cbda05 - externe portab-Header werden nicht mehr benoetigt/benutzt, dadurch
einige Aenderungen an diversen Source-Dateien und Headern.
- Dateien enthalten keine CVS-History mehr.
2002-03-12 14:37:51 +00:00
Alexander Barton 52548bd3e3 - neue Funktionen Channel_Topic() und Channel_SetTopic(). 2002-02-27 20:32:10 +00:00
Alexander Barton 153aa0aac8 - neue Funktion Channel_IsMemberOf() implementiert. 2002-02-27 15:21:21 +00:00
Alexander Barton 2184b3615b - neue Funktionen Channel_ModeAdd(), Channel_ModeDel(), Channel_UserModes(),
Channel_UserModeAdd(), Channel_UserModeDel().
2002-02-11 01:00:22 +00:00
Alexander Barton 40c9f5c332 - neue Funktionen Channel_Modes() und Channel_IsValidName(). 2002-02-06 16:49:10 +00:00
Alexander Barton 0bb9db1aa0 - neue Funktionen Channel_FirstChannelOf() und Channel_NextChannelOf(). 2002-01-29 00:11:10 +00:00
Alexander Barton 71c7a6fcc0 - neue Funktionen Channel_Name(), Channel_First() und Channel_Next(). 2002-01-28 01:16:15 +00:00
Alexander Barton 8a324b6d9c - CHANNEL- und CL2CHAN-Strukturen in Header verlegt,
- einige neue Funktionen (Channel_GetChannel(), Channel_FirstMember(), ...)
2002-01-26 18:41:55 +00:00
Alexander Barton 4b0c9849d6 - Definition der CHANNEL-Struktur aus Header entfernt,
- neue Funktionen Channel_Join(), Channel_Part() und Channel_RemoveClient().
2002-01-21 00:11:59 +00:00
Alexander Barton 568239244f - neue Funktion Channel_Count(). 2002-01-16 22:09:07 +00:00