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