0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-10-04 14:48:56 +02:00

modules/webhook: Handle the star event.

This commit is contained in:
Jason Volk 2019-05-31 17:17:12 -07:00
parent eb73595c50
commit 5238e919fa

View file

@ -129,6 +129,10 @@ static std::ostream &
github_handle__watch(std::ostream &, github_handle__watch(std::ostream &,
const json::object &content); const json::object &content);
static std::ostream &
github_handle__star(std::ostream &,
const json::object &content);
static std::ostream & static std::ostream &
github_handle__label(std::ostream &, github_handle__label(std::ostream &,
const json::object &content); const json::object &content);
@ -214,6 +218,8 @@ github_handle(client &client,
github_handle__issue_comment(out, request.content); github_handle__issue_comment(out, request.content);
else if(type == "watch") else if(type == "watch")
github_handle__watch(out, request.content); github_handle__watch(out, request.content);
else if(type == "star")
github_handle__star(out, request.content);
else if(type == "label") else if(type == "label")
github_handle__label(out, request.content); github_handle__label(out, request.content);
else if(type == "organization") else if(type == "organization")
@ -1003,11 +1009,17 @@ github_handle__watch(std::ostream &out,
unquote(content["action"]) unquote(content["action"])
}; };
if(action == "started")
{
out << " with a star";
return out; return out;
} }
std::ostream &
github_handle__star(std::ostream &out,
const json::object &content)
{
const string_view action
{
unquote(content["action"])
};
return out; return out;
} }