1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 17:14:46 +02:00

Add +f subtype 'p' (for 'paste'). So [2p]:15 means max 2 pastes per 15s.

This way you can limit the number of pastes going on in a channel, as
this is from everyone in that channel (like 'm') not individual (like 't').
If it is exceeded then we will simply reject the BATCH, similar to
how action d(rop) works for some other subtypes. You won't see the paste
on the channel, only the sending user receives an error (MULTILINE_PASTE_LIMIT).

Small note: a multiline BATCH of just 2 lines is not considered a paste.
We consider a multiline of 3+ lines as a paste. I think that is reasonable,
since a two-line-multiline is not that much of a paste ;).

In the default anti-flood profile (+F normal) we also set 2p per 15s,
so this means channels are by default limited to 2 pastes per 15s max.
Of course, you can override this with +f [4p]:15 or whatever you like.
In terms of +F profiles, the defaults are (maximum x pastes per 15 seconds):
very-strict: 1p
strict: 1p
normal: 2p
relaxed: 2p
very-relaxed: 3p
This commit is contained in:
Bram Matthys
2026-03-30 14:40:16 +02:00
parent b0dba4bede
commit 1df465a6a5
7 changed files with 73 additions and 27 deletions
+2
View File
@@ -951,6 +951,7 @@ extern MODVAR void (*send_isupport)(Client *client);
extern MODVAR void (*isupport_check_for_changes)(void);
extern MODVAR int (*get_connections_from_ip)(Client *client);
extern MODVAR int (*get_floodprot_channel_max_lines)(Channel *channel);
extern MODVAR int (*floodprot_check_multiline_batch)(Channel *channel, Client *client, int line_count);
/* /Efuncs */
/* TLS functions */
@@ -991,6 +992,7 @@ extern int del_silence_default_handler(Client *client, const char *mask);
extern int is_silenced_default_handler(Client *client, Client *acptr);
extern int get_connections_from_ip_default_handler(Client *client);
extern int get_floodprot_channel_max_lines_default_handler(Channel *channel);
extern int floodprot_check_multiline_batch_default_handler(Channel *channel, Client *client, int line_count);
extern void do_unreal_log_remote_deliver_default_handler(LogLevel loglevel, const char *subsystem, const char *event_id, MultiLine *msg, const char *json_serialized);
extern int make_oper_default_handler(Client *client, const char *operblock_name, const char *operclass, ConfigItem_class *clientclass, long modes, const char *snomask, const char *vhost, const char *autojoin_channels);
extern void webserver_send_response_default_handler(Client *client, int status, char *msg);
+1
View File
@@ -2806,6 +2806,7 @@ enum EfunctionType {
EFUNC_ISUPPORT_CHECK_FOR_CHANGES,
EFUNC_GET_CONNECTIONS_FROM_IP,
EFUNC_GET_FLOODPROT_CHANNEL_MAX_LINES,
EFUNC_FLOODPROT_CHECK_MULTILINE_BATCH,
};
/* Module flags */