From d1611b640bcd27e1a91a99ef32127bc722e50a36 Mon Sep 17 00:00:00 2001 From: rburchell Date: Sun, 15 Feb 2009 22:29:18 +0000 Subject: 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 --- include/account.h | 4 ---- include/extern.h | 16 ++++++---------- include/services.h | 3 --- include/users.h | 3 --- 4 files changed, 6 insertions(+), 20 deletions(-) (limited to 'include') diff --git a/include/account.h b/include/account.h index 40b7146c2..6c49bbd58 100644 --- a/include/account.h +++ b/include/account.h @@ -34,7 +34,6 @@ class NickAlias time_registered = last_seen = 0; status = 0; nc = NULL; - u = NULL; } NickAlias *next, *prev; @@ -46,9 +45,6 @@ class NickAlias time_t last_seen; /* When it was seen online for the last time */ uint16 status; /* See NS_* below */ NickCore *nc; /* I'm an alias of this */ - - /* Not saved */ - User *u; /* Current online user that has me */ }; class NickCore : public Extensible diff --git a/include/extern.h b/include/extern.h index 43adbf644..888d64721 100644 --- a/include/extern.h +++ b/include/extern.h @@ -317,7 +317,6 @@ E bool NSStrictPrivileges; E bool NSEmailReg; E bool NSModeOnID; E bool NSRestrictGetPass; -E bool NSNickTracking; E bool NSAddAccessOnReg; E int CSDefFlags; @@ -525,7 +524,9 @@ E void lang_init(); E int strftime_lang(char *buf, int size, User * u, int format, struct tm *tm); E void syntax_error(char *service, User * u, const char *command, int msgnum); E const char *getstring(NickAlias *na, int index); -E const char *getstring2(NickCore *nc, int index); +E const char *getstring(NickCore *nc, int index); +E const char *getstring(User *nc, int index); +E const char *getstring(int index); /**** log.c ****/ @@ -630,8 +631,8 @@ E const char *merge_args(int argc, const char **argv); E int match_wild(const char *pattern, const char *str) MARK_DEPRECATED; E int match_wild_nocase(const char *pattern, const char *str) MARK_DEPRECATED; E int dotime(const char *s); -E char *duration(NickAlias * na, char *buf, int bufsize, time_t seconds); -E char *expire_left(NickAlias * na, char *buf, int len, time_t expires); +E const char *duration(NickCore *nc, char *buf, int bufsize, time_t seconds); +E const char *expire_left(NickCore *nc, char *buf, int len, time_t expires); E int doValidHost(const char *host, int type); typedef int (*range_callback_t) (User * u, int num, va_list args); @@ -736,11 +737,6 @@ E NickAlias *findnick(const char *nick); E NickAlias *findnick(const std::string &nick); E NickCore *findcore(const char *nick); E void clean_ns_timeouts(NickAlias * na); -E void nsStartNickTracking(User * u); -E void nsStopNickTracking(User * u); -E int nsCheckNickTracking(User *u); - -E int group_identified(User * u, NickCore * nc); E int is_on_access(User * u, NickCore * nc); /**** operserv.c ****/ @@ -930,7 +926,7 @@ E char *TS6UPLINK; E void update_host(User * user); E User *do_nick(const char *source, const char *nick, const char *username, const char *host, - const char *server, const char *realname, time_t ts, uint32 svid, uint32 ip, const char *vhost, const char *uid); + const char *server, const char *realname, time_t ts, uint32 ip, const char *vhost, const char *uid); E void do_umode(const char *source, int ac, const char **av); E void do_quit(const char *source, int ac, const char **av); diff --git a/include/services.h b/include/services.h index 549d39ba1..6c00c959f 100644 --- a/include/services.h +++ b/include/services.h @@ -1312,10 +1312,7 @@ class IRCDProto virtual void SendSGLine(const char *, const char *) { } virtual void SendBanDel(const char *, const char *) { } virtual void SendSVSModeChan(const char *, const char *, const char *) { } - virtual void SendSVID(const char *, time_t) { } virtual void SendUnregisteredNick(User *) { } - virtual void SendSVID2(User *, const char *) { } - virtual void SendSVID3(User *, const char *) { } virtual void SendCTCP(BotInfo *bi, const char *dest, const char *fmt, ...); virtual void SendSVSJoin(const char *, const char *, const char *, const char *) { } virtual void SendSVSPart(const char *, const char *, const char *) { } diff --git a/include/users.h b/include/users.h index 17dfccd8d..fd05b5c17 100644 --- a/include/users.h +++ b/include/users.h @@ -37,14 +37,11 @@ public: // XXX: exposing a tiny bit too much std::string chost; /* User's cloaked hostname */ char *realname; /* Realname */ Server *server; /* Server user is connected to */ - char *nickTrack; /* Nick Tracking */ time_t timestamp; /* Timestamp of the nick */ time_t my_signon; /* When did _we_ see the user? */ - time_t svid; /* Services ID */ uint32 mode; /* See below */ NickCore *nc; - NickAlias *na; int isSuperAdmin; /* is SuperAdmin on or off? */ -- cgit