mirror of
https://github.com/anope/anope.git
synced 2026-07-05 08:33:12 +02:00
BUILD : 1.7.21 (1389) BUGS : 872 NOTES : Added NS SASET LANGUAGE
git-svn-id: svn://svn.anope.org/anope/trunk@1389 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1104 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
parent
a8c90154f3
commit
f3d1f178dc
+30
-4
@@ -30,6 +30,7 @@ int do_saset_msg(User * u, NickCore * nc, char *param);
|
||||
int do_saset_hide(User * u, NickCore * nc, char *param);
|
||||
int do_saset_noexpire(User * u, NickAlias * nc, char *param);
|
||||
int do_saset_autoop(User * u, NickCore * nc, char *param);
|
||||
int do_saset_language(User * u, NickCore * nc, char *param);
|
||||
void myNickServHelp(User * u);
|
||||
|
||||
/**
|
||||
@@ -90,6 +91,9 @@ int AnopeInit(int argc, char **argv)
|
||||
-1, NICK_HELP_SASET_AUTOOP,
|
||||
NICK_HELP_SASET_AUTOOP);
|
||||
moduleAddCommand(NICKSERV, c, MOD_UNIQUE);
|
||||
c = createCommand("SASET LANGUAGE", NULL, is_services_oper,
|
||||
-1, -1, -1, -1, NICK_HELP_SASET_LANGUAGE);
|
||||
moduleAddCommand(NICKSERV, c, MOD_UNIQUE);
|
||||
|
||||
moduleSetNickHelp(myNickServHelp);
|
||||
|
||||
@@ -180,6 +184,8 @@ int do_saset(User * u)
|
||||
do_saset_noexpire(u, na, param);
|
||||
} else if (stricmp(cmd, "AUTOOP") == 0) {
|
||||
do_saset_autoop(u, na->nc, param);
|
||||
} else if (stricmp(cmd, "LANGUAGE") == 0) {
|
||||
do_saset_language(u, na->nc, param);
|
||||
} else {
|
||||
notice_lang(s_NickServ, u, NICK_SASET_UNKNOWN_OPTION, cmd);
|
||||
}
|
||||
@@ -231,10 +237,10 @@ int do_saset_password(User * u, NickCore * nc, char *param)
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
if (len > PASSMAX) {
|
||||
len = PASSMAX;
|
||||
param[len] = 0;
|
||||
notice_lang(s_NickServ, u, PASSWORD_TRUNCATED, PASSMAX);
|
||||
if (len > PASSMAX) {
|
||||
len = PASSMAX;
|
||||
param[len] = 0;
|
||||
notice_lang(s_NickServ, u, PASSWORD_TRUNCATED, PASSMAX);
|
||||
}
|
||||
|
||||
if (nc->pass)
|
||||
@@ -512,5 +518,25 @@ int do_saset_autoop(User * u, NickCore * nc, char *param)
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
int do_saset_language(User * u, NickCore * nc, char *param)
|
||||
{
|
||||
int langnum;
|
||||
|
||||
if (param[strspn(param, "0123456789")] != 0) { /* i.e. not a number */
|
||||
syntax_error(s_NickServ, u, "SASET LANGUAGE",
|
||||
NICK_SASET_LANGUAGE_SYNTAX);
|
||||
return MOD_CONT;
|
||||
}
|
||||
langnum = atoi(param) - 1;
|
||||
if (langnum < 0 || langnum >= NUM_LANGS || langlist[langnum] < 0) {
|
||||
notice_lang(s_NickServ, u, NICK_SASET_LANGUAGE_UNKNOWN, langnum + 1,
|
||||
s_NickServ);
|
||||
return MOD_CONT;
|
||||
}
|
||||
nc->language = langlist[langnum];
|
||||
notice_lang(s_NickServ, u, NICK_SASET_LANGUAGE_CHANGED);
|
||||
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
Reference in New Issue
Block a user