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