Get rid of remaining tabs and replace them with spaces.
[srvx.git] / src / chanserv.h
index 4f6aaa66c01c7423ec006b3e2b422ce8ec80bef2..dddc71257fe2d448d3756441d860c9156d4b9c97 100644 (file)
@@ -1,11 +1,12 @@
 /* chanserv.h - Channel service bot
  * Copyright 2000-2004 srvx Development Team
  *
- * This program is free software; you can redistribute it and/or modify
+ * This file is part of srvx.
+ *
+ * srvx 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
- * (at your option) any later version.  Important limitations are
- * listed in the COPYING file that accompanies this software.
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -13,7 +14,8 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, email srvx-maintainers@srvx.net.
+ * along with srvx; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
 
 #ifndef _chanserv_h
@@ -32,6 +34,7 @@ enum UL_ALIASES {
 };
 
 enum levelOption {
+    lvlGiveVoice,
     lvlGiveOps,
     lvlEnfOps,
     lvlEnfModes,
@@ -39,6 +42,9 @@ enum levelOption {
     lvlPubCmd,
     lvlSetters,
     lvlCTCPUsers,
+    lvlUserInfo,
+    lvlInviteMe,
+    lvlTopicSnarf,
     NUM_LEVEL_OPTIONS
 };
 
@@ -50,37 +56,41 @@ enum charOption {
     NUM_CHAR_OPTIONS
 };
 
-#define CHANNEL_NODELETE       0x00000001 /* (1 << 0) */
-#define CHANNEL_SUSPENDED      0x00000002 /* (1 << 1) */
-#define CHANNEL_INFO_LINES     0x00000004 /* (1 << 2) */
-#define CHANNEL_VOICE_ALL      0x00000008 /* (1 << 3) */
+#define CHANNEL_NODELETE    0x00000001 /* (1 << 0) */
+#define CHANNEL_SUSPENDED   0x00000002 /* (1 << 1) */
+#define CHANNEL_INFO_LINES  0x00000004 /* (1 << 2) - DEPRECATED */
+#define CHANNEL_VOICE_ALL   0x00000008 /* (1 << 3) - DEPRECATED */
 /* No longer used. */                      /* (1 << 4) */
-#define CHANNEL_DYNAMIC_LIMIT  0x00000020 /* (1 << 5) */
-#define CHANNEL_TOPIC_SNARF    0x00000040 /* (1 << 6) */
-#define CHANNEL_PEON_INVITE     0x00000080 /* (1 << 7) */
+#define CHANNEL_DYNAMIC_LIMIT   0x00000020 /* (1 << 5) */
+#define CHANNEL_TOPIC_SNARF     0x00000040 /* (1 << 6) - DEPRECATED */
+#define CHANNEL_PEON_INVITE     0x00000080 /* (1 << 7) - DEPRECATED */
+#define CHANNEL_OFFCHANNEL      0x00000100 /* (1 << 8) */
+#define CHANNEL_UNREVIEWED      0x00000200 /* (1 << 9) */
 /* Flags with values over 0x20000000 or (1 << 29) will not work
  * because chanData.flags is a 30-bit field.
  */
 
-#define IsProtected(x)         ((x)->flags & CHANNEL_NODELETE)
-#define IsSuspended(x)         ((x)->flags & CHANNEL_SUSPENDED)
+#define IsProtected(x)  ((x)->flags & CHANNEL_NODELETE)
+#define IsSuspended(x)  ((x)->flags & CHANNEL_SUSPENDED)
+#define IsOffChannel(x) (((x)->flags & CHANNEL_OFFCHANNEL) && (off_channel > 1))
 
 struct chanData
 {
-    struct chanNode    *channel;
+    struct chanNode     *channel;
     struct mod_chanmode modes;
 
-    time_t             registered;
-    time_t             visited;
-    time_t             limitAdjusted;
+    time_t  registered;
+    time_t  visited;
+    time_t  limitAdjusted;
+    time_t  ownerTransfer;
 
-    char               *topic;
-    char               *greeting;
-    char               *user_greeting;
-    char               *registrar;
-    char                *topic_mask;
+    char    *topic;
+    char    *greeting;
+    char    *user_greeting;
+    char    *registrar;
+    char    *topic_mask;
 
-    unsigned int       flags : 30;
+    unsigned int        flags : 30;
     unsigned int        may_opchan : 1;
     unsigned int        max;
     unsigned int        last_refresh;
@@ -89,12 +99,12 @@ struct chanData
     unsigned short      lvlOpts[NUM_LEVEL_OPTIONS];
     unsigned char       chOpts[NUM_CHAR_OPTIONS];
 
-    struct userData    *users;
-    struct banData     *bans;
+    struct userData     *users;
+    struct banData      *bans;
     struct dict         *notes;
-    struct suspended   *suspended;
-    struct chanData    *prev;
-    struct chanData    *next;
+    struct suspended    *suspended;
+    struct chanData     *prev;
+    struct chanData     *next;
 };
 
 #define USER_AUTO_OP            0x00000001
@@ -108,18 +118,18 @@ struct chanData
 
 struct userData
 {
-    struct handle_info *handle;
-    struct chanData    *channel;
+    struct handle_info  *handle;
+    struct chanData     *channel;
 
-    char               *info;
-    time_t             seen;
+    char                *info;
+    time_t              seen;
     unsigned short      access;
-    unsigned int       present : 1;
+    unsigned int        present : 1;
     unsigned int        flags : USER_FLAGS_SIZE;
 
     /* linked list of userDatas for a chanData */
-    struct userData    *prev;
-    struct userData    *next;
+    struct userData     *prev;
+    struct userData     *next;
     /* linked list of userDatas for a handle_info */
     struct userData     *u_prev;
     struct userData     *u_next;
@@ -127,24 +137,24 @@ struct userData
 
 struct banData
 {
-    char               mask[NICKLEN + USERLEN + HOSTLEN + 3];
-    char               owner[NICKLEN+1];
-    struct chanData     *channel;
+    char            mask[NICKLEN + USERLEN + HOSTLEN + 3];
+    char            owner[NICKLEN+1];
+    struct chanData *channel;
 
-    time_t             set;
-    time_t             triggered;
-    time_t              expires;
+    time_t          set;
+    time_t          triggered;
+    time_t          expires;
 
-    char               *reason;
+    char            *reason;
 
-    struct banData     *prev;
-    struct banData     *next;
+    struct banData  *prev;
+    struct banData  *next;
 };
 
 struct suspended
 {
-    struct chanData    *cData;
-    char               *suspender;
+    struct chanData     *cData;
+    char                *suspender;
     char                *reason;
     time_t              issued, expires, revoked;
     struct suspended    *previous;
@@ -154,7 +164,7 @@ 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];
 };