From c7690513cdf317f9221cedf4892facdd100ef74d Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 10 Nov 2020 22:23:26 +0000 Subject: Convert FIRST_MOD_RESULT_CUSTOM to a variadic function. --- src/modules/m_httpd.cpp | 9 ++++----- src/modules/m_ircv3_ctctags.cpp | 3 +-- src/modules/m_spanningtree/utils.cpp | 3 +-- 3 files changed, 6 insertions(+), 9 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp index 2ca76af2a..42183447a 100644 --- a/src/modules/m_httpd.cpp +++ b/src/modules/m_httpd.cpp @@ -292,17 +292,16 @@ class HttpServerSocket : public BufferedSocket, public Timer, public insp::intru void ServeData() { - ModResult MOD_RESULT; std::string method = http_method_str(static_cast(parser.method)); HTTPRequestURI parsed; ParseURI(uri, parsed); HTTPRequest acl(method, parsed, &headers, this, ip, body); - FIRST_MOD_RESULT_CUSTOM(*aclevprov, HTTPACLEventListener, OnHTTPACLCheck, MOD_RESULT, (acl)); - if (MOD_RESULT != MOD_RES_DENY) + ModResult res = aclevprov->FirstResult(&HTTPACLEventListener::OnHTTPACLCheck, acl); + if (res != MOD_RES_DENY) { HTTPRequest request(method, parsed, &headers, this, ip, body); - FIRST_MOD_RESULT_CUSTOM(*reqevprov, HTTPRequestEventListener, OnHTTPRequest, MOD_RESULT, (request)); - if (MOD_RESULT == MOD_RES_PASSTHRU) + res = reqevprov->FirstResult(&HTTPRequestEventListener::OnHTTPRequest, request); + if (res == MOD_RES_PASSTHRU) { SendHTTPError(404); } diff --git a/src/modules/m_ircv3_ctctags.cpp b/src/modules/m_ircv3_ctctags.cpp index 2648207eb..168779aae 100644 --- a/src/modules/m_ircv3_ctctags.cpp +++ b/src/modules/m_ircv3_ctctags.cpp @@ -33,8 +33,7 @@ class CommandTagMsg : public Command bool FirePreEvents(User* source, MessageTarget& msgtarget, CTCTags::TagMessageDetails& msgdetails) { // Inform modules that a TAGMSG wants to be sent. - ModResult modres; - FIRST_MOD_RESULT_CUSTOM(tagevprov, CTCTags::EventListener, OnUserPreTagMessage, modres, (source, msgtarget, msgdetails)); + ModResult modres = tagevprov.FirstResult(&CTCTags::EventListener::OnUserPreTagMessage, source, msgtarget, msgdetails); if (modres == MOD_RES_DENY) { // Inform modules that a module blocked the TAGMSG. diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index 7c33d7a07..8b74b2aba 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -172,8 +172,7 @@ void SpanningTreeUtilities::GetListOfServersForChannel(Channel* c, TreeSocketSet // is used to keep the chanhistory module synchronised between servers. for (TreeServer::ChildServers::const_iterator i = children.begin(); i != children.end(); ++i) { - ModResult result; - FIRST_MOD_RESULT_CUSTOM(Creator->GetBroadcastEventProvider(), ServerProtocol::BroadcastEventListener, OnBroadcastMessage, result, (c, *i)); + ModResult result = Creator->GetBroadcastEventProvider().FirstResult(&ServerProtocol::BroadcastEventListener::OnBroadcastMessage, c, *i); if (result == MOD_RES_ALLOW) list.insert((*i)->GetSocket()); } -- cgit v1.3.1-10-gc9f91