#define FlagClr(set,flag) ((set)->bits[FLAGSET_INDEX(flag)] &= ~FLAGSET_MASK(flag))
/** String containing valid user modes, in no particular order. */
#define FlagClr(set,flag) ((set)->bits[FLAGSET_INDEX(flag)] &= ~FLAGSET_MASK(flag))
/** String containing valid user modes, in no particular order. */
PRIV_FORCE_OPMODE, /**< can hack modes on quarantined channels */
PRIV_FORCE_LOCAL_OPMODE, /**< can hack modes on quarantined local channels */
PRIV_APASS_OPMODE, /**< can hack modes +A/-A/+U/-U */
PRIV_FORCE_OPMODE, /**< can hack modes on quarantined channels */
PRIV_FORCE_LOCAL_OPMODE, /**< can hack modes on quarantined local channels */
PRIV_APASS_OPMODE, /**< can hack modes +A/-A/+U/-U */
FLAG_DEBUG, /**< send global debug/anti-hack info */
FLAG_ACCOUNT, /**< account name has been set */
FLAG_HIDDENHOST, /**< user's host is hidden */
FLAG_DEBUG, /**< send global debug/anti-hack info */
FLAG_ACCOUNT, /**< account name has been set */
FLAG_HIDDENHOST, /**< user's host is hidden */
FLAG_LAST_FLAG, /**< number of flags */
FLAG_LOCAL_UMODES = FLAG_LOCOP, /**< First local mode flag */
FLAG_GLOBAL_UMODES = FLAG_OPER /**< First global mode flag */
FLAG_LAST_FLAG, /**< number of flags */
FLAG_LOCAL_UMODES = FLAG_LOCOP, /**< First local mode flag */
FLAG_GLOBAL_UMODES = FLAG_OPER /**< First global mode flag */
struct CapSet con_capab; /**< Client capabilities (from us) */
struct CapSet con_active; /**< Active capabilities (to us) */
struct AuthRequest* con_auth; /**< Auth request for client */
struct CapSet con_capab; /**< Client capabilities (from us) */
struct CapSet con_active; /**< Active capabilities (to us) */
struct AuthRequest* con_auth; /**< Auth request for client */
#define cli_username(cli) ((cli)->cli_username)
/** Get client realname (information field). */
#define cli_info(cli) ((cli)->cli_info)
#define cli_username(cli) ((cli)->cli_username)
/** Get client realname (information field). */
#define cli_info(cli) ((cli)->cli_info)
/** Get number of incoming bytes queued for client. */
#define cli_count(cli) con_count(cli_connect(cli))
/** Get number of incoming bytes queued for client. */
#define cli_count(cli) con_count(cli_connect(cli))
#define con_active(con) (&(con)->con_active)
/** Get the auth request for the connection. */
#define con_auth(con) ((con)->con_auth)
#define con_active(con) (&(con)->con_active)
/** Get the auth request for the connection. */
#define con_auth(con) ((con)->con_auth)
#define STAT_CONNECTING 0x001 /**< connecting to another server */
#define STAT_HANDSHAKE 0x002 /**< pass - server sent */
#define STAT_CONNECTING 0x001 /**< connecting to another server */
#define STAT_HANDSHAKE 0x002 /**< pass - server sent */
#define HasFlag(cli, flag) FlagHas(&cli_flags(cli), flag)
/** Return non-zero if the client is an IRC operator (global or local). */
#define HasFlag(cli, flag) FlagHas(&cli_flags(cli), flag)
/** Return non-zero if the client is an IRC operator (global or local). */
/** Return non-zero if the client's connection is blocked. */
#define IsBlocked(x) HasFlag(x, FLAG_BLOCKED)
/** Return non-zero if the client's connection is still being burst. */
/** Return non-zero if the client's connection is blocked. */
#define IsBlocked(x) HasFlag(x, FLAG_BLOCKED)
/** Return non-zero if the client's connection is still being burst. */
#define IsInvisible(x) HasFlag(x, FLAG_INVISIBLE)
/** Return non-zero if the client caused a net.burst. */
#define IsJunction(x) HasFlag(x, FLAG_JUNCTION)
#define IsInvisible(x) HasFlag(x, FLAG_INVISIBLE)
/** Return non-zero if the client caused a net.burst. */
#define IsJunction(x) HasFlag(x, FLAG_JUNCTION)
-/** Return non-zero if the client has set mode +O (local operator). */
-#define IsLocOp(x) HasFlag(x, FLAG_LOCOP)
+/** Return non-zero if the client has set mode +O (local operator) locally. */
+#define IsLocOp(x) (MyConnect(x) && HasFlag(x, FLAG_LOCOP))
/** Return non-zero if the client has set mode +o (global operator). */
#define IsOper(x) HasFlag(x, FLAG_OPER)
/** Return non-zero if the client has an active UDP ping request. */
/** Return non-zero if the client has set mode +o (global operator). */
#define IsOper(x) HasFlag(x, FLAG_OPER)
/** Return non-zero if the client has an active UDP ping request. */
#define IsAccount(x) HasFlag(x, FLAG_ACCOUNT)
/** Return non-zero if the client has set mode +x (hidden host). */
#define IsHiddenHost(x) HasFlag(x, FLAG_HIDDENHOST)
#define IsAccount(x) HasFlag(x, FLAG_ACCOUNT)
/** Return non-zero if the client has set mode +x (hidden host). */
#define IsHiddenHost(x) HasFlag(x, FLAG_HIDDENHOST)
/** Return non-zero if the client has an active PING request. */
#define IsPingSent(x) HasFlag(x, FLAG_PINGSENT)
/** Return non-zero if the client has an active PING request. */
#define IsPingSent(x) HasFlag(x, FLAG_PINGSENT)
#define SetAccount(x) SetFlag(x, FLAG_ACCOUNT)
/** Mark a client as having mode +x (hidden host). */
#define SetHiddenHost(x) SetFlag(x, FLAG_HIDDENHOST)
#define SetAccount(x) SetFlag(x, FLAG_ACCOUNT)
/** Mark a client as having mode +x (hidden host). */
#define SetHiddenHost(x) SetFlag(x, FLAG_HIDDENHOST)
/** Mark a client as having a pending PING. */
#define SetPingSent(x) SetFlag(x, FLAG_PINGSENT)
/** Mark a client as having a pending PING. */
#define SetPingSent(x) SetFlag(x, FLAG_PINGSENT)
#define ClearServNotice(x) ClrFlag(x, FLAG_SERVNOTICE)
/** Remove mode +x (hidden host) from the client. */
#define ClearHiddenHost(x) ClrFlag(x, FLAG_HIDDENHOST)
#define ClearServNotice(x) ClrFlag(x, FLAG_SERVNOTICE)
/** Remove mode +x (hidden host) from the client. */
#define ClearHiddenHost(x) ClrFlag(x, FLAG_HIDDENHOST)
/** Clear the client's pending PING flag. */
#define ClearPingSent(x) ClrFlag(x, FLAG_PINGSENT)
/** Clear the client's pending PING flag. */
#define ClearPingSent(x) ClrFlag(x, FLAG_PINGSENT)
#define SNO_NOISY (SNO_SERVKILL|SNO_UNAUTH)
/** Test whether a privilege has been granted to a client. */
#define SNO_NOISY (SNO_SERVKILL|SNO_UNAUTH)
/** Test whether a privilege has been granted to a client. */
/** Grant a privilege to a client. */
#define SetPriv(cli, priv) FlagSet(cli_privs(cli), priv)
/** Revoke a privilege from a client. */
/** Grant a privilege to a client. */
#define SetPriv(cli, priv) FlagSet(cli_privs(cli), priv)
/** Revoke a privilege from a client. */
extern void client_set_privs(struct Client *client, struct ConfItem *oper);
extern int client_report_privs(struct Client* to, struct Client* client);
extern void client_set_privs(struct Client *client, struct ConfItem *oper);
extern int client_report_privs(struct Client* to, struct Client* client);