diff --git a/src/auth.c b/src/auth.c index b60032f..b44984f 100644 --- a/src/auth.c +++ b/src/auth.c @@ -282,6 +282,7 @@ void aucheck(User *user) if (au_channel) { + /* does the user record have channel access? */ for(ump=user->chan;ump;ump=ump->next) { if (*ump->p == '*' || !stringcasecmp(au_channel,ump->p)) diff --git a/src/gencmd.c b/src/gencmd.c index b80c3ac..7f20e0d 100644 --- a/src/gencmd.c +++ b/src/gencmd.c @@ -391,24 +391,20 @@ void make_usercombo(void) to_file(fd,"/""* This file is automatically generated from gencmd.c *""/\n"); -#ifdef BOTNET + /* dont gatekeep these flags with ifdefs, + make userfiles compatible between different compiles */ combo.comboflags = 0; combo.x.noshare = 1; to_file(fd,"#define COMBO_NOSHARE\t0x%x\n",combo.comboflags); combo.comboflags = 0; combo.x.readonly = 1; to_file(fd,"#define COMBO_READONLY\t0x%x\n",combo.comboflags); -#endif /* BOTNET */ -#ifdef GREET combo.comboflags = 0; combo.x.greetfile = 1; to_file(fd,"#define COMBO_GREETFILE\t0x%x\n",combo.comboflags); combo.comboflags = 0; combo.x.randline = 1; to_file(fd,"#define COMBO_RANDLINE\t0x%x\n",combo.comboflags); -#endif /* GREET */ -#ifdef BOUNCE combo.comboflags = 0; combo.x.bounce = 1; to_file(fd,"#define COMBO_BOUNCE\t0x%x\n",combo.comboflags); -#endif /* BOUNCE */ combo.comboflags = 0; combo.x.echo = 1; to_file(fd,"#define COMBO_ECHO\t0x%x\n",combo.comboflags); diff --git a/src/structs.h b/src/structs.h index 31682ea..c6f5317 100644 --- a/src/structs.h +++ b/src/structs.h @@ -50,31 +50,6 @@ typedef struct Mix64 } Mix64; -typedef union usercombo -{ - struct - { - uint32_t access:8, /* access level (0-200) [0-255] */ - prot:3, /* protlevel (0-4) [0-7] */ -#ifdef BOTNET - noshare:1, /* dont share this user over botnet */ - readonly:1, /* botnet cannot alter this user */ -#endif /* BOTNET */ -#ifdef GREET - greetfile:1, /* greeting is filename */ - randline:1, /* grab random line from filename */ -#endif /* GREET */ -#ifdef BOUNCE - bounce:1, /* user has access to bouncer */ -#endif /* BOUNCE */ - echo:1, /* partyline echo of own messages */ - aop:1, /* auto-opping */ - avoice:1; /* auto-voicing */ - } x; - uint32_t comboflags; - -} usercombo; - typedef struct OnMsg { const char *name; @@ -101,8 +76,6 @@ typedef struct OnMsg typedef unsigned char OnMsg_access; -#ifndef GENCMD_C - typedef struct ircLink { struct ircLink *next; @@ -273,6 +246,28 @@ typedef struct Shit } Shit; +typedef union usercombo +{ + struct + { + /* dont gatekeep these flags with ifdefs, + make userfiles compatible between different compiles */ + uint32_t access:8, /* access level (0-200) [0-255] */ + prot:3, /* protlevel (0-4) [0-7] */ + noshare:1, /* dont share this user over botnet */ + readonly:1, /* botnet cannot alter this user */ + greetfile:1, /* greeting is filename */ + randline:1, /* grab random line from filename */ + bounce:1, /* user has access to bouncer */ + echo:1, /* partyline echo of own messages */ + aop:1, /* auto-opping */ + avoice:1; /* auto-voicing */ + } x; + uint32_t comboflags; + +} usercombo; + +#ifndef GENCMD_C /* * this struct is put to use in global.h @@ -595,18 +590,16 @@ typedef struct Mech #endif /* NOTIFY */ time_t lastreset; /* last time bot was reset */ + time_t ontime; /* how long the bot has been connected */ time_t lastantiidle; /* avoid showing large idle times */ + time_t activity; /* Away timer (AAWAY) */ time_t lastrejoin; /* last time channels were reset */ #ifdef CHANBAN time_t lastchanban; /* last time a chanban check was run */ #endif /* CHANBAN */ - time_t conntry; /* when connect try started */ /* re-used for server activity once connected */ int heartbeat; /* handle server timeout stuff */ - time_t activity; /* Away timer (AAWAY) */ - - time_t ontime; /* how long the bot has been connected */ #ifdef IRCD_EXTENSIONS int ircx_flags; diff --git a/src/user.c b/src/user.c index fd40f11..258ba81 100644 --- a/src/user.c +++ b/src/user.c @@ -83,20 +83,16 @@ LS struct int modeflag; } cfg_opt_flags[] = +/* dont gatekeep these flags with ifdefs, + make userfiles compatible between different compiles */ { { 'a', COMBO_AOP }, -#ifdef BOUNCE { 'b', COMBO_BOUNCE }, -#endif /* BOUNCE */ { 'e', COMBO_ECHO }, -#ifdef BOTNET { 'L', COMBO_NOSHARE }, { 'R', COMBO_READONLY }, -#endif /* BOTNET */ -#ifdef GREET { 'g', COMBO_GREETFILE }, { 'r', COMBO_RANDLINE }, -#endif /* GREET */ { 'v', COMBO_AVOICE }, { 0, 0, }};