Kod: Kodu kopyalamak için üzerine çift tıklayın!
static void do_ghost(User *u)
{
char *nick = strtok(NULL, " ");
char *pass = strtok(NULL, " ");
NickInfo *ni;
User *u2;
if (!nick || strtok_remaining()) {
syntax_error(s_NickServ, u, "GHOST", NICK_GHOST_SYNTAX);
} else if (!(u2 = get_user(nick))) {
notice_lang(s_NickServ, u, NICK_X_NOT_IN_USE, nick);
} else if (!(ni = u2->ni)) {
notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
} else if (ni->status & NS_GUESTED) {
notice_lang(s_NickServ, u, NICK_X_NOT_IN_USE, nick);
} else if (ni->status & NS_VERBOTEN) {
notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, nick);
} else if (irc_stricmp(nick, u->nick) == 0) {
notice_lang(s_NickServ, u, NICK_NO_GHOST_SELF);
} else {
char buf[NICKMAX+32];
if (pass) {
if (!nick_check_password(u, ni, pass, "GHOST", ACCESS_DENIED))
return;
} else if (!has_identified_nick(u, ni->nickgroup)) {
notice_lang(s_NickServ, u, ACCESS_DENIED);
return;
}
snprintf(buf, sizeof(buf), "GHOST command used by %s", u->nick);
kill_user(s_NickServ, nick, buf);
send_cmd(s_NickServ, "SVSNICK %s %s :0", u->nick, nick);
notice_lang(s_NickServ, u, NICK_GHOST_KILLED, nick);
}
}