0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

modules/webhook: Support organization-level webhooks in header display.

This commit is contained in:
Jason Volk 2019-03-27 14:46:01 -07:00
parent 99f3c842d1
commit ee9e82f53c

View file

@ -221,9 +221,26 @@ github_heading(std::ostream &out,
content["repository"]
};
out << "<a href=\"" << unquote(repository["html_url"]) << "\">"
<< unquote(repository["full_name"])
<< "</a>";
const json::object organization
{
content["organization"]
};
if(empty(repository))
{
const auto url
{
lstrip(unquote(organization["url"]), "https://api.")
};
out << "<a href=\"https://" << url << "\">"
<< unquote(organization["login"])
<< "</a>";
}
else
out << "<a href=" << repository["html_url"] << ">"
<< unquote(repository["full_name"])
<< "</a>";
const string_view commit_hash
{