summaryrefslogtreecommitdiff
path: root/src/protocol/inspircd12.cpp
diff options
context:
space:
mode:
authoradam- <adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-08-04 01:56:14 +0000
committeradam- <adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-08-04 01:56:14 +0000
commitce664a160b1c1d4c75de5ba1867c96a0698326fd (patch)
tree313d7e88fdbb98b4d45917cbd6eb2d3aa36a661e /src/protocol/inspircd12.cpp
parent0d7e0274a4e10bcd2b9410d907ff3fec9202d336 (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/inspircd12.cpp')
-rw-r--r--src/protocol/inspircd12.cpp50
1 files changed, 48 insertions, 2 deletions
diff --git a/src/protocol/inspircd12.cpp b/src/protocol/inspircd12.cpp
index 7f1262df1..6be11646a 100644
--- a/src/protocol/inspircd12.cpp
+++ b/src/protocol/inspircd12.cpp
@@ -84,9 +84,7 @@ IRCDVar myIrcd[] = {
"-q", /* Mode to unset for an owner */
"+a", /* Mode to set for channel admin */
"-a", /* Mode to unset for channel admin */
- "+r", /* Mode On Reg */
"-r", /* Mode on UnReg */
- "-r", /* Mode on Nick Change */
0, /* Supports SGlines */
1, /* Supports SQlines */
1, /* Supports SZlines */
@@ -709,7 +707,19 @@ class InspIRCdProto : public IRCDProto
void SendAccountLogin(User *u, NickCore *account)
{
+ char *c;
+
send_cmd(TS6SID, "METADATA %s accountname :%s", u->GetUID().c_str(), account->display);
+
+ if (account->GetExt("authenticationtoken", c))
+ {
+ delete [] c;
+ account->Shrink("authenticationtoken");
+ }
+
+ account->Extend("authenticationtoken", sstrdup(account->display));
+
+ common_svsmode(u, "+rd", account->display);
}
void SendAccountLogout(User *u, NickCore *account)
@@ -724,6 +734,7 @@ class InspIRCdProto : public IRCDProto
return 0;
return 1;
}
+
} ircd_proto;
@@ -1210,6 +1221,27 @@ int anope_event_whois(const char *source, int ac, const char **av)
return MOD_CONT;
}
+int anope_event_metadata(const char *source, int ac, const char **av)
+{
+ User *u;
+
+ if (ac < 3)
+ return MOD_CONT;
+ else if (!strcmp(av[1], "accountname"))
+ {
+ if ((u = find_byuid(av[0])))
+ {
+ /* Check to see if the account name is the same
+ * as the one saved for this nick, if so identify
+ * them - Adam
+ */
+ u->CheckAuthenticationToken(av[2]);
+ }
+ }
+
+ return MOD_CONT;
+}
+
int anope_event_capab(const char *source, int ac, const char **av)
{
int argc;
@@ -1378,6 +1410,7 @@ void moduleAddIRCDMsgs() {
m = createMessage("FTOPIC", anope_event_ftopic); addCoreMessage(IRCD,m);
m = createMessage("OPERTYPE", anope_event_opertype); addCoreMessage(IRCD,m);
m = createMessage("IDLE", anope_event_idle); addCoreMessage(IRCD,m);
+ m = createMessage("METADATA", anope_event_metadata); addCoreMessage(IRCD,m);
}
class ProtoInspIRCd : public Module
@@ -1415,12 +1448,25 @@ class ProtoInspIRCd : public Module
pmodule_ircd_proto(&ircd_proto);
moduleAddIRCDMsgs();
+
+ ModuleManager::Attach(I_OnDelCore, this);
}
~ProtoInspIRCd()
{
delete [] TS6SID;
}
+
+ void OnDelCore(NickCore *nc)
+ {
+ char *c;
+
+ if (nc->GetExt("authenticationtoken", c))
+ {
+ delete [] c;
+ nc->Shrink("authenticationtoken");
+ }
+ }
};
MODULE_INIT("inspircd12", ProtoInspIRCd)