0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-05 10:08:36 +02:00

modules/web_hook: Support organization/member_removed detail; tweak format.

This commit is contained in:
Jason Volk 2019-08-19 15:20:32 -07:00
parent bfc6a522f2
commit 50d18d73cb

View file

@ -931,11 +931,22 @@ github_handle__organization(std::ostream &out,
content["action"]
};
out << " "
<< "<b>"
<< action
<< "</b>"
;
const auto &action_words
{
split(action, '_')
};
out
<< " "
<< "<b>"
<< action_words.first;
if(action_words.second)
out
<< " "
<< split(action, '_').second;
out << "</b>";
if(action == "member_added")
{
@ -959,6 +970,24 @@ github_handle__organization(std::ostream &out,
<< json::string(membership["role"])
;
}
else if(action == "member_removed")
{
const json::object &membership
{
content["membership"]
};
const json::object &user
{
membership["user"]
};
out << " "
<< "<a href=" << user["html_url"] << ">"
<< json::string(user["login"])
<< "</a>"
;
}
return true;
}