Commit Graph

75 Commits

Author SHA1 Message Date
Ed Kellett d4f7eb4ce6
Replace most checks for +o with oper:general
I'm preparing to PR a succession of privs changes with the ultimate goal
of severely limiting the scope of the binary oper/user dichotomy and
move conceptually distinct oper functions into their own privs.

Accomplishing this is a non-trivial task, and can wait, but it's
inconvenient now to have such functions enabled by the same mechanism
that grants any privs at all--so I'm moving all of them to a
transitional priv with the intention of eroding that later.
2020-08-04 22:58:30 +01:00
Ariadne Conill 92f5320e1d message: run privmsg_user hook on both source and target 2020-07-09 16:06:56 -06:00
Ariadne Conill 4a9cf86981 message: remove hardcoded +G logic 2020-07-09 16:06:33 -06:00
Ariadne Conill ed3b56f965 message: remove hardcoded +R logic 2020-06-26 11:56:41 -06:00
Ed Kellett d819df92b8
Remove the massnotice wildcard restriction 2020-06-07 18:10:51 +01:00
Simon Arlott e2d5ffd5dd
echo-message should work for privmsg/notice to another user
Build the same message but send it to the local client first,
so that the echo-message capability works. But don't do it when
sending a message to yourself.
2016-11-23 21:59:43 +00:00
Elizabeth Myers 79435744c7 common.h: raison d'être is gone, so out it goes.
Fold whatever was left into ircd_defs.h
2016-03-23 09:33:56 -05:00
Elizabeth Myers 3c7d6fcce7 Message handlers should return void.
Also fix up some return values and stuff to use bool (or void if
nothing). I just did it whilst I was here.

According to jilles, the return value used to signify whether or not the
client had exited. This was error-prone and was fixed a long, long time
ago, but the return value was left int for historical reasons.

Since the return type is not used (and has no clear use case anyway),
it's safe to just get rid of it.
2016-03-09 01:37:03 -06:00
Elizabeth Myers eeabf33a7c Move module description headers to the top
This is cleaner.

Note this was broken out of a much larger piece of work I did, so if
there's any problems, I apologise!
2016-03-09 01:29:41 -06:00
Andrew Wilcox 8661d5ae5c core/m_message: Add AV2 description 2016-03-07 00:57:05 -06:00
Elizabeth Myers 105a4985b4 Migrate remaining modules to AV2
No descriptions yet. :(
2016-03-07 00:03:39 -06:00
Elizabeth Myers cbeab4bc34 Remove $Id tags from everything.
These are obsolete and none have changed since 10 years gao...
2016-03-06 02:47:27 -06:00
William Pitcock 7baa37a9ef msg: remove last vestiges of the fakelag system. charybdis has never supported fakelag. 2016-02-19 16:43:39 -06:00
William Pitcock 428ca87b01 modules: chase MsgBuf API change 2016-02-10 20:54:17 -06:00
William Pitcock a7433e330a m_message: use same behaviour for +R users as +g users (closes #96) 2015-12-05 06:48:38 -06:00
Jilles Tjoelker 9279ad6461 Fix some compiler warnings about signed/unsigned comparison. 2015-03-01 23:46:20 +01:00
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