0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

modules/webhook: Handle the repository github event.

This commit is contained in:
Jason Volk 2019-06-25 07:52:00 -07:00
parent 754adf33ec
commit ae83682e2d

View file

@ -145,6 +145,10 @@ static bool
github_handle__status(std::ostream &,
const json::object &content);
static bool
github_handle__repository(std::ostream &,
const json::object &content);
static bool
github_handle__ping(std::ostream &,
const json::object &content);
@ -222,6 +226,8 @@ github_handle(client &client,
github_handle__organization(out, request.content):
type == "status"?
github_handle__status(out, request.content):
type == "repository"?
github_handle__repository(out, request.content):
true // unhandled will just show heading
};
@ -1049,6 +1055,23 @@ github_handle__star(std::ostream &out,
return true;
}
bool
github_handle__repository(std::ostream &out,
const json::object &content)
{
const json::string &action
{
content["action"]
};
out << ' ' << action;
out << "<pre><code>"
<< unquote(content["description"])
<< "</code></pre>";
return true;
}
bool
github_handle__ping(std::ostream &out,
const json::object &content)