1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-07 02:03:14 +02:00

- Add an extban of the schema +b ~j:*diff | less@* which _only_ prevents a user from joining a channel.

This commit is contained in:
binki
2010-07-22 12:32:06 +00:00
parent 85904c2277
commit 46668768cf
4 changed files with 35 additions and 1 deletions
+2
View File
@@ -2056,3 +2056,5 @@
name="" />
- Some minor tweaks
- Fix the detection for curl-without-c-ares a little (#0003940).
- Add an extban of the schema +b ~j:*!*@* which _only_ prevents a user
from joining a channel.
+4
View File
@@ -217,6 +217,10 @@ help ExtBans {
" | | Example: ";
" | | +bb ~n:*!*@*.aol.com ~n:nick*!*@* ";
"-----------------------------------------------------------------------------------";
" | | If a user matches this, he may not join the channel. ";
" ~j | join | He may perform all other activities if he is already on ";
" | | the channel, such as speaking and changing his nick. ";
"-----------------------------------------------------------------------------------";
" | | If the user is in this channel then (s)he is unable to ";
" | [prefix] | join. A prefix can also be specified (+/%/@/&/~) which ";
" ~c | channel | means that it will only match if the user has that ";
+1 -1
View File
@@ -193,7 +193,7 @@ extern int is_chanowner(aClient *, aChannel *);
#ifndef DISABLE_EXTBAN_STACKING
extern int ban_check_mask(aClient *, aChannel *, char *, int, int);
extern int extban_is_ok_nuh_extban(aClient *, aChannel *, char *, int, int, int);
extern char* extban_conv_param_nuh_extban(char *);
extern char* extban_conv_param_nuh_or_extban(char *);
#endif
extern Ban *is_banned(aClient *, aChannel *, int);
extern Ban *is_banned_with_nick(aClient *, aChannel *, int, char *);
+28
View File
@@ -275,6 +275,23 @@ char *ban = banin + 3;
#endif
}
/* a ban that affects JOINs only */
int extban_modej_is_banned(aClient *sptr, aChannel *chptr, char *banin, int type)
{
char *sub_ban;
if (type != BANCHK_JOIN)
return 0;
sub_ban = banin + 3;
#ifdef DISABLE_STACKED_EXTBANS
return extban_is_banned_helper(sub_ban);
#else
return ban_check_mask(sptr, chptr, sub_ban, type, 0);
#endif
}
#ifndef DISABLE_STACKED_EXTBANS
/** General is_ok for n!u@h stuff that also deals with recursive extbans.
*/
@@ -454,6 +471,17 @@ void extban_init(void)
req.is_banned = extban_modeq_is_banned;
ExtbanAdd(NULL, req);
memset(&req, 0, sizeof(ExtbanInfo));
req.flag = 'j';
#ifdef DISABLE_STACKED_EXTBANS
req.conv_param = extban_conv_param_nuh;
#else
req.conv_param = extban_conv_param_nuh_or_extban;
#endif
req.is_banned = extban_modej_is_banned;
req.is_ok = extban_is_ok_nuh_extban;
ExtbanAdd(NULL, req);
memset(&req, 0, sizeof(ExtbanInfo));
req.flag = 'n';
#ifdef DISABLE_STACKED_EXTBANS