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/protocol | |
| 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/protocol')
| -rw-r--r-- | src/protocol/bahamut.c | 18 | ||||
| -rw-r--r-- | src/protocol/inspircd11.c | 16 | ||||
| -rw-r--r-- | src/protocol/inspircd12.cpp | 15 | ||||
| -rw-r--r-- | src/protocol/ratbox.c | 4 | ||||
| -rw-r--r-- | src/protocol/unreal32.c | 38 |
5 files changed, 14 insertions, 77 deletions
diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c index f5a62116a..5e0b5a7a4 100644 --- a/src/protocol/bahamut.c +++ b/src/protocol/bahamut.c @@ -494,7 +494,6 @@ class BahamutIRCdProto : public IRCDProto } --ac; ++av; - user->svid = strtoul(*av, NULL, 0); break; case 'o': if (add) { @@ -685,25 +684,12 @@ class BahamutIRCdProto : public IRCDProto } /* SVSMODE +d */ - /* sent if svid is something weird */ - void SendSVID(const char *nick, time_t ts) - { - send_cmd(ServerName, "SVSMODE %s %lu +d 1", nick, static_cast<unsigned long>(ts)); - } - - /* SVSMODE +d */ /* nc_change was = 1, and there is no na->status */ void SendUnregisteredNick(User *u) { common_svsmode(u, "+d", "1"); } - void SendSVID3(User *u, const char *ts) - { - if (u->svid != u->timestamp) common_svsmode(u, "+rd", ts); - else common_svsmode(u, "+r", NULL); - } - int IsFloodModeParamValid(const char *value) { char *dp, *end; @@ -761,13 +747,13 @@ int anope_event_nick(const char *source, int ac, const char **av) if (ac != 2) { user = do_nick(source, av[0], av[4], av[5], av[6], av[9], strtoul(av[2], NULL, 10), strtoul(av[7], NULL, 0), - strtoul(av[8], NULL, 0), NULL, NULL); + NULL, NULL); if (user) { ircdproto->ProcessUsermodes(user, 1, &av[3]); } } else { do_nick(source, av[0], NULL, NULL, NULL, NULL, - strtoul(av[1], NULL, 10), 0, 0, NULL, NULL); + strtoul(av[1], NULL, 10), 0, NULL, NULL); } return MOD_CONT; } diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c index fb498eb06..f27d3df0c 100644 --- a/src/protocol/inspircd11.c +++ b/src/protocol/inspircd11.c @@ -471,7 +471,6 @@ class InspIRCdProto : public IRCDProto else --opcnt; break; case 'r': - user->svid = add ? user->timestamp : 0; if (add && !nick_identified(user)) { common_svsmode(user, "-r", NULL); user->mode &= ~UMODE_r; @@ -656,12 +655,6 @@ class InspIRCdProto : public IRCDProto common_svsmode(u, "-r", NULL); } - /* SVSMODE +r */ - void SendSVID2(User *u, const char *ts) - { - common_svsmode(u, "+r", NULL); - } - void SendSVSJoin(const char *source, const char *nick, const char *chan, const char *param) { send_cmd(source, "SVSJOIN %s %s", nick, chan); @@ -1075,27 +1068,22 @@ int anope_event_nick(const char *source, int ac, const char **av) if (ac != 1) { if (ac == 8) { - int svid = 0; int ts = strtoul(av[0], NULL, 10); - if (strchr(av[5], 'r') != NULL) - svid = ts; - inet_aton(av[6], &addy); user = do_nick("", av[1], /* nick */ av[4], /* username */ av[2], /* realhost */ source, /* server */ av[7], /* realname */ - ts, svid, htonl(*ad), av[3], NULL); + ts, htonl(*ad), av[3], NULL); if (user) { ircdproto->ProcessUsermodes(user, 1, &av[5]); user->chost = av[3]; } } } else { - do_nick(source, av[0], NULL, NULL, NULL, NULL, 0, 0, 0, NULL, - NULL); + do_nick(source, av[0], NULL, NULL, NULL, NULL, 0, 0, NULL, NULL); } return MOD_CONT; } diff --git a/src/protocol/inspircd12.cpp b/src/protocol/inspircd12.cpp index 70b89aa25..b376afa30 100644 --- a/src/protocol/inspircd12.cpp +++ b/src/protocol/inspircd12.cpp @@ -469,7 +469,6 @@ class InspIRCdProto : public IRCDProto else --opcnt; break; case 'r': - user->svid = add ? user->timestamp : 0; if (add && !nick_identified(user)) { common_svsmode(user, "-r", NULL); user->mode &= ~UMODE_r; @@ -657,12 +656,6 @@ class InspIRCdProto : public IRCDProto common_svsmode(u, "-r", NULL); } - /* SVSMODE +r */ - void SendSVID2(User *u, const char *ts) - { - common_svsmode(u, "+r", NULL); - } - void SendSVSJoin(const char *source, const char *nick, const char *chan, const char *param) { User *u = finduser(nick); @@ -1101,7 +1094,7 @@ int anope_event_sethost(const char *source, int ac, const char **av) int anope_event_nick(const char *source, int ac, const char **av) { - do_nick(source, av[0], NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL); + do_nick(source, av[0], NULL, NULL, NULL, NULL, 0, 0, NULL, NULL); return MOD_CONT; } @@ -1126,19 +1119,15 @@ int anope_event_uid(const char *source, int ac, const char **av) struct in_addr addy; Server *s = findserver_uid(servlist, source); uint32 *ad = reinterpret_cast<uint32 *>(&addy); - int svid = 0; int ts = strtoul(av[1], NULL, 10); - if (strchr(av[8], 'r') != NULL) - svid = ts; - inet_aton(av[6], &addy); user = do_nick("", av[2], /* nick */ av[5], /* username */ av[3], /* realhost */ s->name, /* server */ av[ac - 1], /* realname */ - ts, svid, htonl(*ad), av[4], av[0]); + ts, htonl(*ad), av[4], av[0]); if (user) { ircdproto->ProcessUsermodes(user, 1, &av[8]); diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c index f0046d706..dea79b952 100644 --- a/src/protocol/ratbox.c +++ b/src/protocol/ratbox.c @@ -725,7 +725,7 @@ int anope_event_nick(const char *source, int ac, const char **av) s = findserver_uid(servlist, source); /* Source is always the server */ user = do_nick("", av[0], av[4], av[5], s->name, av[8], - strtoul(av[2], NULL, 10), 0, 0, "*", av[7]); + strtoul(av[2], NULL, 10), 0, "*", av[7]); if (user) { ircdproto->ProcessUsermodes(user, 1, &av[3]); @@ -734,7 +734,7 @@ int anope_event_nick(const char *source, int ac, const char **av) if (ac == 2) { do_nick(source, av[0], NULL, NULL, NULL, NULL, - strtoul(av[1], NULL, 10), 0, 0, NULL, NULL); + strtoul(av[1], NULL, 10), 0, NULL, NULL); } } return MOD_CONT; diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c index 1bbc5c2dc..82dbc900b 100644 --- a/src/protocol/unreal32.c +++ b/src/protocol/unreal32.c @@ -562,7 +562,7 @@ class UnrealIRCdProto : public IRCDProto break; if (isdigit(*av[1])) { - user->svid = strtoul(av[1], NULL, 0); + //user->svid = strtoul(av[1], NULL, 0); user->mode = backup; /* Ugly fix, but should do the job ~ Viper */ continue; // +d was setting a service stamp, ignore the usermode +-d. } @@ -818,29 +818,6 @@ class UnrealIRCdProto : public IRCDProto else send_cmd(ServerName, "n %s %s", name, mode); } - - /* SVSMODE +d */ - /* sent if svid is something weird */ - void SendSVID(const char *nick, time_t ts) - { - send_cmd(ServerName, "v %s +d 1", nick); - } - - /* SVSMODE +d */ - /* nc_change was = 1, and there is no na->status */ - void SendUnregisteredNick(User *u) - { - common_svsmode(u, "-r+d", "1"); - } - - /* SVSMODE +r */ - void SendSVID2(User *u, const char *ts) - { - if (u->svid != u->timestamp) common_svsmode(u, "+rd", ts); - else common_svsmode(u, "+r", NULL); - } - - /* svsjoin parv[0] - sender parv[1] - nick to make join @@ -1223,7 +1200,7 @@ int anope_event_sethost(const char *source, int ac, const char **av) */ /* do_nick(const char *source, char *nick, char *username, char *host, - char *server, char *realname, time_t ts, uint32 svid, + char *server, char *realname, time_t ts, uint32 ip, char *vhost, char *uid) */ int anope_event_nick(const char *source, int ac, const char **av) @@ -1239,28 +1216,25 @@ int anope_event_nick(const char *source, int ac, const char **av) - so we have to leave it around for now -TSL */ do_nick(source, av[0], av[3], av[4], av[5], av[6], - strtoul(av[2], NULL, 10), 0, 0, "*", NULL); + strtoul(av[2], NULL, 10), 0, "*", NULL); } else if (ac == 11) { user = do_nick(source, av[0], av[3], av[4], av[5], av[10], - strtoul(av[2], NULL, 10), strtoul(av[6], NULL, - 0), - ntohl(decode_ip(av[9])), av[8], NULL); + strtoul(av[2], NULL, 10), ntohl(decode_ip(av[9])), av[8], NULL); if (user) ircdproto->ProcessUsermodes(user, 1, &av[7]); } else { /* NON NICKIP */ user = do_nick(source, av[0], av[3], av[4], av[5], av[9], - strtoul(av[2], NULL, 10), strtoul(av[6], NULL, - 0), 0, av[8], + strtoul(av[2], NULL, 10), 0, av[8], NULL); if (user) ircdproto->ProcessUsermodes(user, 1, &av[7]); } } else { do_nick(source, av[0], NULL, NULL, NULL, NULL, - strtoul(av[1], NULL, 10), 0, 0, NULL, NULL); + strtoul(av[1], NULL, 10), 0, NULL, NULL); } return MOD_CONT; } |
