mirror of
https://github.com/matrix-construct/construct
synced 2024-10-06 07:38:52 +02:00
modules/web_hook: Support organization/member_removed detail; tweak format.
This commit is contained in:
parent
bfc6a522f2
commit
50d18d73cb
1 changed files with 34 additions and 5 deletions
|
@ -931,11 +931,22 @@ github_handle__organization(std::ostream &out,
|
||||||
content["action"]
|
content["action"]
|
||||||
};
|
};
|
||||||
|
|
||||||
out << " "
|
const auto &action_words
|
||||||
|
{
|
||||||
|
split(action, '_')
|
||||||
|
};
|
||||||
|
|
||||||
|
out
|
||||||
|
<< " "
|
||||||
<< "<b>"
|
<< "<b>"
|
||||||
<< action
|
<< action_words.first;
|
||||||
<< "</b>"
|
|
||||||
;
|
if(action_words.second)
|
||||||
|
out
|
||||||
|
<< " "
|
||||||
|
<< split(action, '_').second;
|
||||||
|
|
||||||
|
out << "</b>";
|
||||||
|
|
||||||
if(action == "member_added")
|
if(action == "member_added")
|
||||||
{
|
{
|
||||||
|
@ -959,6 +970,24 @@ github_handle__organization(std::ostream &out,
|
||||||
<< json::string(membership["role"])
|
<< 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue