]>
jfr.im git - irc/rqf/shadowircd.git/blob - extensions/extb_canjoin.c
2 * Canjoin extban type: matches users who are or are not banned from a
15 static int _modinit(void);
16 static void _moddeinit(void);
17 static int eb_canjoin(const char *data
, struct Client
*client_p
, struct Channel
*chptr
, long mode_type
);
19 DECLARE_MODULE_AV1(extb_canjoin
, _modinit
, _moddeinit
, NULL
, NULL
, NULL
, "$Revision: 1841 $");
24 extban_table
['j'] = eb_canjoin
;
32 extban_table
['j'] = NULL
;
35 static int eb_canjoin(const char *data
, struct Client
*client_p
,
36 struct Channel
*chptr
, long mode_type
)
38 struct Channel
*chptr2
;
40 static int recurse
= 0;
43 /* don't process a $j in a $j'ed list */
45 return EXTBAN_INVALID
;
47 return EXTBAN_INVALID
;
48 chptr2
= find_channel(data
);
49 /* must exist, and no point doing this with the same channel */
50 if (chptr2
== NULL
|| chptr2
== chptr
)
51 return EXTBAN_INVALID
;
52 /* require consistent target */
53 if (chptr
->chname
[0] == '#' && data
[0] == '&')
54 return EXTBAN_INVALID
;
55 /* this allows getting some information about ban exceptions
56 * but +s/+p doesn't seem the right criterion */
58 /* privacy! don't allow +s/+p channels to influence another channel */
59 if (!PubChannel(chptr2
))
60 return EXTBAN_INVALID
;
63 ret
= is_banned(chptr2
, client_p
, NULL
, NULL
, NULL
) == CHFL_BAN
? EXTBAN_MATCH
: EXTBAN_NOMATCH
;