]> jfr.im git - solanum.git/blobdiff - include/client.h
m_away: Add missing return value.
[solanum.git] / include / client.h
index 8af1709c78d1eabb709ddce768009b192fc2f338..d394103ad6acecc6b2d9042c5a55d37f0d3c74f3 100644 (file)
@@ -53,6 +53,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
  */
@@ -232,7 +237,7 @@ struct LocalUser
 
        struct DNSQuery *dnsquery; /* for outgoing server's name lookup */
 
-       time_t last_away;       /* Away since... */
+       time_t next_away;       /* Don't allow next away before... */
        time_t last;
 
        /* clients allowed to talk through +g */
@@ -247,18 +252,24 @@ struct LocalUser
         * to avoid flooding.
         *   -- adrian
         */
-       int allow_read;         /* how many we're allowed to read in this second */
-       int actually_read;      /* how many we've actually read in this second */
        int sent_parsed;        /* how many messages we've parsed in this second */
        time_t last_knock;      /* time of last knock */
        unsigned long random_ping;
        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 */
 
+       /* ratelimit items */
+       time_t ratelimit;
+       unsigned int join_who_credits;
+
        struct ListClient *safelist_data;
 
        char *mangledhost; /* non-NULL if host mangling module loaded and
@@ -294,10 +305,8 @@ struct ListClient
 {
        unsigned int hash_indice;
        unsigned int users_min, users_max;
-
-       /* It would be nice to add other modifiers,
-        * but not for 1.1 --nenolod
-        */
+       time_t created_min, created_max, topic_min, topic_max;
+       int operspy;
 };
 
 /*
@@ -394,6 +403,7 @@ struct ListClient
 #define FLAGS_SERVICE     0x200000     /* network service */
 #define FLAGS_TGCHANGE     0x400000    /* we're allowed to clear something */
 #define FLAGS_DYNSPOOF     0x800000    /* dynamic spoof, only opers see ip */
+#define FLAGS_TGEXCESSIVE  0x1000000   /* whether the client has attemped to change targets excessively fast */
 
 /* flags for local clients, this needs stuff moved from above to here at some point */
 #define LFLAGS_SSL             0x00000001
@@ -434,6 +444,9 @@ struct ListClient
 
 #define CLICAP_MULTI_PREFIX    0x0001
 #define CLICAP_SASL            0x0002
+#define CLICAP_ACCOUNT_NOTIFY  0x0004
+#define CLICAP_EXTENDED_JOIN   0x0008
+#define CLICAP_AWAY_NOTIFY     0x0010
 
 /*
  * flags macros.
@@ -468,6 +481,9 @@ struct ListClient
 #define IsDynSpoof(x)          ((x)->flags & FLAGS_DYNSPOOF)
 #define SetDynSpoof(x)         ((x)->flags |= FLAGS_DYNSPOOF)
 #define ClearDynSpoof(x)       ((x)->flags &= ~FLAGS_DYNSPOOF)
+#define IsTGExcessive(x)       ((x)->flags & FLAGS_TGEXCESSIVE)
+#define SetTGExcessive(x)      ((x)->flags |= FLAGS_TGEXCESSIVE)
+#define ClearTGExcessive(x)    ((x)->flags &= ~FLAGS_TGEXCESSIVE)
 
 /* local flags */
 
@@ -550,6 +566,7 @@ extern void check_klines_event(void *unused);
 extern void check_klines(void);
 extern void check_dlines(void);
 extern void check_xlines(void);
+extern void resv_nick_fnc(const char *mask, const char *reason, int temp_time);
 
 extern const char *get_client_name(struct Client *client, int show_ip);
 extern const char *log_client_name(struct Client *, int);