summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrob rob@31f1291d-b8d6-0310-a050-a5561fc1590b <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2006-07-10 18:12:28 +0000
committerrob rob@31f1291d-b8d6-0310-a050-a5561fc1590b <rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2006-07-10 18:12:28 +0000
commit9d4d4e7287499f820285deaf0300602f1392a26f (patch)
tree1e1bd7cc0a2c91d10df0ed169135ceee683d590f /src
parentb79837538f03ad47506abc53a86c7a54d90d4cf5 (diff)
BUILD : 1.7.14 (1082) BUGS : 423 NOTES : Moved ns_noop into core, its now a /ns set option.
git-svn-id: svn://svn.anope.org/anope/trunk@1082 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@806 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/channels.c3
-rw-r--r--src/config.c4
-rw-r--r--src/core/ns_set.c24
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 */