Commit graph

59 commits

Author SHA1 Message Date
William Pitcock
bc75c3ae0e fix target list generation edge case where WALLCHOPS was requested alongside normal users if the source user was not a channel op.
from ircd-hybrid r5457
2015-02-09 11:16:06 -06:00
Keith Buck
55abcbb20a Remove trailing whitespace from all .c and .h files.
3134 bytes were removed.
2014-03-03 04:25:47 +00:00
Keith Buck
880db619be m_message: Remove some unused variables. 2012-04-03 21:51:09 +00:00
William Pitcock
f30a5ee4c4 Remove MODE_NOCTCP from core, in favor of chm_noctcp. 2012-03-31 22:48:36 -05:00
William Pitcock
67aeaba593 Remove MODE_NOCOLOR from core, replacing it with modules/chm_nocolour.so. 2012-03-31 22:26:45 -05:00
William Pitcock
6eb033605c Check for empty string after permutation hooks have run. 2012-03-31 22:18:15 -05:00
William Pitcock
ca4c2a86ee Add support for hookifying PRIVMSG/NOTICE.
This will allow us to modularize message processing, e.g. having new modules to manipulate
channel and private messages in new ways.

Yes: it can be used to intercept messages, but such modules are already out in the wild for
charybdis anyway -- so this doesn't really change anything there.

If you are changing the text, then it is your responsibility to provide a pointer to a new
buffer.  This buffer should be statically allocated and stored in your module's BSS segment.
We will not, and cannot, free your buffer in core, so dynamically allocated buffers will
cause a memory leak.

This will allow us to simplify m_message considerably, by moving channel mode logic out to
their own modules.
2012-03-31 21:23:01 -05:00
Jilles Tjoelker
494d2b9dd4 Apply special CTCP handling to messages to @/+ channel as well:
* +C cmode blocks CTCPs
 * CTCPs to large channels relax some flood protection to allow all
   answers through.
2012-03-14 23:20:05 +01:00
Jilles Tjoelker
60dd1febe2 Apply colour stripping (cmode +c) to messages to @/+ channel as well. 2012-03-14 23:04:30 +01:00
B.Greenham
15484f02bd Move flood_attack_channel to channel.c so it can be used outside m_message.c 2010-12-09 18:29:56 -05:00
William Pitcock
1f679bfe7b Filter bogus CTCP ACTION messages. 2010-11-05 01:16:03 -05:00
Jilles Tjoelker
717238d2a2 Add target change for channels.
This has a separate enabling option channel::channel_target_change.

It applies to PRIVMSG, NOTICE and TOPIC by unvoiced unopped non-opers.

The same slots are used for channels and users.
2010-08-29 01:26:00 +02:00
Jilles Tjoelker
dd9b78dc92 Remove redundant MyClient check, it is already checked above. 2010-08-24 22:46:57 +02:00
Jilles Tjoelker
f5455d2cd5 Tweak auto-accept:
* does not apply to NOTICE (as those may well be automated)
* mirrors +g behaviour so that no useless accept entries are added for services
* respects max_accept, if it would be exceeded the message is dropped with numeric 494
* check moved up so this is checked before floodcount/tgchange
2010-07-04 17:14:56 +02:00
William Pitcock
0770c9936e Stop griefing through taunting while hiding behind CALLERID.
This shouldn't provide any way for a client to get on a CALLERID list
without authorization, as if a client is +g already, a CTCP request, for
example, won't be replied to.
2010-07-03 00:44:55 -05:00
Jilles Tjoelker
4f2685f3e1 Move target change code to src/tgchange.c,
so we can use it for /invite as well.
2010-02-15 21:58:34 +01:00
Jilles Tjoelker
c9f01c4f2f target change: Allow free replies.
When a user receives a private message, notice or RPL_UMODEGMSG,
add the source to a special set of 5 target slots.
These slots are checked in the normal way when sending messages,
allowing a reply without using up a free target.

This feature will not be very useful if a user is being messaged
by many different users; to help this, messages blocked entirely
by +g or +R do not affect the targets. CTCP replies also remain
free in terms of targets.
2010-02-15 01:07:07 +01:00
Jilles Tjoelker
179becdf5f target change: Overwrite the least recently used target with a new one. 2010-02-15 00:31:17 +01:00
Jilles Tjoelker
ad1d39a76f Make the number of targets tracked for target change a #define. 2010-02-13 15:18:17 +01:00
Jilles Tjoelker
1fd171a547 Fix op-moderate (cmode +z) for channel names with '@'. 2010-01-24 19:37:00 +01:00
Jilles Tjoelker
641eb2c3c8 Put back fb7d6089158e, not setting large_ctcp_sent for CTCP ACTION. 2010-01-20 00:03:57 +01:00
William Pitcock
2e918bf515 Merge +C (no CTCP to channels) from ircd-seven. 2010-01-19 02:11:04 -06:00
Jilles Tjoelker
3d0bbdcbe1 Do not set large_ctcp_sent for CTCP ACTION as it does not request a reply. 2010-01-14 01:12:16 +01:00
Stephen Bennett
c127b45b83 Revert all presence-related changes 2009-12-08 19:22:55 +00:00
William Pitcock
884b5d41c1 presence: Remove user.away, replaced by a metadata entry.
Cache the metadata retrieval value where feasible for minimal performance impact.
2009-06-02 02:03:51 -05:00
Jilles Tjoelker
aa9c9ed268 Allow ctcp replies through floodcount after ctcp'ing a large group.
A large group is any $$ or $# or a channel with more than
floodcount/2 local members, checked on each server separately.
Note that floodcount checks are done on the sender's server.

The special treatment is active for 15 seconds.
2009-05-17 20:52:16 +02:00
Jilles Tjoelker
b7b1d686a9 Simplify floodcount checking, it is no longer affected by +g/+R anymore. 2009-04-19 00:04:21 +02:00
Jilles Tjoelker
631b4a542a Use uid/sid for some ERR_CHANOPRIVSNEEDED if they go to a remote client. 2009-04-09 23:45:35 +02:00
Jilles Tjoelker
c4d2d01419 Apply +z to messages blocked by +b and +q as well.
This adds a new server capab EOPMOD which will be used
for an extended topic command also.
2009-03-29 15:48:07 +02:00
Jilles Tjoelker
8feca1768e Allow +z messages from outside if -n.
This gives a useful meaning to the cmode combo +mz-n:
messages from ops and voices go to all channel members,
messages from anyone else (on or off channel) go to ops.
With +mnz, messages from outside are not allowed at all.
2008-11-15 22:56:09 +01:00
Jilles Tjoelker
d7dc7ae6c1 Remove some dead code.
found using llvm static analyzer
2008-08-29 02:53:52 +02:00
Jilles Tjoelker
c287438827 Let ops/voices bypass tgchange/floodcount if sending to users in their channel.
This was already possible by using CPRIVMSG/CNOTICE
instead of PRIVMSG/NOTICE.
2008-07-27 23:34:58 +02:00
Jilles Tjoelker
ef57f7fb5e Remove user@server messages to local users.
These are unreliable in general and only useful
for violating certain restrictions.
Sending such messages to remote servers is still
possible, for securely messaging pseudoservers whether
service{}'ed or not. The special oper-only syntax
opers@server remains as well.
2008-07-27 22:17:46 +02:00
Jilles Tjoelker
c24efdc0b7 Also apply floodcount to messages to remote clients (except services).
As before, only local clients can have their message blocked.
2008-07-22 01:46:34 +02:00
Jilles Tjoelker
351d22c09b Do not check floodcount if user is messaging self. 2008-07-13 13:35:43 +02:00
William Pitcock
ab4285181c Remainder of irc_string.* is moved to new inline/stringops.h. 2008-04-20 01:03:11 -05:00
Valery Yatsko
4562c60489 irc_string.h -> match.h, irc_string.h; includes changed 2008-04-20 09:47:38 +04:00
Valery Yatsko
4a2651e520 strtoken -> rb_strtok_r (with arguments order changes) 2008-04-20 09:20:25 +04:00
Valery Yatsko
f427c8b00d strlcpy -> rb_strlcpy 2008-04-20 08:40:40 +04:00
Valery Yatsko
47adde3def s_stats.c removed, now we use new style of stats handling. 2008-04-04 19:54:37 +04:00
Valery Yatsko
54ac8b60a1 Reverting some changed related not to moving on libratbox3 but using ratbox3 source! 2008-04-02 19:37:50 +04:00
Valery Yatsko
2bef65c9ad Line doesn't exists in ratbox3 and makes compile warning - gone 2008-04-02 15:05:04 +04:00
Valery Yatsko
ae78a57163 Reverting to 398.. trying again with native charybdis hash 2008-04-02 14:16:31 +04:00
Valery Yatsko
e55bb3da3d m_message::add_target from ratbox3 2008-04-02 14:05:17 +04:00
Valery Yatsko
e335494516 CurrentTime -> rb_currenttime(); 2008-04-02 03:53:20 +04:00
Valery Yatsko
637c4932f6 Argh, wrong replace caused by MS VS 2005 interface. 2008-04-02 02:47:17 +04:00
Valery Yatsko
bd19829278 MyFree -> rb_free 2008-04-02 02:45:16 +04:00
Valery Yatsko
81af5bcb39 libcharybdis includes gone. 2008-04-02 02:39:19 +04:00
Jilles Tjoelker
0e7cb7e6a1 Various changes for libratbox. 2008-04-01 23:03:14 +02:00
William Pitcock
ba200635a6 Make this compile, but lots of warnings. 2008-04-01 15:26:43 -05:00