0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-15 22:41:12 +01:00

modules/webhook: Toggle non-failure status events via conf item.

This commit is contained in:
Jason Volk 2019-04-11 08:17:55 -07:00
parent ebdbc0864c
commit b353f3d0ac

View file

@ -41,6 +41,13 @@ webhook_url
{ "default", "/webhook" }
};
conf::item<bool>
webhook_status_verbose
{
{ "name", "webhook.github.status.verbose" },
{ "default", true },
};
resource
webhook_resource
{
@ -174,9 +181,17 @@ github_handle(client &client,
};
if(type == "status")
{
if(unquote(request["state"]) == "pending")
return;
if(!webhook_status_verbose) switch(hash(unquote(request["state"])))
{
case "failure"_: break;
default: return;
}
}
const unique_buffer<mutable_buffer> buf
{
48_KiB
@ -945,7 +960,6 @@ github_handle__status(std::ostream &out,
content["target_url"]
};
if(state == "success")
out << " "
<< "<font data-mx-bg-color=\"#03B381\">"