diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/channels.c | 3 | ||||
-rw-r--r-- | src/config.c | 4 | ||||
-rw-r--r-- | src/core/ns_set.c | 24 |
3 files changed, 30 insertions, 1 deletions
diff --git a/src/channels.c b/src/channels.c index d734f35f1..f174eb54f 100644 --- a/src/channels.c +++ b/src/channels.c @@ -1368,7 +1368,8 @@ void chan_set_correct_modes(User * user, Channel * c, int give_modes) if (debug) alog("debug: Setting correct user modes for %s on %s (current status: %d, %sgiving modes)", user->nick, c->name, status, (give_modes ? "" : "not ")); - if (give_modes && (get_ignore(user->nick) == NULL)) { + if (give_modes && (get_ignore(user->nick) == NULL) + && (user->na && !(user->na->nc->flags & NI_AUTOOP))) { if (ircd->owner && is_founder(user, ci)) add_modes |= CUS_OWNER; else if ((ircd->protect || ircd->admin) diff --git a/src/config.c b/src/config.c index 9c7c34670..a4f0533be 100644 --- a/src/config.c +++ b/src/config.c @@ -145,6 +145,7 @@ int NSDefMemoSignon; int NSDefMemoReceive; int NSDefFlags; int NSDefLanguage; +int NSDefAutoop; int NSRegDelay; int NSResendDelay; int NSExpire; @@ -545,6 +546,7 @@ Directive directives[] = { {"NSDefNone", {{PARAM_SET, PARAM_RELOAD, &NSDefNone}}}, {"NSDefPrivate", {{PARAM_SET, PARAM_RELOAD, &NSDefPrivate}}}, {"NSDefSecure", {{PARAM_SET, PARAM_RELOAD, &NSDefSecure}}}, + {"NSDefAutoop", {{PARAM_SET, PARAM_RELOAD, &NSDefAutoop}}}, {"NSEnforcerUser", {{PARAM_STRING, PARAM_RELOAD, &temp_nsuserhost}}}, {"NSExpire", {{PARAM_TIME, PARAM_RELOAD, &NSExpire}}}, {"NSRExpire", {{PARAM_TIME, PARAM_RELOAD, &NSRExpire}}}, @@ -1131,6 +1133,8 @@ int read_config(int reload) NSDefFlags |= NI_MEMO_SIGNON; if (NSDefMemoReceive) NSDefFlags |= NI_MEMO_RECEIVE; + if (!NSDefAutoop) + NSDefFlags |= NI_AUTOOP; } if (!ServicesRoot) { diff --git a/src/core/ns_set.c b/src/core/ns_set.c index 9b4b309f5..4908cce8c 100644 --- a/src/core/ns_set.c +++ b/src/core/ns_set.c @@ -31,6 +31,7 @@ int do_set_secure(User * u, NickCore * nc, char *param); int do_set_private(User * u, NickCore * nc, char *param); int do_set_msg(User * u, NickCore * nc, char *param); int do_set_hide(User * u, NickCore * nc, char *param); +int do_set_autoop(User *u, NickCore *nc, char *param); void myNickServHelp(User * u); /** @@ -161,6 +162,8 @@ int do_set(User * u) do_set_msg(u, na->nc, param); } else if (stricmp(cmd, "HIDE") == 0) { do_set_hide(u, na->nc, param); + } else if (stricmp(cmd, "AUTOOP") == 0) { + do_set_autoop(u, na->nc, param); } else { notice_lang(s_NickServ, u, NICK_SET_UNKNOWN_OPTION, cmd); } @@ -449,4 +452,25 @@ int do_set_hide(User * u, NickCore * nc, char *param) return MOD_CONT; } +int do_set_autoop(User *u, NickCore *nc, char *param) { + + /** + * This works the other way around, the absence of this flag denotes ON + * This is so when people upgrade, and dont have the flag + * the default is on + **/ + if (stricmp(param, "ON") == 0) { + nc->flags &= ~NI_AUTOOP; + notice_lang(s_NickServ, u, NICK_SET_AUTOOP_ON); + } else if (stricmp(param, "OFF") == 0) { + nc->flags |= NI_AUTOOP; + notice_lang(s_NickServ, u, NICK_SET_AUTOOP_OFF); + } else { + syntax_error(s_NickServ, u, "SET AUTOOP", NICK_SET_AUTOOP_SYNTAX); + } + + return MOD_CONT; +} + + /* EOF */ |