0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-03-17 06:50:23 +01:00

modules/web_hook: Query proper attributes to determine delete op on push.

This commit is contained in:
Jason Volk 2020-12-28 20:48:48 -08:00
parent 3e2e876ebe
commit d20e53f33a

View file

@ -522,6 +522,21 @@ bool
github_handle__push(std::ostream &out,
const json::object &content)
{
const bool created
{
content.get("created", false)
};
const bool deleted
{
content.get("deleted", false)
};
const bool forced
{
content.get("forced", false)
};
const json::array commits
{
content["commits"]
@ -532,7 +547,7 @@ github_handle__push(std::ostream &out,
size(commits)
};
if(!count)
if(!count && deleted)
{
out << " <font color=\"#FF0000\">";
if(content["ref"])
@ -542,6 +557,9 @@ github_handle__push(std::ostream &out,
return true;
}
if(!count && !webhook_status_verbose)
return false;
if(content["ref"])
{
const json::string ref(content["ref"]);