summaryrefslogtreecommitdiff
path: root/src/core/ns_set.c
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/core/ns_set.c
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/core/ns_set.c')
-rw-r--r--src/core/ns_set.c24
1 files changed, 24 insertions, 0 deletions
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 */