diff options
author | adam- <adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-08-15 01:15:21 +0000 |
---|---|---|
committer | adam- <adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-08-15 01:15:21 +0000 |
commit | 89e05fb880380bb2fb40729c8b5237c2c68a2e54 (patch) | |
tree | 81c454ce1b90b711315126dd7db219ef3fef3589 /src | |
parent | ece55718e73e0f3f25101d9b32c2900ac2df6849 (diff) |
Changed /nickserv id to allow you to switch accounts without logging out first and /nickserv logout to log you out of your account and not check the nick
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2452 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/core/ns_identify.c | 11 | ||||
-rw-r--r-- | src/core/ns_logout.c | 13 |
2 files changed, 14 insertions, 10 deletions
diff --git a/src/core/ns_identify.c b/src/core/ns_identify.c index eb47101d8..2fe7acdef 100644 --- a/src/core/ns_identify.c +++ b/src/core/ns_identify.c @@ -44,7 +44,11 @@ class CommandNSIdentify : public Command notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, na->nick); else if (na->nc->flags & NI_SUSPENDED) notice_lang(s_NickServ, u, NICK_X_SUSPENDED, na->nick); - else if (nick_identified(u)) + /* You can now identify for other nicks without logging out first, + * however you can not identify again for the group you're already + * identified as + */ + else if (u->nc && u->nc == na->nc) notice_lang(s_NickServ, u, NICK_ALREADY_IDENTIFIED); else if (!(res = enc_check_password(pass, na->nc->pass))) { @@ -56,6 +60,11 @@ class CommandNSIdentify : public Command notice_lang(s_NickServ, u, NICK_IDENTIFY_FAILED); else { + if (nick_identified(u)) + { + alog("%s: %s!%s@%s logged out of account %s", s_NickServ, u->nick, u->GetIdent().c_str(), u->host, u->nc->display); + } + if (!(na->status & NS_IDENTIFIED) && !(na->status & NS_RECOGNIZED)) { if (na->last_usermask) diff --git a/src/core/ns_logout.c b/src/core/ns_logout.c index ea306e387..81f25efe7 100644 --- a/src/core/ns_logout.c +++ b/src/core/ns_logout.c @@ -37,23 +37,18 @@ class CommandNSLogout : public Command this->OnSyntaxError(u); else if (!(u2 = (nick ? finduser(nick) : u))) notice_lang(s_NickServ, u, NICK_X_NOT_IN_USE, nick); - else if (!(na = findnick(u2->nick))) - { - if (nick) - notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick); - else - notice_lang(s_NickServ, u, NICK_NOT_REGISTERED); - } else if (nick && u2->nc && !u2->nc->IsServicesOper()) notice_lang(s_NickServ, u, NICK_LOGOUT_SERVICESADMIN, nick); else { + na = findnick(u2->nick); + if (nick && !param.empty() && param == "REVALIDATE") { cancel_user(u2); validate_user(u2); } - else + else if (na) { na->status &= ~(NS_IDENTIFIED | NS_RECOGNIZED); } @@ -80,7 +75,7 @@ class CommandNSLogout : public Command notice_lang(s_NickServ, u, NICK_LOGOUT_SUCCEEDED); /* Clear any timers again */ - if (u->nc->flags & NI_KILLPROTECT) + if (na && u->nc->flags & NI_KILLPROTECT) del_ns_timeout(na, TO_COLLIDE); ircdproto->SendAccountLogout(u2, u2->nc); |