Add support for bot mark

This commit is contained in:
blankie 2023-11-24 20:04:49 +11:00
parent 2df649af8e
commit 64edd2f4a1
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
3 changed files with 3 additions and 1 deletions

View File

@ -33,6 +33,7 @@ void from_json(const json& j, Account& account) {
j.at("id").get_to(account.id);
j.at("username").get_to(account.username);
j.at("display_name").get_to(account.display_name);
j.at("bot").get_to(account.bot);
account.created_at = parse_rfc3339(j.at("created_at").get_ref<const std::string&>());
account.note_html = j.at("note").get<std::string>();
j.at("avatar").get_to(account.avatar);

View File

@ -29,6 +29,7 @@ struct Account {
std::string server;
bool same_server;
std::string display_name;
bool bot;
time_t created_at;
blankie::html::HTMLString note_html;
std::string avatar;

View File

@ -106,7 +106,7 @@ static inline Element user_header(const httplib::Request& req, const std::string
Element("img", {{"class", "user_page-profile"}, {"alt", "User profile picture"}, {"src", account.avatar}}, {}),
}),
Element("span", {
Element("b", {preprocess_html(req, account.emojis, account.display_name)}), " (@", account.acct(), ")", view_on_original,
Element("b", {preprocess_html(req, account.emojis, account.display_name)}), account.bot ? " (bot)" : "", " (@", account.acct(), ")", view_on_original,
Element("br"),
Element("br"), Element("b", {"Joined: "}), short_time(account.created_at),
Element("br"),