Commit Graph

84 Commits

Author SHA1 Message Date
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
Florian Westphal e2aacff7d4 s/Log(LOG_DEBUG/LogDebug(/ , translated comments, etc. 2006-08-12 11:58:21 +00:00
Alexander Barton 47026e14ce Don't assert() when a pre-defined channel has no topic. 2006-07-24 22:54:09 +00:00
Florian Westphal 8067bab106 changes some comments, minor cleanup 2006-04-23 10:33:37 +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
Alexander Barton 77f54693ef Removed unnecessary #define of "LOCAL", now use plain C "static" instead. 2005-07-31 20:13:07 +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 70facb7f6e made a few config options unsigned. 2005-07-11 14:11:35 +00:00
Florian Westphal d81dab99fa put badchars back in 2005-06-18 08:57:37 +00:00
Florian Westphal aec535c8b6 s/sprintf/snprintf 2005-06-17 19:16:53 +00:00
Florian Westphal 517321807e Fix Handling of quit messages: always send only one QUIT message. 2005-06-04 11:53:24 +00:00
Alexander Barton dfe662ad45 Added missing #include of "defines.h". 2005-04-27 07:34:25 +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 cb76d96efb Fixed some warnings of non-gcc-compilers (e. g. original Apple compiler on
A/UX): "warning: illegal pointer combination, op =".
2004-03-11 22:16:31 +00:00
Alexander Barton 57c7e23622 Added #include for strings.h to fix compiler warnings. 2004-01-17 03:17:49 +00:00
Alexander Barton be79fabcbf Fixed ban behavior: users which are banned from a channel can't no longer
send PRIVMSG's to this channel (fixes Bug #47).
2003-11-06 01:07:44 +00:00
Alexander Barton b8d7dcec77 - Adjusted includes for new "conn-func.h" header. 2002-12-30 17:15:42 +00:00
Alexander Barton 6626395c88 - replaced a lot of strcat() calls with strlcat() which is more secure. 2002-12-26 16:48:14 +00:00
Alexander Barton 0ced4181b0 - replaced all strncpy()'s and strncat()'s with strlcpy() and strlcat(). 2002-12-26 16:25:43 +00:00
Alexander Barton d9a13b317e - fixed some warnings that showed up with -Wtraditional 2002-12-25 13:22:43 +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 490f28ffd1 - new file header format (in english);
- new file ident semantics.
2002-12-12 12:24:18 +00:00