]> jfr.im git - irc/quakenet/snircd.git/blobdiff - include/client.h
merge 07 in
[irc/quakenet/snircd.git] / include / client.h
index 6818522bfa938e13be13e385dae96893ac044132..3ac890fd37969355dae75dcc8418df001f943d18 100644 (file)
@@ -90,7 +90,7 @@ typedef unsigned long flagpage_t;
 #define FlagClr(set,flag) ((set)->bits[FLAGSET_INDEX(flag)] &= ~FLAGSET_MASK(flag))
 
 /** String containing valid user modes, in no particular order. */
-#define infousermodes "dioswkgx"
+#define infousermodes "dioswkgxRXInP"
 
 /** Operator privileges. */
 enum Priv
@@ -165,7 +165,15 @@ enum Flag
                                        don't display channels in /whois */
     FLAG_DEBUG,                     /**< send global debug/anti-hack info */
     FLAG_ACCOUNT,                   /**< account name has been set */
+    FLAG_ACCOUNTONLY,               /**< ASUKA_R: hide privmsgs/notices if
+                                     user is not authed or opered */
+    FLAG_PARANOID,                  /**< ASUKA_P: sends notices on whois */
     FLAG_HIDDENHOST,                /**< user's host is hidden */
+    FLAG_SETHOST,                   /**< ASUKA_h: oper's host is changed */
+    FLAG_NOCHAN,                    /**< user's channels are hidden */
+    FLAG_NOIDLE,                    /**< user's idletime is hidden */
+    FLAG_XTRAOP,                    /**< oper has special powers */
+
     FLAG_LAST_FLAG,                 /**< number of flags */
     FLAG_LOCAL_UMODES = FLAG_LOCOP, /**< First local mode flag */
     FLAG_GLOBAL_UMODES = FLAG_OPER  /**< First global mode flag */
@@ -579,13 +587,28 @@ struct Client {
 #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 set mode +X (xtraop) */
+#define IsXtraOp(x)             HasFlag(x, FLAG_XTRAOP)
+/** Return non-zero if the client has set mode +n (hide channels) */
+#define IsNoChan(x)             HasFlag(x, FLAG_NOCHAN)
+/** Return non-zero if the client has set mode +I (hide idletime) */
+#define IsNoIdle(x)             HasFlag(x, FLAG_NOIDLE)
 /** Return non-zero if the client has an active PING request. */
 #define IsPingSent(x)           HasFlag(x, FLAG_PINGSENT)
+/** Return non-zero if the client should not receive privmsgs/notices
+ * from unauthed users */
+#define IsAccountOnly(x)        HasFlag(x, FLAG_ACCOUNTONLY)
+/** Return non-zero if the client should receive notices when someone
+ * does a whois on it. */
+#define IsParanoid(x)           HasFlag(x, FLAG_PARANOID)
 
 /** Return non-zero if the client has operator or server privileges. */
 #define IsPrivileged(x)         (IsAnOper(x) || IsServer(x))
 /** Return non-zero if the client's host is hidden. */
 #define HasHiddenHost(x)        (IsHiddenHost(x) && IsAccount(x))
+/** Return non-zero if the client is using a spoofhost */
+#define IsSetHost(x)            HasFlag(x, FLAG_SETHOST)
+#define HasSetHost(x)           (IsSetHost(x))
 
 /** Mark a client as having an in-progress net.burst. */
 #define SetBurst(x)             SetFlag(x, FLAG_BURST)
@@ -625,8 +648,20 @@ struct Client {
 #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 mode +h (spoofhost). */
+#define SetSetHost(x)           SetFlag(x, FLAG_SETHOST)
+/** Mark a client as having mode +X (xtraop). */
+#define SetXtraOp(x)            SetFlag(x, FLAG_XTRAOP)
+/** Mark a client as having mode +n (hide channels). */
+#define SetNoChan(x)            SetFlag(x, FLAG_NOCHAN)
+/** Mark a client as having mode +I (hide idletime). */
+#define SetNoIdle(x)            SetFlag(x, FLAG_NOIDLE)
 /** Mark a client as having a pending PING. */
 #define SetPingSent(x)          SetFlag(x, FLAG_PINGSENT)
+/** Mark a client as having mode +R (account only). */
+#define SetAccountOnly(x)       SetFlag(x, FLAG_ACCOUNTONLY)
+/** Mark a client as having mode +P (paranoid). */
+#define SetParanoid(x)          SetFlag(x, FLAG_PARANOID)
 
 /** Return non-zero if \a sptr sees \a acptr as an operator. */
 #define SeeOper(sptr,acptr) (IsAnOper(acptr) && (HasPriv(acptr, PRIV_DISPLAY) \
@@ -658,8 +693,20 @@ struct Client {
 #define ClearServNotice(x)      ClrFlag(x, FLAG_SERVNOTICE)
 /** Remove mode +x (hidden host) from the client. */
 #define ClearHiddenHost(x)      ClrFlag(x, FLAG_HIDDENHOST)
+/** Remove mode +h (spoofhost) from a client. */
+#define ClearSetHost(x)         ClrFlag(x, FLAG_SETHOST)
+/** Remove mode +X (xtraop) from a client. */
+#define ClearXtraOp(x)          ClrFlag(x, FLAG_XTRAOP)
+/** Remove mode +n (hide channels) from a client. */
+#define ClearNoChan(x)          ClrFlag(x, FLAG_NOCHAN)
+/** Remove mode +I (hide idletime) from a client. */
+#define ClearNoIdle(x)          ClrFlag(x, FLAG_NOIDLE)
 /** Clear the client's pending PING flag. */
 #define ClearPingSent(x)        ClrFlag(x, FLAG_PINGSENT)
+/** Remove mode +R (account only) from a client */
+#define ClearAccountOnly(x)     ClrFlag(x, FLAG_ACCOUNTONLY)
+/** Remove mode +P (paranoid) from a client */
+#define ClearParanoid(x)        ClrFlag(x, FLAG_PARANOID)
 
 /* free flags */
 #define FREEFLAG_SOCKET        0x0001  /**< socket needs to be freed */
@@ -704,7 +751,7 @@ struct Client {
 /** Server notice bits enabled by default for normal users. */
 #define SNO_DEFAULT (SNO_NETWORK|SNO_OPERKILL|SNO_GLINE)
 /** Server notice bits enabled by default for IRC operators. */
-#define SNO_OPERDEFAULT (SNO_DEFAULT|SNO_HACK2|SNO_HACK4|SNO_THROTTLE|SNO_OLDSNO)
+#define SNO_OPERDEFAULT (SNO_DEFAULT|SNO_HACK2|SNO_THROTTLE|SNO_OLDSNO)
 /** Server notice bits reserved to IRC operators. */
 #define SNO_OPER (SNO_CONNEXIT|SNO_OLDREALOP|SNO_AUTH)
 /** Noisy server notice bits that cause other bits to be cleared during connect. */