Anope IRC Services
Anope Support => 1.8.x/1.7.x Support (Read Only) => Topic started by: EZEki3l on September 08, 2006, 11:32:24 PM
-
I modify a lang file and I have see that when services use
NICK_X_ILLEGAL
Nick %s is an illegal nickname and cannot be used.
with operserv svsnick command and I think that it wrong when for exemple on unreal I type /os svsnick nick-I-want-change //
services answer
-OperServ- Nick My-nick is an illegal nickname and cannot be used.
int do_svsnick(User * u)
{
char *nick = strtok(NULL, " ");
char *newnick = strtok(NULL, " ");
NickAlias *na;
char *c;
/* Only allow this if SuperAdmin is enabled */
if (!u->isSuperAdmin) {
notice_lang(s_OperServ, u, OPER_SUPER_ADMIN_ONLY);
return MOD_CONT;
}
if (!nick || !newnick) {
syntax_error(s_OperServ, u, "SVSNICK", OPER_SVSNICK_SYNTAX);
return MOD_CONT;
}
/* Truncate long nicknames to NICKMAX-2 characters */
if (strlen(newnick) > (NICKMAX - 2)) {
notice_lang(s_NickServ, u, NICK_X_TRUNCATED,
newnick, NICKMAX - 2, newnick);
newnick[NICKMAX - 2] = ' ';
}
/* Check for valid characters */
if (*newnick == '-' || isdigit(*newnick)) {
notice_lang(s_OperServ, u, NICK_X_ILLEGAL, newnick);
return MOD_CONT;
}
#define isvalid(c) (((c) >= 'A' && (c) <= '~') || isdigit(c) || (c) == '-')
for (c = newnick; *c && (c - newnick) < NICKMAX; c++) {
if (!isvalid(*c) || isspace(*c)) {
notice_lang(s_OperServ, u, NICK_X_ILLEGAL, nick);
return MOD_CONT;
}
}
I think at the end you must put #define isvalid(c) (((c) >= 'A' && (c) <= '~') || isdigit(c) || (c) == '-')
for (c = newnick; *c && (c - newnick) < NICKMAX; c++) {
if (!isvalid(*c) || isspace(*c)) {
notice_lang(s_OperServ, u, NICK_X_ILLEGAL, newnick);
return MOD_CONT;
no ? correct me if I am wrong :)
-
I just tested the SVSNICK command on 1.7.15 and everything is working fine for normal nicks, but i got this for the ~ prefix.
Example:
<@Global> OperServ: n00bie: svsnick TestNick ~test
-OperServ- The nick TestNick is now being changed to ~test.
but actually the nick is not changing.
-
http://bugs.anope.org/show_bug.cgi?id=599
-
I just speak about the notice_lang and I didn't see this bug but In the updated file from svn the notice is similar so It's right that operserv say:
-OperServ- Nick nick-I-want-to-change is an illegal nickname and cannot be used.
and not:
-OperServ- Nick // is an illegal nickname and cannot be used.
when I type:
/os svsnick nick-I-want-to-change //
?
notice_lang(s_OperServ, u, NICK_X_ILLEGAL, nick);
shouldn't be:
notice_lang(s_OperServ, u, NICK_X_ILLEGAL, newnick);
?