]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/chanserv.h
Couple of srvx updates.
[irc/evilnet/x3.git] / src / chanserv.h
index 89aea827c8371e403f1c06b37f27696abb5b1afe..1bd586891bd4bdda6933c69a18286d36c830e9ff 100644 (file)
@@ -3,9 +3,9 @@
  *
  * This file is part of x3.
  *
- * srvx is free software; you can redistribute it and/or modify
+ * x3 is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
 #include "nickserv.h"
 
 enum UL_ALIASES {
-    UL_PEON = 100,
+    UL_PEON = 1,
     UL_HALFOP = 150,
     UL_OP = 200,
     UL_MANAGER = 300,
-    UL_PRESENT = UL_MANAGER,
+    UL_PRESENT = UL_MANAGER, /* Level needed to keep the channel active */
     UL_COOWNER = 400,
     UL_OWNER = 500,
     UL_HELPER = 600,
 };
 
 enum levelOption {
-                    /* TODO: Does removing values here mess up reading the db files? */
-    lvlGiveVoice,   /* Depreciated */
-    lvlGiveHalfOps, /* Depreciated */
-    lvlGiveOps, /* Depreciated */
     lvlEnfOps,
     lvlEnfHalfOps,
     lvlEnfModes,
     lvlEnfTopic,
     lvlPubCmd,
     lvlSetters,
-    lvlCTCPUsers,
     lvlUserInfo,
     lvlInviteMe,
     lvlTopicSnarf,
@@ -53,11 +48,13 @@ enum levelOption {
 };
 
 enum charOption {
-    chVoice,
+    chAutomode,
     chProtect,
     chToys,
     chTopicRefresh,
     chCTCPReaction,
+    chBanTimeout,
+    chResync,
     NUM_CHAR_OPTIONS
 };
 
@@ -72,6 +69,8 @@ enum charOption {
 #define CHANNEL_PEON_INVITE     0x00000080 /* (1 << 7) - DEPRECATED */
 #define CHANNEL_OFFCHANNEL      0x00000100 /* (1 << 8) */
 #define CHANNEL_HOP_ALL         0x00000200 /* (1 << 9) */
+#define CHANNEL_UNREVIEWED      0x00000400 /* (1 << 10) */
+
 /* Flags with values over 0x20000000 or (1 << 29) will not work
  * because chanData.flags is a 30-bit field.
  */
@@ -101,19 +100,23 @@ struct chanData
     char               *registrar;
     char                *topic_mask;
 
+    unsigned int        maxsetinfo;
     unsigned int       flags : 30;
     unsigned int        may_opchan : 1;
     unsigned int        max;
     unsigned int        last_refresh;
-    unsigned short      banCount;
+    unsigned int        last_resync;
+    unsigned int        roulette_chamber;
+    unsigned short      banCount; /* Lamers, really */
     unsigned short      userCount;
     unsigned short      lvlOpts[NUM_LEVEL_OPTIONS];
     unsigned char       chOpts[NUM_CHAR_OPTIONS];
 
     struct userData    *users;
-    struct banData     *bans;
+    struct banData     *bans; /* Lamers, really */
     struct dict         *notes;
     struct suspended   *suspended;
+    struct giveownership *giveownership;
     struct chanData    *prev;
     struct chanData    *next;
 };
@@ -122,12 +125,14 @@ struct chanData
 #define USER_SUSPENDED          0x00000002
 #define USER_AUTO_INVITE        0x00000004
 #define USER_AUTO_OP            0x00000008
-#define USER_FLAGS_SIZE         15
+#define USER_AUTO_JOIN          0x00000010
+#define USER_FLAGS_SIZE         25
 #define USER_FLAGS_DEFAULT      USER_AUTO_OP
 
 #define IsUserAutoOp(USER)      ((USER)->flags & USER_AUTO_OP)
 #define IsUserSuspended(USER)   ((USER)->flags & USER_SUSPENDED)
 #define IsUserAutoInvite(USER)  ((USER)->flags & USER_AUTO_INVITE)
+#define IsUserAutoJoin(USER)    ((USER)->flags & USER_AUTO_JOIN)
 
 struct userData
 {
@@ -136,6 +141,10 @@ struct userData
 
     char               *info;
     time_t             seen;
+    time_t              expires;
+    time_t              accessexpiry;
+    time_t              clvlexpiry;
+    unsigned short      lastaccess;
     unsigned short      access;
     unsigned int       present : 1;
     unsigned int        flags : USER_FLAGS_SIZE;
@@ -184,14 +193,29 @@ struct suspended
     struct suspended    *previous;
 };
 
+struct giveownership
+{
+    char                 *staff_issuer;
+    char                  *old_owner;
+    char                  *target;
+    unsigned short        target_access;
+    time_t                issued;
+    char                  *reason;
+    struct giveownership  *previous;
+};
+
 struct do_not_register
 {
     char   chan_name[CHANNELLEN+1];
     char   setter[NICKSERV_HANDLE_LEN+1];
-    time_t set; 
+    time_t set, expires
     char   reason[1];
 };
 
+#define GetChannelUser(channel, handle) _GetChannelUser(channel, handle, 1, 0)
+struct userData *_GetChannelUser(struct chanData *channel, struct handle_info *handle, int override, int allow_suspended);
+struct banData *add_channel_ban(struct chanData *channel, const char *mask, char *owner, time_t set, time_t triggered, time_t expires, char *reason);
+
 void init_chanserv(const char *nick);
 void del_channel_user(struct userData *user, int do_gc);
 struct channelList *chanserv_support_channels(void);
@@ -205,4 +229,7 @@ char* user_level_name_from_level(int level);
 void process_adduser_pending(struct userNode *user);
 void wipe_adduser_pending(struct chanNode *channel, struct userNode *user);
 
+int check_bans(struct userNode *user, const char *channel);
+int trace_check_bans(struct userNode *user, struct chanNode *chan);
+
 #endif