]>
jfr.im git - solanum.git/blob - extensions/extb_usermode.c
2 * Usermode extban type: bans all users with a specific usermode
18 static int _modinit(void);
19 static void _moddeinit(void);
20 static int eb_usermode(const char *data
, struct Client
*client_p
, struct Channel
*chptr
, long mode_type
);
22 DECLARE_MODULE_AV1(extb_usermode
, _modinit
, _moddeinit
, NULL
, NULL
, NULL
, "$Revision: 1299 $");
27 extban_table
['m'] = eb_usermode
;
35 extban_table
['m'] = NULL
;
38 static int eb_usermode(const char *data
, struct Client
*client_p
,
39 struct Channel
*chptr
, long mode_type
)
42 unsigned int modes_ack
= 0, modes_nak
= 0;
47 /* $m must have a specified mode */
49 return EXTBAN_INVALID
;
51 for (p
= data
; *p
!= '\0'; p
++)
65 modes_nak
|= user_modes
[(unsigned char) *p
];
69 modes_ack
|= user_modes
[(unsigned char) *p
];
76 return ((client_p
->umodes
& modes_ack
) == modes_ack
&&
77 !(client_p
->umodes
& modes_nak
)) ?
78 EXTBAN_MATCH
: EXTBAN_NOMATCH
;