diff options
| author | 2020-11-10 22:23:26 +0000 | |
|---|---|---|
| committer | 2020-11-10 22:23:26 +0000 | |
| commit | c7690513cdf317f9221cedf4892facdd100ef74d (patch) | |
| tree | 68ef30e051e99dcd2d9855e410806f2630e86f55 /src/modules | |
| parent | Only use libc++ when building with AppleClang. (diff) | |
Convert FIRST_MOD_RESULT_CUSTOM to a variadic function.
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/m_httpd.cpp | 9 | ||||
| -rw-r--r-- | src/modules/m_ircv3_ctctags.cpp | 3 | ||||
| -rw-r--r-- | src/modules/m_spanningtree/utils.cpp | 3 |
3 files changed, 6 insertions, 9 deletions
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<http_method>(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()); } |
