]> jfr.im git - irc/quakenet/newserv.git/blobdiff - chanserv/chanserv.h
Various changes to support authname being stored inside the authext.
[irc/quakenet/newserv.git] / chanserv / chanserv.h
index 5673151c99392cd64ced1ec239986aeb0836d905..8b0d8b8455462066435bf6429915b78a0ebf0d09 100644 (file)
@@ -18,7 +18,7 @@
 #include "../channel/channel.h"
 #include "../parser/parser.h"
 #include "../localuser/localuserchannel.h"
-#include "../pqsql/pqsql.h"
+#include "../dbapi/dbapi.h"
 
 #define CS_PARANOID
 
@@ -27,7 +27,7 @@
 #endif
 
 /* Q9 Version */
-#define QVERSION "1.00-RC1"
+#define QVERSION "1.00"
 
 /* Mini-hash of known users on channels to make lookups faster;
  * how big do we make it?  */
 /* If set will issue warnings when authgate cached stuff changes */
 #define   AUTHGATE_WARNINGS
 
+/* Challenge auth faq site */
+#define   CHALLENGEAUTHSITE "http://www.quakenet.org/development/challengeauth/"
+
 /* Cleanup options */
 #define CLEANUP_ACCOUNT_INACTIVE  80
 #define CLEANUP_ACCOUNT_UNUSED    10
-#define CLEANUP_CHANNEL_INACTIVE  30
+#define CLEANUP_CHANNEL_INACTIVE  40
 
 /* Sizes of the main hashes */
 #define   REGUSERHASHSIZE     60000
@@ -75,7 +78,7 @@
 #define MAXLANG      50
 
 /* Maximum number of user chanlevs and bans */
-#define MAXCHANLEVS  250
+#define MAXCHANLEVS  500
 #define MAXBANS      50
 
 /* Sources of entropy and standard length defines */
 #define   QPRIV_VIEWWELCOME         107
 #define   QPRIV_VIEWCOMMENTS        108
 #define   QPRIV_VIEWEMAIL           109
+#define   QPRIV_VIEWCHANSUSPENSION  110
+#define   QPRIV_VIEWSUSPENDEDBY     111
 
 #define   QPRIV_CHANGECHANFLAGS     200
 #define   QPRIV_CHANGECHANLEV       201
 #define   QUFLAG_NOINFO        0x0001  /* +s */
 #define   QUFLAG_GLINE         0x0002  /* +g */
 #define   QUFLAG_NOTICE        0x0004  /* +n */
-/* SPARE FLAG                  0x0008 */
+#define   QUFLAG_STAFF         0x0008  /* +q */
 #define   QUFLAG_SUSPENDED     0x0010  /* +z */
 #define   QUFLAG_OPER          0x0020  /* +o */
 #define   QUFLAG_DEV           0x0040  /* +d */
 #define   QUFLAG_NOAUTHLIMIT   0x1000  /* +L */
 #define   QUFLAG_CLEANUPEXEMPT 0x4000  /* +D */
 #define   QUFLAG_TRUST         0x8000  /* +T */
-#define   QUFLAG_ALL           0xdff7
+#define   QUFLAG_ALL           0xdfff
 
 #define UIsNoInfo(x)        ((x)->flags & QUFLAG_NOINFO)
 #define UIsGline(x)         ((x)->flags & QUFLAG_GLINE)
 #define UIsDelayedGline(x)  ((x)->flags & QUFLAG_DELAYEDGLINE)
 #define UIsNoAuthLimit(x)   ((x)->flags & QUFLAG_NOAUTHLIMIT)
 #define UIsCleanupExempt(x) ((x)->flags & QUFLAG_CLEANUPEXEMPT)
+#define UIsStaff(x)         ((x)->flags & QUFLAG_STAFF)
 
 #define UHasSuspension(x)   ((x)->flags & (QUFLAG_GLINE|QUFLAG_DELAYEDGLINE|QUFLAG_SUSPENDED))
 
+#define UHasStaffPriv(x)    ((x)->flags * (QUFLAG_STAFF | QUFLAG_HELPER | QUFLAG_OPER | QUFLAG_ADMIN | QUFLAG_DEV))
 #define UHasHelperPriv(x)   ((x)->flags & (QUFLAG_HELPER | QUFLAG_OPER | QUFLAG_ADMIN | QUFLAG_DEV))
 #define UHasOperPriv(x)     ((x)->flags & (QUFLAG_OPER | QUFLAG_ADMIN | QUFLAG_DEV))
 #define UHasAdminPriv(x)    ((x)->flags & (QUFLAG_ADMIN | QUFLAG_DEV))
@@ -448,7 +455,7 @@ typedef struct regchan {
   flag_t              forcemodes;      /* Forced modes */
   flag_t              denymodes;       /* Denied modes */
 
-  short               limit;           /* Limit to enforce if +l is set */
+  unsigned short      limit;           /* Limit to enforce if +l is set */
   short               autolimit;       /* How many slots to leave when autolimiting */
   short               banstyle;        /* Ban style for +b type bans */
 
@@ -644,7 +651,7 @@ extern unsigned int lastmaillockID;
 
 extern int chanserv_init_status;
 extern int chanservdb_ready;
-extern PQModuleIdentifier q9pqid, q9apqid, q9cpqid, q9upqid;
+extern DBModuleIdentifier q9dbid, q9adbid, q9cdbid, q9udbid;
 
 extern maildomain *maildomainnametable[MAILDOMAINHASHSIZE];
 extern maildomain *maildomainIDtable[MAILDOMAINHASHSIZE];
@@ -673,6 +680,8 @@ extern sstring **chantypes;
 
 extern maillock *maillocks;
 
+extern sstring *cs_quitreason;
+
 /* Function prototypes */
 
 /* chanserv.c */
@@ -747,10 +756,10 @@ char *csdb_gethelpstr(char *command, int language);
 void csdb_createmail(reguser *rup, int type);
 void csdb_dohelp(nick *np, Command *cmd);
 
-#define q9asyncquery(handler, tag, format, ...) pqasyncqueryi(q9pqid, handler, tag, format , ##__VA_ARGS__)
-#define q9a_asyncquery(handler, tag, format, ...) pqasyncqueryi(q9apqid, handler, tag, format , ##__VA_ARGS__)
-#define q9u_asyncquery(handler, tag, format, ...) pqasyncqueryi(q9upqid, handler, tag, format , ##__VA_ARGS__)
-#define q9c_asyncquery(handler, tag, format, ...) pqasyncqueryi(q9cpqid, handler, tag, format , ##__VA_ARGS__)
+#define q9asyncquery(handler, tag, format, ...) dbasyncqueryi(q9dbid, handler, tag, format , ##__VA_ARGS__)
+#define q9a_asyncquery(handler, tag, format, ...) dbasyncqueryi(q9adbid, handler, tag, format , ##__VA_ARGS__)
+#define q9u_asyncquery(handler, tag, format, ...) dbasyncqueryi(q9udbid, handler, tag, format , ##__VA_ARGS__)
+#define q9c_asyncquery(handler, tag, format, ...) dbasyncqueryi(q9cdbid, handler, tag, format , ##__VA_ARGS__)
 
 /* chanservcrypto.c */
 typedef int (*CRAlgorithm)(char *, const char *, const char *, const char *);
@@ -808,6 +817,7 @@ void cs_logchanop(regchan *rcp, char *nick, reguser *rup);
 int cs_doshowcommands(void *source, int cargc, char **cargv);
 int cs_dohelp(void *source, int cargc, char **cargv);
 int cs_doquit(void *source, int cargc, char **cargv);
+int cs_dosetquitreason(void *source, int cargc, char **cargv);
 int cs_dorename(void *source, int cargc, char **cargv);
 int cs_dorehash(void *source, int cargc, char **cargv);
 int cs_doversion(void *source, int cargc, char **cargv);
@@ -885,4 +895,9 @@ void csdb_updatemaillock(maillock *mlp);
 /* q9snprintf.c */
 void q9snprintf(char *buf, size_t size, const char *format, const char *args, ...);
 void q9vsnprintf(char *buf, size_t size, const char *format, const char *args, va_list ap);
+
+/* chanserv_flags.c */
+flag_t cs_accountflagmap(reguser *rup);
+flag_t cs_accountflagmap_str(char *flags);
+
 #endif