mirror of
https://github.com/matrix-construct/construct
synced 2024-12-27 07:54:05 +01:00
modules/webhook: Handle the repository github event.
This commit is contained in:
parent
754adf33ec
commit
ae83682e2d
1 changed files with 23 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue