Commit Graph

107 Commits

Author SHA1 Message Date
Alexander Barton fee591b759 Remove Can_Send_To_Channel_Identified()
Move the functionality directly into Can_Send_To_Channel() function.
There should be no functional change ...
2012-08-27 21:15:12 +02:00
DNS777 1aaf54ac24 Implement channel mode "M"
Only the server, identified users and IRC operators are able to talk.
2012-08-26 16:40:49 +02: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 a3a4b5f696 Rename ShowInvitesBans() to ShowChannelList(), make it more flexible 2012-01-21 13:48:31 +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 af70c3dbc9 List and class handling: add optional "reason" text
Adjust Lists_Add() and Class_AddMask() accordingly, implement
Lists_GetReason() and Lists_GetValidity().
2011-12-25 14:19:45 +01:00
Alexander Barton 8fa92f0a24 Suppress 'Can't create pre-defined channel: invalid name: ""' messages
Skip predefined channel structures that have configured no name,
like the "--configtest" does.
2011-12-04 22:35:20 +01:00
xor b80e115f39 New configuration opion "MorePrivacy" to "censor" some user information
this patch contains:

  * Fix for Conf_CloakUserToNick to make it conceal user details
  * Adds MorePrivacy-feature

MorePrivacy censors some user information from being reported by the
server. Signon time and idle time is censored. Part and quit messages
are made to look the same. WHOWAS requests are silently dropped. All
of this is useful if one wish to conceal users that access the ngircd
servers from TOR or I2P.
2011-06-25 22:21:20 +02:00
Florian Westphal 5417a72536 channel: always reject zero-length channel key
previously, any client could join in this configuration:

[Channel]
  Name = #test
  Modes = tnk
  KeyFile = /tmp/foobar

fix this by checking for zero-length key before comparing
key to channel key.
2011-02-28 23:28:24 +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
Florian Westphal 4a5dfcc3ac channel: fix confusing "adding to invite list" debug output
adding entries to ban list produced 'invite list' debug output...
2010-12-31 11:35:40 +01:00
Alexander Barton 9bc5d565bb Save channel creation time; new function Channel_CreationTime() 2010-11-11 12:39:19 +01:00
Alexander Barton 5462c6c50f Don't #include client.h when conn.h/conn-func.h is already included
conn.h and cinn-func.h both already #include client.h, so it is
not needed to do it twice.
2010-06-30 23:49:52 +02:00
Alexander Barton cc336b7558 Only #include resolve.h if it is really needed 2010-06-29 22:55:27 +02:00
Alexander Barton 8fd0e29d46 Fix "implicit conversion shortens 64-bit value" warning
This patch fixes the following gcc warning in our sources:
"implicit conversion shortens 64-bit value into a 32-bit value"
2009-09-11 22:52:12 +02:00
Florian Westphal ea041b8838 add const qualifier to pointers where possible 2009-04-21 20:58:23 +02:00
Alexander Barton 3be9c477be Fix spelling of log message: "channek" vs. "channel" ... 2009-01-20 17:20:30 +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 1c7b9dbe93 remove unneeded LOG_DEBUG when not compiling with DEBUG support
when ngircd is build without DEBUG enabled, LOG_DEBUG messages
are always discarded.

To avoid the extra code, ngircd has a LogDebug() wrapper which
gets removed by the compiler when compiling without DEBUG defined.

Update a few functings which were using the
Log(LOG_DEBUG, .. interface directly without #ifdef DEBUG guards.

   text	   data	    bss	    dec	    hex	filename
 127748	   1900	  28280	 157928	  268e8	ngircd.before
 126836	   1896	  28280	 157012	  26554	ngircd.after
2009-01-10 00:54:07 +01:00
Alexander Barton a11e895045 Rename Channel_Free() to Free_Channel(), it is a local function 2009-01-05 13:53:33 +01:00
Alexander Barton 175f0af979 Clean up channel allocation table on shutdown/restart.
Silly bug: the condition of a while() loop in the Channel_Exit() function
used the wrong variable and therefore got never executed ...

This bug is in the code since the beginning (see commit bb19cfda in 2002);
shame on me!
2009-01-05 12:58:37 +01:00
Florian Westphal 40a0e9abbe Add Channel_Free().
Central function to free a channel structure and all its resources
(invite/ban lists, topic, ...).
2009-01-05 12:48:48 +01:00
Alexander Barton 0659503afd Clean up (reformat and comment) Delete_Channel() function. 2009-01-04 15:25:07 +01:00
Alexander Barton 18efc7469c Free topic array on channel deletion.
The topic array in the CHANNEL structure must be free()'d before the
channel itself becomes deleted.
2009-01-04 15:22:32 +01:00
Florian Westphal a971047bc5 Remove limit on max number of predefined channels.
This resolves Bugzilla Bug 68 ('Too many pre-defined channels configured.')
2008-12-26 01:07:56 +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
Alexander Barton b92a7627f3 Don't allow empty channel names ("#") in strict RFC mode.
This closes Bug #88.

Patch proposed by Eric <egrunow@ucsd.edu>, but with wrong length
comparision: please note that Channel_IsValidName() checks the name
INCLUDING the prefix, so the test must be length<=1!
2008-07-22 13:24:14 +02:00
Alexander Barton 477f2fd9e7 Channel_Join(): Code cleanup. 2008-07-22 13:07:57 +02:00
Eric Grunow 71562ebe57 Translated comments from German to English 2008-06-16 13:58:56 +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 f7c2e8223f Always enable modeless channels.
Modeless channels (+channels) are described in RFC 2811;
so my modifications to
530112b114
('Add support for modeless channels')
to disable +channels for --strict-rfc configurations
were wrong. This reverts those changes.
2008-05-01 18:08:07 +02:00
Ali Shemiran 530112b114 Add support for modeless channels
Add support for modeless channels (+channels).

[fw@strlen.de:
 - integrate test cases
 - don't support +channels when compiled with --strict-rfc
 - do not set +o mode for channel creator
 - force +nt mode when channel is created ]
2008-05-01 15:55:12 +02:00
Alexander Barton 523a6fad09 Report ERR_NOTONCHANNEL when trying to part a channel one is not member of.
When trying to part a channel ("PART #channel") the client is not member of
the daemon now correctly reports the numeric ERR_NOTONCHANNEL (442) insted
of ERR_NOSUCHCHANNEL (403).
2008-04-24 23:52:54 +02:00
Alexander Barton 54b17fc201 Channel_Part(): Code and comment cleanup. 2008-04-24 23:47:33 +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 5675be4cd9 fix compile /w gcc 2.95 (reported by Tassilo Schweyer) 2007-06-11 20:06:46 +00:00
Florian Westphal 1b852fce72 add support for predefined-channel configuration of k and l modes 2006-12-29 14:09:48 +00: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