diff options
author | adam- <adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-08-04 01:56:14 +0000 |
---|---|---|
committer | adam- <adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-08-04 01:56:14 +0000 |
commit | ce664a160b1c1d4c75de5ba1867c96a0698326fd (patch) | |
tree | 313d7e88fdbb98b4d45917cbd6eb2d3aa36a661e /src/protocol/ratbox.c | |
parent | 0d7e0274a4e10bcd2b9410d907ff3fec9202d336 (diff) |
Fixed autoid
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2404 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/protocol/ratbox.c')
-rw-r--r-- | src/protocol/ratbox.c | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c index ba560d115..c989dc004 100644 --- a/src/protocol/ratbox.c +++ b/src/protocol/ratbox.c @@ -60,9 +60,7 @@ IRCDVar myIrcd[] = { NULL, /* Mode to unset for an owner */ NULL, /* Mode to set for chan admin */ NULL, /* Mode to unset for chan admin */ - NULL, /* Mode On Reg */ - NULL, /* Mode on UnReg */ - NULL, /* Mode on Nick Change */ + NULL, /* Mode on UnReg */ 1, /* Supports SGlines */ 1, /* Supports SQlines */ 0, /* Supports SZlines */ @@ -684,6 +682,25 @@ class RatboxProto : public IRCDTS6Proto { send_cmd(bi->uid, "TOPIC %s :%s", chan, topic); } + + void SetAutoIdentificationToken(User *u) + { + char svidbuf[15], *c; + + if (!u->nc) + return; + + snprintf(svidbuf, sizeof(svidbuf), "%ld", u->timestamp); + + if (u->nc->GetExt("authenticationtoken", c)) + { + delete [] c; + u->nc->Shrink("authenticationtoken"); + } + + u->nc->Extend("authenticationtoken", sstrdup(svidbuf)); + } + } ircd_proto; @@ -732,6 +749,11 @@ int anope_event_nick(const char *source, int ac, const char **av) strtoul(av[2], NULL, 10), 0, "*", av[7]); if (user) { + /* No usermode +d on ratbox so we use + * nick timestamp to check for auth - Adam + */ + user->CheckAuthenticationToken(av[2]); + ircdproto->ProcessUsermodes(user, 1, &av[3]); } } else { @@ -1174,6 +1196,8 @@ class ProtoRatbox : public Module pmodule_ircd_proto(&ircd_proto); moduleAddIRCDMsgs(); + + ModuleManager::Attach(I_OnDelCore, this); } ~ProtoRatbox() @@ -1181,6 +1205,17 @@ class ProtoRatbox : public Module delete [] TS6SID; } + void OnDelCore(NickCore *nc) + { + char *c; + + if (nc->GetExt("authenticationtoken", c)) + { + delete [] c; + nc->Shrink("authenticationtoken"); + } + } + }; MODULE_INIT("ratbox", ProtoRatbox) |