summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules.cpp26
-rw-r--r--src/modules/m_cap.cpp9
-rw-r--r--src/modules/m_httpd.cpp24
-rw-r--r--src/modules/m_httpd_acl.cpp26
-rw-r--r--src/modules/m_httpd_config.cpp16
-rw-r--r--src/modules/m_httpd_stats.cpp16
-rw-r--r--src/modules/m_ircv3.cpp60
-rw-r--r--src/modules/m_namesx.cpp5
-rw-r--r--src/modules/m_sasl.cpp11
-rw-r--r--src/modules/m_services_account.cpp13
-rw-r--r--src/modules/m_spanningtree/main.cpp1
-rw-r--r--src/modules/m_spanningtree/main.h7
-rw-r--r--src/modules/m_spanningtree/treeserver.cpp4
-rw-r--r--src/modules/m_starttls.cpp5
-rw-r--r--src/modules/m_uhnames.cpp5
15 files changed, 117 insertions, 111 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index d7aa534ab..1c33785b0 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -52,13 +52,6 @@ Version::Version(const std::string &desc, int flags, const std::string& linkdata
{
}
-Event::Event(Module* src, const std::string &eventid) : source(src), id(eventid) { }
-
-void Event::Send()
-{
- FOREACH_MOD(OnEvent, (*this));
-}
-
// These declarations define the behavours of the base class Module (which does nothing at all)
Module::Module() { }
@@ -119,7 +112,6 @@ ModResult Module::OnStats(char, User*, string_list&) { DetachEvent(I_OnStats); r
ModResult Module::OnChangeLocalUserHost(LocalUser*, const std::string&) { DetachEvent(I_OnChangeLocalUserHost); return MOD_RES_PASSTHRU; }
ModResult Module::OnChangeLocalUserGECOS(LocalUser*, const std::string&) { DetachEvent(I_OnChangeLocalUserGECOS); return MOD_RES_PASSTHRU; }
ModResult Module::OnPreTopicChange(User*, Channel*, const std::string&) { DetachEvent(I_OnPreTopicChange); return MOD_RES_PASSTHRU; }
-void Module::OnEvent(Event&) { DetachEvent(I_OnEvent); }
ModResult Module::OnPassCompare(Extensible* ex, const std::string &password, const std::string &input, const std::string& hashtype) { DetachEvent(I_OnPassCompare); return MOD_RES_PASSTHRU; }
void Module::OnPostConnect(User*) { DetachEvent(I_OnPostConnect); }
void Module::OnUserMessage(User*, void*, int, const std::string&, char, const CUList&, MessageType) { DetachEvent(I_OnUserMessage); }
@@ -655,7 +647,7 @@ ServiceProvider* ModuleManager::FindService(ServiceType type, const std::string&
}
dynamic_reference_base::dynamic_reference_base(Module* Creator, const std::string& Name)
- : name(Name), value(NULL), creator(Creator)
+ : name(Name), hook(NULL), value(NULL), creator(Creator)
{
if (!dynrefs)
dynrefs = new insp::intrusive_list<dynamic_reference_base>;
@@ -684,9 +676,19 @@ void dynamic_reference_base::SetProvider(const std::string& newname)
void dynamic_reference_base::resolve()
{
- std::multimap<std::string, ServiceProvider*>::iterator i = ServerInstance->Modules->DataProviders.find(name);
- if (i != ServerInstance->Modules->DataProviders.end())
- value = static_cast<DataProvider*>(i->second);
+ // Because find() may return any element with a matching key in case count(key) > 1 use lower_bound()
+ // to ensure a dynref with the same name as another one resolves to the same object
+ std::multimap<std::string, ServiceProvider*>::iterator i = ServerInstance->Modules.DataProviders.lower_bound(name);
+ if ((i != ServerInstance->Modules.DataProviders.end()) && (i->first == this->name))
+ {
+ ServiceProvider* newvalue = i->second;
+ if (value != newvalue)
+ {
+ value = newvalue;
+ if (hook)
+ hook->OnCapture();
+ }
+ }
else
value = NULL;
}
diff --git a/src/modules/m_cap.cpp b/src/modules/m_cap.cpp
index db5d85f0f..2c2178a18 100644
--- a/src/modules/m_cap.cpp
+++ b/src/modules/m_cap.cpp
@@ -39,9 +39,12 @@ CAP END
*/
class CommandCAP : public Command
{
+ Events::ModuleEventProvider capevprov;
+
public:
LocalIntExt reghold;
CommandCAP (Module* mod) : Command(mod, "CAP", 1),
+ capevprov(mod, "event/cap"),
reghold("CAP_REGHOLD", ExtensionItem::EXT_USER, mod)
{
works_before_reg = true;
@@ -70,7 +73,7 @@ class CommandCAP : public Command
}
reghold.set(user, 1);
- Data.Send();
+ FOREACH_MOD_CUSTOM(capevprov, GenericCap, OnCapEvent, (Data));
if (Data.ack.size() > 0)
{
@@ -93,7 +96,7 @@ class CommandCAP : public Command
CapEvent Data(creator, user, subcommand == "LS" ? CapEvent::CAPEVENT_LS : CapEvent::CAPEVENT_LIST);
reghold.set(user, 1);
- Data.Send();
+ FOREACH_MOD_CUSTOM(capevprov, GenericCap, OnCapEvent, (Data));
std::string Result = irc::stringjoiner(Data.wanted);
user->WriteCommand("CAP", subcommand + " :" + Result);
@@ -103,7 +106,7 @@ class CommandCAP : public Command
CapEvent Data(creator, user, CapEvent::CAPEVENT_CLEAR);
reghold.set(user, 1);
- Data.Send();
+ FOREACH_MOD_CUSTOM(capevprov, GenericCap, OnCapEvent, (Data));
std::string Result = irc::stringjoiner(Data.ack);
user->WriteCommand("CAP", "ACK :" + Result);
diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp
index bbd9f1275..e09ca3fa2 100644
--- a/src/modules/m_httpd.cpp
+++ b/src/modules/m_httpd.cpp
@@ -29,8 +29,9 @@
class ModuleHttpServer;
static ModuleHttpServer* HttpModule;
-static bool claimed;
static insp::intrusive_list<HttpServerSocket> sockets;
+static Events::ModuleEventProvider* aclevprov;
+static Events::ModuleEventProvider* reqevprov;
/** HTTP socket states
*/
@@ -322,14 +323,14 @@ class HttpServerSocket : public BufferedSocket, public Timer, public insp::intru
{
InternalState = HTTP_SERVE_SEND_DATA;
- claimed = false;
- HTTPRequest acl((Module*)HttpModule, "httpd_acl", request_type, uri, &headers, this, ip, postdata);
- acl.Send();
- if (!claimed)
+ ModResult MOD_RESULT;
+ HTTPRequest acl(request_type, uri, &headers, this, ip, postdata);
+ FIRST_MOD_RESULT_CUSTOM(*aclevprov, HTTPACLEventListener, OnHTTPACLCheck, MOD_RESULT, (acl));
+ if (MOD_RESULT != MOD_RES_DENY)
{
- HTTPRequest url((Module*)HttpModule, "httpd_url", request_type, uri, &headers, this, ip, postdata);
- url.Send();
- if (!claimed)
+ HTTPRequest url(request_type, uri, &headers, this, ip, postdata);
+ FIRST_MOD_RESULT_CUSTOM(*reqevprov, HTTPRequestEventListener, OnHTTPRequest, MOD_RESULT, (url));
+ if (MOD_RESULT == MOD_RES_PASSTHRU)
{
SendHTTPError(404);
}
@@ -363,7 +364,6 @@ class HTTPdAPIImpl : public HTTPdAPIBase
void SendResponse(HTTPDocumentResponse& resp) CXX11_OVERRIDE
{
- claimed = true;
resp.src.sock->Page(resp.document, resp.responsecode, &resp.headers);
}
};
@@ -372,11 +372,17 @@ class ModuleHttpServer : public Module
{
HTTPdAPIImpl APIImpl;
unsigned int timeoutsec;
+ Events::ModuleEventProvider acleventprov;
+ Events::ModuleEventProvider reqeventprov;
public:
ModuleHttpServer()
: APIImpl(this)
+ , acleventprov(this, "event/http-acl")
+ , reqeventprov(this, "event/http-request")
{
+ aclevprov = &acleventprov;
+ reqevprov = &reqeventprov;
}
void init() CXX11_OVERRIDE
diff --git a/src/modules/m_httpd_acl.cpp b/src/modules/m_httpd_acl.cpp
index 58bbbde2a..866fa0e86 100644
--- a/src/modules/m_httpd_acl.cpp
+++ b/src/modules/m_httpd_acl.cpp
@@ -36,7 +36,7 @@ class HTTPACL
blacklist(set_blacklist) { }
};
-class ModuleHTTPAccessList : public Module
+class ModuleHTTPAccessList : public Module, public HTTPACLEventListener
{
std::string stylesheet;
std::vector<HTTPACL> acl_list;
@@ -44,7 +44,8 @@ class ModuleHTTPAccessList : public Module
public:
ModuleHTTPAccessList()
- : API(this)
+ : HTTPACLEventListener(this)
+ , API(this)
{
}
@@ -104,12 +105,10 @@ class ModuleHTTPAccessList : public Module
API->SendResponse(response);
}
- void OnEvent(Event& event) CXX11_OVERRIDE
+ bool IsAccessAllowed(HTTPRequest* http)
{
- if (event.id == "httpd_acl")
{
ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Handling httpd acl event");
- HTTPRequest* http = (HTTPRequest*)&event;
for (std::vector<HTTPACL>::const_iterator this_acl = acl_list.begin(); this_acl != acl_list.end(); ++this_acl)
{
@@ -128,7 +127,7 @@ class ModuleHTTPAccessList : public Module
ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Denying access to blacklisted resource %s (matched by pattern %s) from ip %s (matched by entry %s)",
http->GetURI().c_str(), this_acl->path.c_str(), http->GetIP().c_str(), entry.c_str());
BlockAccess(http, 403);
- return;
+ return false;
}
}
}
@@ -150,7 +149,7 @@ class ModuleHTTPAccessList : public Module
ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Denying access to whitelisted resource %s (matched by pattern %s) from ip %s (Not in whitelist)",
http->GetURI().c_str(), this_acl->path.c_str(), http->GetIP().c_str());
BlockAccess(http, 403);
- return;
+ return false;
}
}
if (!this_acl->password.empty() && !this_acl->username.empty())
@@ -186,7 +185,7 @@ class ModuleHTTPAccessList : public Module
if (user == this_acl->username && pass == this_acl->password)
{
ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "HTTP authorization: password and username match");
- return;
+ return true;
}
else
/* Invalid password */
@@ -205,13 +204,22 @@ class ModuleHTTPAccessList : public Module
/* No password given at all, access denied */
BlockAccess(http, 401, "WWW-Authenticate", "Basic realm=\"Restricted Object\"");
}
+ return false;
}
/* A path may only match one ACL (the first it finds in the config file) */
- return;
+ break;
}
}
}
+ return true;
+ }
+
+ ModResult OnHTTPACLCheck(HTTPRequest& req) CXX11_OVERRIDE
+ {
+ if (IsAccessAllowed(&req))
+ return MOD_RES_PASSTHRU;
+ return MOD_RES_DENY;
}
Version GetVersion() CXX11_OVERRIDE
diff --git a/src/modules/m_httpd_config.cpp b/src/modules/m_httpd_config.cpp
index 3c4680799..6fd7f4050 100644
--- a/src/modules/m_httpd_config.cpp
+++ b/src/modules/m_httpd_config.cpp
@@ -21,13 +21,14 @@
#include "inspircd.h"
#include "modules/httpd.h"
-class ModuleHttpConfig : public Module
+class ModuleHttpConfig : public Module, public HTTPRequestEventListener
{
HTTPdAPI API;
public:
ModuleHttpConfig()
- : API(this)
+ : HTTPRequestEventListener(this)
+ , API(this)
{
}
@@ -65,14 +66,12 @@ class ModuleHttpConfig : public Module
return ret;
}
- void OnEvent(Event& event) CXX11_OVERRIDE
+ ModResult HandleRequest(HTTPRequest* http)
{
std::stringstream data("");
- if (event.id == "httpd_url")
{
ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Handling httpd event");
- HTTPRequest* http = (HTTPRequest*)&event;
if ((http->GetURI() == "/config") || (http->GetURI() == "/config/"))
{
@@ -96,8 +95,15 @@ class ModuleHttpConfig : public Module
response.headers.SetHeader("X-Powered-By", MODNAME);
response.headers.SetHeader("Content-Type", "text/html");
API->SendResponse(response);
+ return MOD_RES_DENY; // Handled
}
}
+ return MOD_RES_PASSTHRU;
+ }
+
+ ModResult OnHTTPRequest(HTTPRequest& req) CXX11_OVERRIDE
+ {
+ return HandleRequest(&req);
}
Version GetVersion() CXX11_OVERRIDE
diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp
index 35a4b0fb2..ad0b4bb72 100644
--- a/src/modules/m_httpd_stats.cpp
+++ b/src/modules/m_httpd_stats.cpp
@@ -25,14 +25,15 @@
#include "modules/httpd.h"
#include "xline.h"
-class ModuleHttpStats : public Module
+class ModuleHttpStats : public Module, public HTTPRequestEventListener
{
static const insp::flat_map<char, char const*>& entities;
HTTPdAPI API;
public:
ModuleHttpStats()
- : API(this)
+ : HTTPRequestEventListener(this)
+ , API(this)
{
}
@@ -87,14 +88,12 @@ class ModuleHttpStats : public Module
data << "</metadata>";
}
- void OnEvent(Event& event) CXX11_OVERRIDE
+ ModResult HandleRequest(HTTPRequest* http)
{
std::stringstream data("");
- if (event.id == "httpd_url")
{
ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Handling httpd event");
- HTTPRequest* http = (HTTPRequest*)&event;
if ((http->GetURI() == "/stats") || (http->GetURI() == "/stats/"))
{
@@ -225,8 +224,15 @@ class ModuleHttpStats : public Module
response.headers.SetHeader("X-Powered-By", MODNAME);
response.headers.SetHeader("Content-Type", "text/xml");
API->SendResponse(response);
+ return MOD_RES_DENY; // Handled
}
}
+ return MOD_RES_PASSTHRU;
+ }
+
+ ModResult OnHTTPRequest(HTTPRequest& req) CXX11_OVERRIDE
+ {
+ return HandleRequest(&req);
}
Version GetVersion() CXX11_OVERRIDE
diff --git a/src/modules/m_ircv3.cpp b/src/modules/m_ircv3.cpp
index b1c04cdf5..caee0d329 100644
--- a/src/modules/m_ircv3.cpp
+++ b/src/modules/m_ircv3.cpp
@@ -40,19 +40,18 @@ class WriteNeighboursWithExt : public User::ForEachNeighborHandler
}
};
-class ModuleIRCv3 : public Module
+class ModuleIRCv3 : public Module, public AccountEventListener
{
GenericCap cap_accountnotify;
GenericCap cap_awaynotify;
GenericCap cap_extendedjoin;
- bool accountnotify;
- bool awaynotify;
- bool extendedjoin;
CUList last_excepts;
public:
- ModuleIRCv3() : cap_accountnotify(this, "account-notify"),
+ ModuleIRCv3()
+ : AccountEventListener(this)
+ , cap_accountnotify(this, "account-notify"),
cap_awaynotify(this, "away-notify"),
cap_extendedjoin(this, "extended-join")
{
@@ -61,47 +60,32 @@ class ModuleIRCv3 : public Module
void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
{
ConfigTag* conf = ServerInstance->Config->ConfValue("ircv3");
- accountnotify = conf->getBool("accountnotify", true);
- awaynotify = conf->getBool("awaynotify", true);
- extendedjoin = conf->getBool("extendedjoin", true);
+ cap_accountnotify.SetActive(conf->getBool("accountnotify", true));
+ cap_awaynotify.SetActive(conf->getBool("awaynotify", true));
+ cap_extendedjoin.SetActive(conf->getBool("extendedjoin", true));
}
- void OnEvent(Event& ev) CXX11_OVERRIDE
+ void OnAccountChange(User* user, const std::string& newaccount) CXX11_OVERRIDE
{
- if (awaynotify)
- cap_awaynotify.HandleEvent(ev);
- if (extendedjoin)
- cap_extendedjoin.HandleEvent(ev);
-
- if (accountnotify)
- {
- cap_accountnotify.HandleEvent(ev);
-
- if (ev.id == "account_login")
- {
- AccountEvent* ae = static_cast<AccountEvent*>(&ev);
-
- // :nick!user@host ACCOUNT account
- // or
- // :nick!user@host ACCOUNT *
- std::string line = ":" + ae->user->GetFullHost() + " ACCOUNT ";
- if (ae->account.empty())
- line += "*";
- else
- line += std::string(ae->account);
-
- WriteNeighboursWithExt(ae->user, line, cap_accountnotify.ext);
- }
- }
+ // :nick!user@host ACCOUNT account
+ // or
+ // :nick!user@host ACCOUNT *
+ std::string line = ":" + user->GetFullHost() + " ACCOUNT ";
+ if (newaccount.empty())
+ line += "*";
+ else
+ line += newaccount;
+
+ WriteNeighboursWithExt(user, line, cap_accountnotify.ext);
}
void OnUserJoin(Membership* memb, bool sync, bool created, CUList& excepts) CXX11_OVERRIDE
{
// Remember who is not going to see the JOIN because of other modules
- if ((awaynotify) && (memb->user->IsAway()))
+ if ((cap_awaynotify.IsActive()) && (memb->user->IsAway()))
last_excepts = excepts;
- if (!extendedjoin)
+ if (!cap_extendedjoin.IsActive())
return;
/*
@@ -170,7 +154,7 @@ class ModuleIRCv3 : public Module
ModResult OnSetAway(User* user, const std::string &awaymsg) CXX11_OVERRIDE
{
- if (awaynotify)
+ if (cap_awaynotify.IsActive())
{
// Going away: n!u@h AWAY :reason
// Back from away: n!u@h AWAY
@@ -185,7 +169,7 @@ class ModuleIRCv3 : public Module
void OnPostJoin(Membership *memb) CXX11_OVERRIDE
{
- if ((!awaynotify) || (!memb->user->IsAway()))
+ if ((!cap_awaynotify.IsActive()) || (!memb->user->IsAway()))
return;
std::string line = ":" + memb->user->GetFullHost() + " AWAY :" + memb->user->awaymsg;
diff --git a/src/modules/m_namesx.cpp b/src/modules/m_namesx.cpp
index f211b01d8..c701f16bf 100644
--- a/src/modules/m_namesx.cpp
+++ b/src/modules/m_namesx.cpp
@@ -94,11 +94,6 @@ class ModuleNamesX : public Module
line.erase(pos, 1);
line.insert(pos, prefixes);
}
-
- void OnEvent(Event& ev) CXX11_OVERRIDE
- {
- cap.HandleEvent(ev);
- }
};
MODULE_INIT(ModuleNamesX)
diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp
index 0a2c840bd..c96b87034 100644
--- a/src/modules/m_sasl.cpp
+++ b/src/modules/m_sasl.cpp
@@ -28,12 +28,13 @@ enum SaslState { SASL_INIT, SASL_COMM, SASL_DONE };
enum SaslResult { SASL_OK, SASL_FAIL, SASL_ABORT };
static std::string sasl_target = "*";
+static Events::ModuleEventProvider* saslevprov;
static void SendSASL(const parameterlist& params)
{
if (!ServerInstance->PI->SendEncapsulatedData(sasl_target, "SASL", params))
{
- SASLFallback(NULL, params);
+ FOREACH_MOD_CUSTOM(*saslevprov, SASLEventListener, OnSASLAuth, (params));
}
}
@@ -246,6 +247,7 @@ class ModuleSASL : public Module
GenericCap cap;
CommandAuthenticate auth;
CommandSASL sasl;
+ Events::ModuleEventProvider sasleventprov;
public:
ModuleSASL()
@@ -253,7 +255,9 @@ class ModuleSASL : public Module
, cap(this, "sasl")
, auth(this, authExt, cap)
, sasl(this, authExt)
+ , sasleventprov(this, "event/sasl")
{
+ saslevprov = &sasleventprov;
}
void init() CXX11_OVERRIDE
@@ -283,11 +287,6 @@ class ModuleSASL : public Module
{
return Version("Provides support for IRC Authentication Layer (aka: atheme SASL) via AUTHENTICATE.",VF_VENDOR);
}
-
- void OnEvent(Event &ev) CXX11_OVERRIDE
- {
- cap.HandleEvent(ev);
- }
};
MODULE_INIT(ModuleSASL)
diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp
index aac0b9ce0..26a53b4d7 100644
--- a/src/modules/m_services_account.cpp
+++ b/src/modules/m_services_account.cpp
@@ -104,9 +104,12 @@ class AChannel_M : public SimpleChannelModeHandler
class AccountExtItemImpl : public AccountExtItem
{
+ Events::ModuleEventProvider eventprov;
+
public:
AccountExtItemImpl(Module* mod)
: AccountExtItem("accountname", ExtensionItem::EXT_USER, mod)
+ , eventprov(mod, "event/account")
{
}
@@ -123,14 +126,10 @@ class AccountExtItemImpl : public AccountExtItem
user->WriteNumeric(900, "%s %s :You are now logged in as %s",
user->GetFullHost().c_str(), value.c_str(), value.c_str());
}
-
- AccountEvent(creator, user, value).Send();
- }
- else
- {
- // Logged out
- AccountEvent(creator, user, "").Send();
}
+ // If value is empty then logged out
+
+ FOREACH_MOD_CUSTOM(eventprov, AccountEventListener, OnAccountChange, (user, value));
}
};
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 31d822789..e5e6e522b 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -39,6 +39,7 @@ ModuleSpanningTree::ModuleSpanningTree()
: rconnect(this), rsquit(this), map(this)
, commands(NULL)
, currmembid(0)
+ , eventprov(this, "event/spanningtree")
, DNS(this, "DNS")
, loopCall(false)
{
diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h
index 13c743f73..9fde32cad 100644
--- a/src/modules/m_spanningtree/main.h
+++ b/src/modules/m_spanningtree/main.h
@@ -24,6 +24,7 @@
#pragma once
#include "inspircd.h"
+#include "event.h"
#include "modules/dns.h"
#include "servercommand.h"
#include "commands.h"
@@ -72,6 +73,10 @@ class ModuleSpanningTree : public Module
*/
SpanningTreeProtocolInterface protocolinterface;
+ /** Event provider for our events
+ */
+ Events::ModuleEventProvider eventprov;
+
public:
dynamic_reference<DNS::Manager> DNS;
@@ -135,6 +140,8 @@ class ModuleSpanningTree : public Module
*/
static std::string TimeToStr(time_t secs);
+ const Events::ModuleEventProvider& GetEventProvider() const { return eventprov; }
+
/**
** *** MODULE EVENTS ***
**/
diff --git a/src/modules/m_spanningtree/treeserver.cpp b/src/modules/m_spanningtree/treeserver.cpp
index e004f897e..6ebce07f9 100644
--- a/src/modules/m_spanningtree/treeserver.cpp
+++ b/src/modules/m_spanningtree/treeserver.cpp
@@ -151,7 +151,7 @@ void TreeServer::FinishBurst()
unsigned long bursttime = ts - this->StartBurst;
ServerInstance->SNO->WriteToSnoMask(Parent == Utils->TreeRoot ? 'l' : 'L', "Received end of netburst from \2%s\2 (burst time: %lu %s)",
GetName().c_str(), (bursttime > 10000 ? bursttime / 1000 : bursttime), (bursttime > 10000 ? "secs" : "msecs"));
- AddServerEvent(Utils->Creator, GetName());
+ FOREACH_MOD_CUSTOM(Utils->Creator->GetEventProvider(), SpanningTreeEventListener, OnServerLink, (GetName()));
StartBurst = 0;
FinishBurstInternal();
@@ -159,7 +159,7 @@ void TreeServer::FinishBurst()
void TreeServer::SQuitChild(TreeServer* server, const std::string& reason)
{
- DelServerEvent(Utils->Creator, server->GetName());
+ FOREACH_MOD_CUSTOM(Utils->Creator->GetEventProvider(), SpanningTreeEventListener, OnServerSplit, (server->GetName()));
stdalgo::erase(Children, server);
if (IsRoot())
diff --git a/src/modules/m_starttls.cpp b/src/modules/m_starttls.cpp
index d591eed55..b05302fa9 100644
--- a/src/modules/m_starttls.cpp
+++ b/src/modules/m_starttls.cpp
@@ -102,11 +102,6 @@ class ModuleStartTLS : public Module
ssl.SetProvider("ssl/" + newprovider);
}
- void OnEvent(Event& ev) CXX11_OVERRIDE
- {
- tls.HandleEvent(ev);
- }
-
void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
{
tokens["STARTTLS"];
diff --git a/src/modules/m_uhnames.cpp b/src/modules/m_uhnames.cpp
index 0a171c4dc..90bac54f5 100644
--- a/src/modules/m_uhnames.cpp
+++ b/src/modules/m_uhnames.cpp
@@ -66,11 +66,6 @@ class ModuleUHNames : public Module
return MOD_RES_PASSTHRU;
}
-
- void OnEvent(Event& ev) CXX11_OVERRIDE
- {
- cap.HandleEvent(ev);
- }
};
MODULE_INIT(ModuleUHNames)