0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 08:42:34 +01:00

modules/webhook: Handle the github delete event.

This commit is contained in:
Jason Volk 2019-06-25 07:57:57 -07:00
parent ae83682e2d
commit 90095b0034

View file

@ -149,6 +149,10 @@ static bool
github_handle__repository(std::ostream &,
const json::object &content);
static bool
github_handle__delete(std::ostream &,
const json::object &content);
static bool
github_handle__ping(std::ostream &,
const json::object &content);
@ -228,6 +232,8 @@ github_handle(client &client,
github_handle__status(out, request.content):
type == "repository"?
github_handle__repository(out, request.content):
type == "delete"?
github_handle__delete(out, request.content):
true // unhandled will just show heading
};
@ -1072,6 +1078,29 @@ github_handle__repository(std::ostream &out,
return true;
}
bool
github_handle__delete(std::ostream &out,
const json::object &content)
{
const json::string &ref
{
content["ref"]
};
const json::string &ref_type
{
content["ref_type"]
};
out << ' '
<< ref_type
<< ' '
<< ref
;
return true;
}
bool
github_handle__ping(std::ostream &out,
const json::object &content)