/* Achievements: Nothing before ACHIEVEMENTS_START
* opt-in only after ACHIEVEMENTS_END
* Titles are valid only between ACHIEVEMENTS_START and ACHIEVEMENTS_END */
-#define ACHIEVEMENTS_START 1270076400
-#define ACHIEVEMENTS_END 1270162800
+
+//#define ACH_TEST_APRIL1
+
+#ifdef ACH_TEST_APRIL1
+
+#define ACHIEVEMENTS_START 1269702917
+#define ACHIEVEMENTS_END 1270162800
+
+#elif defined(ACH_TEST_POSTAPRIL1)
+
+#define ACHIEVEMENTS_START 0
+#define ACHIEVEMENTS_END 1269702917
+
+#else
+
+#define ACHIEVEMENTS_START 1270076400
+#define ACHIEVEMENTS_END 1270162800
+
+#endif
/* Mini-hash of known users on channels to make lookups faster;
* how big do we make it? */
#define CHALLENGEAUTHSITE "http://www.quakenet.org/development/challengeauth/"
/* Cleanup options */
-#define CLEANUP_ACCOUNT_INACTIVE 80
-#define CLEANUP_ACCOUNT_UNUSED 10
+#define CLEANUP_ACCOUNT_INACTIVE 180
+#define CLEANUP_ACCOUNT_UNUSED 3
#define CLEANUP_CHANNEL_INACTIVE 40
#define CLEANUP_AUTHHISTORY 60
+#define CLEANUP_MIN_CHAN_SIZE 2
+
/* Sizes of the main hashes */
#define REGUSERHASHSIZE 60000
#define MAILDOMAINHASHSIZE 60000
/* User flags */
-#define QUFLAG_NOINFO 0x0001 /* +s */
+/* to reenable this also grep for NOINFO... as some code has been commented out */
+//#define QUFLAG_NOINFO 0x0001 /* +s */
+#define QUFLAG_INACTIVE 0x0001 /* +I */
#define QUFLAG_GLINE 0x0002 /* +g */
#define QUFLAG_NOTICE 0x0004 /* +n */
#define QUFLAG_STAFF 0x0008 /* +q */
#define QUFLAG_TRUST 0x8000 /* +T */
#define QUFLAG_ALL 0xffff
-#define UIsNoInfo(x) ((x)->flags & QUFLAG_NOINFO)
+//#define UIsNoInfo(x) ((x)->flags & QUFLAG_NOINFO)
+#define UIsNoInfo(x) 0
+#define UIsInactive(x) ((x)->flags & QUFLAG_INACTIVE)
#define UIsGline(x) ((x)->flags & QUFLAG_GLINE)
#define UIsNotice(x) ((x)->flags & QUFLAG_NOTICE)
#define UIsSuspended(x) ((x)->flags & QUFLAG_SUSPENDED)
#define UHasOperPriv(x) ((x)->flags & (QUFLAG_OPER | QUFLAG_ADMIN | QUFLAG_DEV))
#define UHasAdminPriv(x) ((x)->flags & (QUFLAG_ADMIN | QUFLAG_DEV))
+#define USetInactive(x) ((x)->flags |= QUFLAG_INACTIVE)
#define USetGline(x) ((x)->flags |= QUFLAG_GLINE)
#define USetNotice(x) ((x)->flags |= QUFLAG_NOTICE)
#define USetSuspended(x) ((x)->flags |= QUFLAG_SUSPENDED)
#define USetCleanupExempt(x) ((x)->flags |= QUFLAG_CLEANUPEXEMPT)
#define USetTrust(x) ((x)->flags |= QUFLAG_TRUST)
+#define UClearInactive(x) ((x)->flags &= ~QUFLAG_INACTIVE)
#define UClearGline(x) ((x)->flags &= ~QUFLAG_GLINE)
#define UClearNotice(x) ((x)->flags &= ~QUFLAG_NOTICE)
#define UClearSuspended(x) ((x)->flags &= ~QUFLAG_SUSPENDED)
/* email */
#define MAX_RESEND_TIME 2*3600L /* cooling off period */
-#define VALID_EMAIL "^[-_.+[:alpha:][:digit:]]+(\\.[-_[:digit:][:alpha:]]+)*@([[:digit:][:alpha:]](-?[[:digit:][:alpha:]])*\\.)+[[:alpha:]]{2}([zmuvtgo]|fo|me|seum|op|ro)?$"
+#define VALID_EMAIL "^[-_.+[:alpha:][:digit:]]+(\\.[-_[:digit:][:alpha:]]+)*@([[:digit:][:alpha:]](-?[[:digit:][:alpha:]])*\\.)+[[:alpha:]]{2}([zmuvtgol]|fo|me|seum|op|ro)?$"
-#define VALID_ACCOUNT_NAME "^[-a-z0-9]*$"
+#define VALID_ACCOUNT_NAME "^[a-z][-a-z0-9]+$"
#define QMAIL_NEWACCOUNT 1 /* new account */
#define QMAIL_REQPW 2 /* requestpassword */
#define QMAIL_NEWPW 3 /* new password */
#define QMAIL_RESET 4 /* reset account */
#define QMAIL_NEWEMAIL 5 /* new email address */
+#define QMAIL_ACTIVATEEMAIL 6 /* new style new account */
/* Channel flags */
QCFLAG_PROTECT|QCFLAG_TOPICSAVE|QCFLAG_VOICEALL| \
QCFLAG_WELCOME|QCFLAG_KNOWNONLY|QCFLAG_ACHIEVEMENTS )
-#define QCFLAG_ALL 0x7fff
+#define QCFLAG_ALL 0xffff
/* Channel user ("chanlev") flags */
#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__)
+#define q9cleanup_asyncquery(handler, tag, format, ...) dbasyncqueryi(q9cleanupdbid, handler, tag, format , ##__VA_ARGS__)
/* chanservcrypto.c */
typedef int (*CRAlgorithm)(char *, const char *, const char *, const char *);
void cs_handleopchange(int hooknum, void *arg);
void cs_handlenewban(int hooknum, void *arg);
void cs_handlechanlostuser(int hooknum, void *arg);
+int cs_ischannelactive(channel *cp, regchan *rcp);
/* chanservmessages.c */
void initmessages();
u_int64_t cs_accountflagmap(reguser *rup);
u_int64_t cs_accountflagmap_str(char *flags);
+/* chanserv_cleanupdb.c */
+void cs_cleanupdb(nick *np);
+
#endif