]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - include/client.h
A few more fixes. Part 3 of 2 I suppose.
[irc/rqf/shadowircd.git] / include / client.h
index 508b9db25cd034aa3e1b0b3677125ef87da29154..da61c85b75dd8f3c3e06ffb6d7fa0d49c7412b19 100644 (file)
@@ -22,7 +22,6 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- *  $Id: client.h 3446 2007-05-14 22:21:16Z jilles $
  */
 
 #ifndef INCLUDED_client_h
@@ -53,6 +52,11 @@ struct Blacklist;
 
 #define IDLEN          10
 
+#define TGCHANGE_NUM           10      /* how many targets we keep track of */
+#define TGCHANGE_REPLY         5       /* how many reply targets */
+#define TGCHANGE_INITIAL       10      /* initial free targets (normal) */
+#define TGCHANGE_INITIAL_LOW   4       /* initial free targets (possible spambot) */
+
 /*
  * pre declare structs
  */
@@ -79,6 +83,8 @@ struct User
        char *away;             /* pointer to away message */
        int refcnt;             /* Number of times this block is referenced */
 
+       struct Dictionary *metadata;
+
        char suser[NICKLEN+1];
 };
 
@@ -161,6 +167,7 @@ struct Client
        struct PreClient *preClient;
 
        time_t large_ctcp_sent; /* ctcp to large group sent, relax flood checks */
+       char *certfp; /* client certificate fingerprint */
 };
 
 struct LocalUser
@@ -254,8 +261,12 @@ struct LocalUser
        struct AuthRequest *auth_request;
 
        /* target change stuff */
-       uint32_t targets[10];           /* targets were aware of (fnv32(use_id(target_p))) */
-       unsigned int targinfo[2];       /* cyclic array, no in use */
+       /* targets we're aware of (fnv32(use_id(target_p))):
+        * 0..TGCHANGE_NUM-1 regular slots
+        * TGCHANGE_NUM..TGCHANGE_NUM+TGCHANGE_REPLY-1 reply slots
+        */
+       uint32_t targets[TGCHANGE_NUM + TGCHANGE_REPLY];
+       unsigned int targets_free;      /* free targets */
        time_t target_last;             /* last time we cleared a slot */
 
        struct ListClient *safelist_data;
@@ -271,6 +282,8 @@ struct LocalUser
        struct ev_entry *event;                 /* used for associated events */
 
        struct PrivilegeSet *privset;           /* privset... */
+
+       struct ev_entry *override_timeout_event;
 };
 
 struct PreClient
@@ -411,11 +424,18 @@ struct ListClient
 #define UMODE_DEAF        0x0080
 #define UMODE_NOFORWARD    0x0100      /* don't forward */
 #define UMODE_REGONLYMSG   0x0200      /* only allow logged in users to msg */
+#define UMODE_NOCTCP      0x0400       /* block CTCPs except for ACTION */
+#define UMODE_NOINVITE    0x0800       /* block invites */
+#define UMODE_BOT         0x8000       /* mark as a bot in whois */
+#define UMODE_SCALLERID    0x40000     /* soft caller id */
 
 /* user information flags, only settable by remote mode or local oper */
 #define UMODE_OPER         0x1000      /* Operator */
 #define UMODE_ADMIN        0x2000      /* Admin on server */
 #define UMODE_SSLCLIENT    0x4000      /* using SSL */
+#define UMODE_OVERRIDE     0x20000  /* able to override */
+
+#define IsOverride(x)      ((x)->umodes & UMODE_OVERRIDE)
 
 /* overflow flags */
 /* EARLIER FLAGS ARE IN s_newconf.h */
@@ -504,6 +524,10 @@ struct ListClient
 #define IsDeaf(x)              ((x)->umodes & UMODE_DEAF)
 #define IsNoForward(x)         ((x)->umodes & UMODE_NOFORWARD)
 #define IsSetRegOnlyMsg(x)     ((x)->umodes & UMODE_REGONLYMSG)
+#define IsSetNoCTCP(x)         ((x)->umodes & UMODE_NOCTCP)
+#define IsSetNoInvite(x)       ((x)->umodes & UMODE_NOINVITE)
+#define IsSetBot(x)            ((x)->umodes & UMODE_BOT)
+#define IsSetSCallerId(x)      ((x)->umodes & UMODE_SCALLERID)
 
 #define SetGotId(x)             ((x)->flags |= FLAGS_GOTID)
 #define IsGotId(x)              (((x)->flags & FLAGS_GOTID) != 0)
@@ -590,4 +614,9 @@ extern char *generate_uid(void);
 void allocate_away(struct Client *);
 void free_away(struct Client *);
 
+extern struct Metadata *user_metadata_add(struct Client *target, const char *name, const char *value, int propegate);
+extern void user_metadata_delete(struct Client *target, const char *name, int propegate);
+extern struct Metadata *user_metadata_find(struct Client *target, const char *name);
+extern void user_metadata_clear(struct Client *target);
+
 #endif /* INCLUDED_client_h */