summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/ns_identify.c11
-rw-r--r--src/core/ns_logout.c13
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);