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:
parent
ae83682e2d
commit
90095b0034
1 changed files with 29 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue