6 #ifndef INCLUDED_whocmds_h
7 #define INCLUDED_whocmds_h
15 * m_who with support routines rewritten by Nemesi, August 1997
16 * - Alghoritm have been flattened (no more recursive)
18 * - Strong performance improvement
19 * - Added possibility to have specific fields in the output
20 * See readme.who for further details.
23 /* Macros used only in here by m_who and its support functions */
25 #define WHOSELECT_OPER 1
26 #define WHOSELECT_EXTRA 2
28 #define WHO_FIELD_QTY 1
29 #define WHO_FIELD_CHA 2
30 #define WHO_FIELD_UID 4
31 #define WHO_FIELD_NIP 8
32 #define WHO_FIELD_HOS 16
33 #define WHO_FIELD_SER 32
34 #define WHO_FIELD_NIC 64
35 #define WHO_FIELD_FLA 128
36 #define WHO_FIELD_DIS 256
37 #define WHO_FIELD_REN 512
38 #define WHO_FIELD_IDL 1024
40 #define WHO_FIELD_DEF ( WHO_FIELD_NIC | WHO_FIELD_UID | WHO_FIELD_HOS | WHO_FIELD_SER )
42 #define IS_VISIBLE_USER(s,ac) ((s==ac) || (!IsInvisible(ac)))
44 #define SEE_LUSER(s, ac, b) (IS_VISIBLE_USER(s, ac) || ((b & WHOSELECT_EXTRA) && MyConnect(ac) && HasPriv((s), PRIV_SHOW_INVIS | PRIV_SHOW_ALL_INVIS)))
46 #define SEE_USER(s, ac, b) (SEE_LUSER(s, ac, b) || ((b & WHOSELECT_EXTRA) && HasPriv((s), PRIV_SHOW_ALL_INVIS)))
48 #define SHOW_MORE(sptr, counter) (HasPriv(sptr, PRIV_UNLIMIT_QUERY) || (!(counter-- < 0)) )
50 #define SEE_CHANNEL(s, chptr, b) (!SecretChannel(chptr) || ((b & WHOSELECT_EXTRA) && HasPriv((s), PRIV_SEE_CHAN)))
52 #define MAX_WHOIS_LINES 50
57 extern void do_who(struct Client* sptr, struct Client* acptr, struct Channel* repchan,
58 int fields, char* qrt);
59 extern int count_users(char* mask);
61 #endif /* INCLUDED_whocmds_h */