diff options
author | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-15 22:29:18 +0000 |
---|---|---|
committer | rburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-02-15 22:29:18 +0000 |
commit | d1611b640bcd27e1a91a99ef32127bc722e50a36 (patch) | |
tree | b18c77b07b74b70f5613b106aa2a81baa6227f35 /src/core/ns_ghost.c | |
parent | 0e5b71923b25d908167e7ef9d07c6c217827e901 (diff) |
Remove User::na, use User::nc everywhere. Will probably break everything, but opens the door to decoupling NC from NA, and means commands can now be run without bothering about changinc nick :)
More tweaking for na/nc usage.
It compiles, but it's still a work in progress.
Again, this compiles, but I *bet* there's no chance in hell it'll work. :)
Slightly better.
Set User::nc correctly.
Fix crash with unregistered nicks in core and ns_access.
Fix glist to work when you're not on that particular nick.
Fix ns_set to not crash and burn horribly.
Fix ns_set and ns_logout to not do bad things.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2076 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/core/ns_ghost.c')
-rw-r--r-- | src/core/ns_ghost.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/core/ns_ghost.c b/src/core/ns_ghost.c index b89d8b2be..44678bbd4 100644 --- a/src/core/ns_ghost.c +++ b/src/core/ns_ghost.c @@ -28,12 +28,11 @@ class CommandNSGhost : public Command { const char *nick = params[0].c_str(); const char *pass = params.size() > 1 ? params[1].c_str() : NULL; - NickAlias *na; - User *u2; + NickAlias *na = findnick(nick); - if (!(u2 = finduser(nick))) + if (!finduser(nick)) notice_lang(s_NickServ, u, NICK_X_NOT_IN_USE, nick); - else if (!(na = u2->na)) + else if (!na) notice_lang(s_NickServ, u, NICK_X_NOT_REGISTERED, nick); else if (na->status & NS_FORBIDDEN) notice_lang(s_NickServ, u, NICK_X_FORBIDDEN, na->nick); @@ -63,7 +62,7 @@ class CommandNSGhost : public Command } else { - if (group_identified(u, na->nc) || (!(na->nc->flags & NI_SECURE) && is_on_access(u, na->nc))) + if (u->nc == na->nc || (!(na->nc->flags & NI_SECURE) && is_on_access(u, na->nc))) { char buf[NICKMAX + 32]; snprintf(buf, sizeof(buf), "GHOST command used by %s", u->nick); |