aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Sadie Powell2020-11-10 22:23:26 +0000
committerGravatar Sadie Powell2020-11-10 22:23:26 +0000
commitc7690513cdf317f9221cedf4892facdd100ef74d (patch)
tree68ef30e051e99dcd2d9855e410806f2630e86f55 /src
parentOnly use libc++ when building with AppleClang. (diff)
Convert FIRST_MOD_RESULT_CUSTOM to a variadic function.
Diffstat (limited to 'src')
-rw-r--r--src/clientprotocol.cpp3
-rw-r--r--src/coremods/core_channel/cmd_names.cpp3
-rw-r--r--src/coremods/core_channel/extban.cpp3
-rw-r--r--src/coremods/core_stats.cpp5
-rw-r--r--src/coremods/core_user/cmd_away.cpp10
-rw-r--r--src/coremods/core_who.cpp3
-rw-r--r--src/coremods/core_whois.cpp6
-rw-r--r--src/modules/m_httpd.cpp9
-rw-r--r--src/modules/m_ircv3_ctctags.cpp3
-rw-r--r--src/modules/m_spanningtree/utils.cpp3
10 files changed, 18 insertions, 30 deletions
diff --git a/src/clientprotocol.cpp b/src/clientprotocol.cpp
index 666aa9af6..8248f4ac4 100644
--- a/src/clientprotocol.cpp
+++ b/src/clientprotocol.cpp
@@ -99,8 +99,7 @@ void ClientProtocol::Event::GetMessagesForUser(LocalUser* user, MessageList& mes
messagelist = *initialmsglist;
// Let modules modify the message list
- ModResult res;
- FIRST_MOD_RESULT_CUSTOM(*event, EventHook, OnPreEventSend, res, (user, *this, messagelist));
+ ModResult res = event->FirstResult(&EventHook::OnPreEventSend, user, *this, messagelist);
if (res == MOD_RES_DENY)
messagelist.clear();
}
diff --git a/src/coremods/core_channel/cmd_names.cpp b/src/coremods/core_channel/cmd_names.cpp
index 6e5530685..2df9908d8 100644
--- a/src/coremods/core_channel/cmd_names.cpp
+++ b/src/coremods/core_channel/cmd_names.cpp
@@ -109,8 +109,7 @@ void CommandNames::SendNames(LocalUser* user, Channel* chan, bool show_invisible
prefixlist.push_back(prefix);
nick = i->first->nick;
- ModResult res;
- FIRST_MOD_RESULT_CUSTOM(namesevprov, Names::EventListener, OnNamesListItem, res, (user, memb, prefixlist, nick));
+ ModResult res = namesevprov.FirstResult(&Names::EventListener::OnNamesListItem, user, memb, prefixlist, nick);
if (res != MOD_RES_DENY)
reply.Add(prefixlist, nick);
}
diff --git a/src/coremods/core_channel/extban.cpp b/src/coremods/core_channel/extban.cpp
index 7478f33cb..f9ae24eca 100644
--- a/src/coremods/core_channel/extban.cpp
+++ b/src/coremods/core_channel/extban.cpp
@@ -37,8 +37,7 @@ void ExtBanManager::BuildISupport(std::string& out)
ModResult ExtBanManager::GetStatus(ExtBan::Acting* extban, User* user, Channel* channel) const
{
- ModResult res;
- FIRST_MOD_RESULT_CUSTOM(evprov, ExtBan::EventListener, OnExtBanCheck, res, (user, channel, extban));
+ ModResult res = evprov.FirstResult(&ExtBan::EventListener::OnExtBanCheck, user, channel, extban);
if (res != MOD_RES_PASSTHRU)
return res;
diff --git a/src/coremods/core_stats.cpp b/src/coremods/core_stats.cpp
index fb2d85fad..9de94929d 100644
--- a/src/coremods/core_stats.cpp
+++ b/src/coremods/core_stats.cpp
@@ -99,9 +99,8 @@ void CommandStats::DoStats(Stats::Context& stats)
return;
}
- ModResult MOD_RESULT;
- FIRST_MOD_RESULT_CUSTOM(statsevprov, Stats::EventListener, OnStats, MOD_RESULT, (stats));
- if (MOD_RESULT == MOD_RES_DENY)
+ ModResult res = statsevprov.FirstResult(&Stats::EventListener::OnStats, stats);
+ if (res == MOD_RES_DENY)
{
stats.AddRow(219, statschar, "End of /STATS report");
ServerInstance->SNO.WriteToSnoMask('t',"%s '%c' requested by %s (%s@%s)",
diff --git a/src/coremods/core_user/cmd_away.cpp b/src/coremods/core_user/cmd_away.cpp
index 6c3d773aa..15934702e 100644
--- a/src/coremods/core_user/cmd_away.cpp
+++ b/src/coremods/core_user/cmd_away.cpp
@@ -47,15 +47,13 @@ CommandAway::CommandAway(Module* parent)
CmdResult CommandAway::Handle(User* user, const Params& parameters)
{
LocalUser* luser = IS_LOCAL(user);
- ModResult MOD_RESULT;
-
if (!parameters.empty())
{
std::string message(parameters[0]);
if (luser)
{
- FIRST_MOD_RESULT_CUSTOM(awayevprov, Away::EventListener, OnUserPreAway, MOD_RESULT, (luser, message));
- if (MOD_RESULT == MOD_RES_DENY)
+ ModResult res = awayevprov.FirstResult(&Away::EventListener::OnUserPreAway, luser, message);
+ if (res == MOD_RES_DENY)
return CmdResult::FAILURE;
}
@@ -68,8 +66,8 @@ CmdResult CommandAway::Handle(User* user, const Params& parameters)
{
if (luser)
{
- FIRST_MOD_RESULT_CUSTOM(awayevprov, Away::EventListener, OnUserPreBack, MOD_RESULT, (luser));
- if (MOD_RESULT == MOD_RES_DENY)
+ ModResult res = awayevprov.FirstResult(&Away::EventListener::OnUserPreBack, luser);
+ if (res == MOD_RES_DENY)
return CmdResult::FAILURE;
}
diff --git a/src/coremods/core_who.cpp b/src/coremods/core_who.cpp
index f0e91397b..93f782318 100644
--- a/src/coremods/core_who.cpp
+++ b/src/coremods/core_who.cpp
@@ -552,8 +552,7 @@ void CommandWho::SendWhoLine(LocalUser* source, const std::vector<std::string>&
wholine.GetParams().back().append(user->GetRealName());
}
- ModResult res;
- FIRST_MOD_RESULT_CUSTOM(whoevprov, Who::EventListener, OnWhoLine, res, (data, source, user, memb, wholine));
+ ModResult res = whoevprov.FirstResult(&Who::EventListener::OnWhoLine, data, source, user, memb, wholine);
if (res != MOD_RES_DENY)
data.results.push_back(wholine);
}
diff --git a/src/coremods/core_whois.cpp b/src/coremods/core_whois.cpp
index adcdaae25..7b01a3925 100644
--- a/src/coremods/core_whois.cpp
+++ b/src/coremods/core_whois.cpp
@@ -75,10 +75,8 @@ class WhoisContextImpl : public Whois::Context
void WhoisContextImpl::SendLine(Numeric::Numeric& numeric)
{
- ModResult MOD_RESULT;
- FIRST_MOD_RESULT_CUSTOM(lineevprov, Whois::LineEventListener, OnWhoisLine, MOD_RESULT, (*this, numeric));
-
- if (MOD_RESULT != MOD_RES_DENY)
+ ModResult res = lineevprov.FirstResult(&Whois::LineEventListener::OnWhoisLine, *this, numeric);
+ if (res != MOD_RES_DENY)
source->WriteNumeric(numeric);
}
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());
}