1 allow usermodes +n and usermode +I to be auto set from the class block
3 diff -r 64e4811dd29a include/s_user.h
7 /* used for parsing user modes */
8 #define ALLOWMODES_ANY 0 /**< Allow any user mode */
9 #define ALLOWMODES_DEFAULT 1 /**< Only allow the subset of modes that are legit defaults */
10 +#define ALLOWMODES_AUTO 2 /**< Only allow auto modes */
12 /* return sets for umode_str() */
13 #define UMODE_ALL_PARAMS 0 /**< return the user modes and all parameters */
14 diff -r 64e4811dd29a ircd/s_user.c
19 char *umodev[] = { NULL, NULL, NULL, NULL };
21 - set_user_mode(cptr, sptr, 3, umodev, ALLOWMODES_ANY);
22 + set_user_mode(cptr, sptr, 3, umodev, ALLOWMODES_AUTO);
25 if (feature_bool(FEAT_AUTOINVISIBLE))
26 @@ -1355,9 +1355,11 @@
27 ClearChannelService(sptr);
28 if (!FlagHas(&setflags, FLAG_XTRAOP) && !(IsAnOper(sptr) && HasPriv(sptr, PRIV_XTRA_OPER)))
30 - if (!FlagHas(&setflags, FLAG_NOCHAN) && !(IsAnOper(sptr) || feature_bool(FEAT_USER_HIDECHANS)))
31 + /* user is an oper, or feature USER_HIDECHANS is TRUE, or the mode is auto set from the class block, else clear mode +n */
32 + if (!FlagHas(&setflags, FLAG_NOCHAN) && !(IsAnOper(sptr) || feature_bool(FEAT_USER_HIDECHANS) || allow_modes == ALLOWMODES_AUTO))
34 - if (!FlagHas(&setflags, FLAG_NOIDLE) && !((IsAnOper(sptr) && HasPriv(sptr, PRIV_NOIDLE)) || feature_bool(FEAT_USER_HIDEIDLETIME)))
35 + /* user is an oper with priv NOIDLE, or feature USER_HIDEIDLETIME is TRUE, or the mode is auto set from the class block, else clear mode +I */
36 + if (!FlagHas(&setflags, FLAG_NOIDLE) && !((IsAnOper(sptr) && HasPriv(sptr, PRIV_NOIDLE)) || feature_bool(FEAT_USER_HIDEIDLETIME) || allow_modes == ALLOWMODES_AUTO))
38 if (!FlagHas(&setflags, FLAG_PARANOID) && !(IsAnOper(sptr) && HasPriv(sptr, PRIV_PARANOID)))