diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-04-04 13:12:10 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-04-04 13:12:10 +0000 |
commit | 59ca4eec57a9c8b37e79e3031c74b59d4803fc28 (patch) | |
tree | c6c721494286bf3c042eaacaa890be256bb16bcd | |
parent | e728d9abdfd0ea41ac249273842924fe6bce6d4d (diff) |
Make all our modules use the new stuff rather than the send_ events
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9301 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 9 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 9 | ||||
-rw-r--r-- | src/modules/m_alltime.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_customtitle.cpp | 8 | ||||
-rw-r--r-- | src/modules/m_messageflood.cpp | 13 | ||||
-rw-r--r-- | src/modules/m_opermodes.cpp | 5 | ||||
-rw-r--r-- | src/modules/m_samode.cpp | 14 | ||||
-rw-r--r-- | src/modules/m_sasl.cpp | 16 | ||||
-rw-r--r-- | src/modules/m_showwhois.cpp | 9 | ||||
-rw-r--r-- | src/modules/m_spanningtree/protocolinterface.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_swhois.cpp | 16 | ||||
-rw-r--r-- | src/modules/m_timedbans.cpp | 6 |
12 files changed, 27 insertions, 86 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 797019fd4..27456959a 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -714,14 +714,7 @@ class ModuleSSLGnuTLS : public Module if ((user->GetExt("ssl", dummy)) && (IS_LOCAL(user))) { // Tell whatever protocol module we're using that we need to inform other servers of this metadata NOW. - std::deque<std::string>* metadata = new std::deque<std::string>; - metadata->push_back(user->uuid); - metadata->push_back("ssl"); // The metadata id - metadata->push_back("ON"); // The value to send - Event* event = new Event((char*)metadata,(Module*)this,"send_metadata"); - event->Send(ServerInstance); // Trigger the event. We don't care what module picks it up. - delete event; - delete metadata; + ServerInstance->PI->SendMetaData(user, TYPE_USER, "SSL", "on"); VerifyCertificate(&sessions[user->GetFd()],user); if (sessions[user->GetFd()].sess) diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 83fa94e96..ed38933db 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -782,14 +782,7 @@ class ModuleSSLOpenSSL : public Module if ((user->GetExt("ssl", dummy)) && (IS_LOCAL(user))) { // Tell whatever protocol module we're using that we need to inform other servers of this metadata NOW. - std::deque<std::string>* metadata = new std::deque<std::string>; - metadata->push_back(user->uuid); - metadata->push_back("ssl"); // The metadata id - metadata->push_back("ON"); // The value to send - Event* event = new Event((char*)metadata,(Module*)this,"send_metadata"); - event->Send(ServerInstance); // Trigger the event. We don't care what module picks it up. - delete event; - delete metadata; + ServerInstance->PI->SendMetaData(user, TYPE_USER, "SSL", "on"); VerifyCertificate(&sessions[user->GetFd()], user); if (sessions[user->GetFd()].sess) diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp index 75ed4f355..c65a05c59 100644 --- a/src/modules/m_alltime.cpp +++ b/src/modules/m_alltime.cpp @@ -40,11 +40,7 @@ class CommandAlltime : public Command } else { - std::deque<std::string> params; - params.push_back(user->nick); - params.push_back(msg); - Event ev((char *) ¶ms, NULL, "send_push"); - ev.Send(ServerInstance); + ServerInstance->PI->PushToClient(user, msg); } /* we want this routed out! */ diff --git a/src/modules/m_customtitle.cpp b/src/modules/m_customtitle.cpp index 491487b3c..5d0e77ffe 100644 --- a/src/modules/m_customtitle.cpp +++ b/src/modules/m_customtitle.cpp @@ -78,13 +78,7 @@ bool OneOfMatches(const char* host, const char* ip, const char* hostlist) text = new std::string(title); user->Extend("ctitle", text); - std::deque<std::string>* metadata = new std::deque<std::string>; - metadata->push_back(user->uuid); - metadata->push_back("ctitle"); // The metadata id - metadata->push_back(*text); // The value to send - Event event((char*)metadata,(Module*)this,"send_metadata"); - event.Send(ServerInstance); - delete metadata; + ServerInstance->PI->SendMetaData(user, TYPE_USER, "ctitle", *text); if (!vhost.empty()) user->ChangeDisplayedHost(vhost.c_str()); diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp index e41107706..0eff817aa 100644 --- a/src/modules/m_messageflood.cpp +++ b/src/modules/m_messageflood.cpp @@ -237,18 +237,11 @@ class ModuleMsgFlood : public Module parameters[1] = "+b"; parameters[2] = user->MakeWildHost(); ServerInstance->SendMode(parameters,3,user); - std::deque<std::string> n; - /* Propogate the ban to other servers. - * We dont know what protocol we may be using, - * so this event is picked up by our protocol - * module and formed into a ban command that - * suits the protocol in use. - */ - n.push_back(dest->name); + + parameterlist n; n.push_back("+b"); n.push_back(user->MakeWildHost()); - Event rmode((char *)&n, NULL, "send_mode"); - rmode.Send(ServerInstance); + ServerInstance->PI->SendMode(dest->name, n); } char kickmessage[MAXBUF]; snprintf(kickmessage, MAXBUF, "Channel flood triggered (limit is %d lines in %d secs)", f->lines, f->secs); diff --git a/src/modules/m_opermodes.cpp b/src/modules/m_opermodes.cpp index dfd55a970..877b9b441 100644 --- a/src/modules/m_opermodes.cpp +++ b/src/modules/m_opermodes.cpp @@ -112,11 +112,10 @@ class ModuleModesOnOper : public Module } std::deque<std::string> n; - Event rmode((char *)&n, NULL, "send_mode_explicit"); - for (unsigned int j = 0; j < tokens.size(); j++) + for (unsigned int j = 1; j < tokens.size(); j++) n.push_back(modes[j]); - rmode.Send(ServerInstance); + ServerInstance->PI->SendMode(u->uuid, n); ServerInstance->SendMode(modes, size, u); delete [] modes; } diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp index 2b8ae9b4f..84540b117 100644 --- a/src/modules/m_samode.cpp +++ b/src/modules/m_samode.cpp @@ -39,21 +39,19 @@ class CommandSamode : public Command std::deque<std::string> n; irc::spacesepstream spaced(ServerInstance->Modes->GetLastParse()); - std::string one = "*"; + std::string one; while (spaced.GetToken(one)) n.push_back(one); - Event rmode((char *)&n, NULL, "send_mode"); - rmode.Send(ServerInstance); + std::string channel = n[0]; + n.pop_front(); + ServerInstance->PI->SendMode(channel, n); - n.clear(); - n.push_back(std::string(user->nick) + " used SAMODE: " + ServerInstance->Modes->GetLastParse()); - Event rmode2((char *)&n, NULL, "send_opers"); - rmode2.Send(ServerInstance); + ServerInstance->PI->SendOperNotice(std::string(user->nick) + " used SAMODE: " + ServerInstance->Modes->GetLastParse()); /* XXX: Yes, this is right. We dont want to propagate the * actual SAMODE command, just the MODE command generated - * by the send_mode + * by the Protocol Interface */ return CMD_LOCALONLY; } diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index a035c8ec6..259c3bd16 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -48,8 +48,7 @@ class SaslAuthenticator : public classbase params.push_back("S"); params.push_back(method); - Event e((char*)¶ms, Creator, "send_encap"); - e.Send(ServerInstance); + ServerInstance->PI->SendEncapsulatedData(params); } SaslResult GetSaslResult(std::string &result_) @@ -117,8 +116,7 @@ class SaslAuthenticator : public classbase for (int i = 0; i < pcnt; ++i) params.push_back(parameters[i]); - Event e((char*)¶ms, Creator, "send_encap"); - e.Send(ServerInstance); + ServerInstance->PI->SendEncapsulatedData(params); if (*parameters[0] == '*') { @@ -242,14 +240,8 @@ class ModuleSASL : public Module std::string* str = NULL; if (user->GetExt("accountname", str)) - { - std::deque<std::string> params; - params.push_back(user->uuid); - params.push_back("accountname"); - params.push_back(*str); - Event e((char*)¶ms, this, "send_metadata"); - e.Send(ServerInstance); - } + ServerInstance->PI->SendMetaData(user, TYPE_USER, "accountname", *str); + return; } diff --git a/src/modules/m_showwhois.cpp b/src/modules/m_showwhois.cpp index 9922cfe40..37492f670 100644 --- a/src/modules/m_showwhois.cpp +++ b/src/modules/m_showwhois.cpp @@ -88,13 +88,8 @@ class ModuleShowwhois : public Module } else { - std::deque<std::string> params; - params.push_back(dest->nick); - std::string msg = ":"; - msg = msg + dest->server + " NOTICE " + dest->nick + " :*** " + source->nick + " (" + source->ident + "@" + source->host + ") did a /whois on you."; - params.push_back(msg); - Event ev((char *) ¶ms, NULL, "send_push"); - ev.Send(ServerInstance); + std::string msg = std::string(":") + dest->server + " NOTICE " + dest->nick + " :*** " + source->nick + " (" + source->ident + "@" + source->host + ") did a /whois on you."; + ServerInstance->PI->PushToClient(dest, msg); } } } diff --git a/src/modules/m_spanningtree/protocolinterface.cpp b/src/modules/m_spanningtree/protocolinterface.cpp index bbdca2305..48d0f78eb 100644 --- a/src/modules/m_spanningtree/protocolinterface.cpp +++ b/src/modules/m_spanningtree/protocolinterface.cpp @@ -21,7 +21,7 @@ void SpanningTreeProtocolInterface::SendMetaData(void* target, int type, const s params.push_back(((Channel*)target)->name); break; case TYPE_SERVER: - params.push_back(ServerInstance->Config->GetSID()); + params.push_back("*"); break; } params.push_back(key); diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index 97f69c413..c6f26384a 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -75,13 +75,7 @@ class CommandSwhois : public Command * Sorry w00t i know this was your fix, but i got bored and wanted to clear down the tracker :) * -- Brain */ - std::deque<std::string>* metadata = new std::deque<std::string>; - metadata->push_back(dest->uuid); - metadata->push_back("swhois"); // The metadata id - metadata->push_back(*text); // The value to send - Event event((char*)metadata,(Module*)this,"send_metadata"); - event.Send(ServerInstance); - delete metadata; + ServerInstance->PI->SendMetaData(dest, TYPE_USER, "swhois", *text); // If it's an empty swhois, unset it (not ideal, but ok) if (text->empty()) @@ -262,13 +256,7 @@ class ModuleSWhois : public Module std::string *text = new std::string(swhois); user->Extend("swhois", text); - std::deque<std::string>* metadata = new std::deque<std::string>; - metadata->push_back(user->uuid); - metadata->push_back("swhois"); // The metadata id - metadata->push_back(*text); // The value to send - Event event((char*)metadata,(Module*)this,"send_metadata"); - event.Send(ServerInstance); - delete metadata; + ServerInstance->PI->SendMetaData(user, TYPE_USER, "swhois", *text); } virtual ~ModuleSWhois() diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index 096306b1d..d592581f5 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -164,12 +164,12 @@ class ModuleTimedBans : public Module /* Send mode remotely*/ std::deque<std::string> n; - n.push_back(setban[0]); n.push_back("-b"); n.push_back(setban[2]); + + ServerInstance->PI->SendMode(i->channel, n); ServerInstance->SendMode(setban,3, ServerInstance->FakeClient); - Event rmode((char *)&n, NULL, "send_mode"); - rmode.Send(ServerInstance); + CUList empty; cr->WriteAllExcept(ServerInstance->FakeClient, true, '@', empty, "NOTICE %s :*** Timed ban on %s expired.", cr->name, i->mask.c_str()); if (ServerInstance->Config->AllowHalfop) |