Add support for bot mark
This commit is contained in:
parent
2df649af8e
commit
64edd2f4a1
|
@ -33,6 +33,7 @@ void from_json(const json& j, Account& account) {
|
||||||
j.at("id").get_to(account.id);
|
j.at("id").get_to(account.id);
|
||||||
j.at("username").get_to(account.username);
|
j.at("username").get_to(account.username);
|
||||||
j.at("display_name").get_to(account.display_name);
|
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.created_at = parse_rfc3339(j.at("created_at").get_ref<const std::string&>());
|
||||||
account.note_html = j.at("note").get<std::string>();
|
account.note_html = j.at("note").get<std::string>();
|
||||||
j.at("avatar").get_to(account.avatar);
|
j.at("avatar").get_to(account.avatar);
|
||||||
|
|
1
models.h
1
models.h
|
@ -29,6 +29,7 @@ struct Account {
|
||||||
std::string server;
|
std::string server;
|
||||||
bool same_server;
|
bool same_server;
|
||||||
std::string display_name;
|
std::string display_name;
|
||||||
|
bool bot;
|
||||||
time_t created_at;
|
time_t created_at;
|
||||||
blankie::html::HTMLString note_html;
|
blankie::html::HTMLString note_html;
|
||||||
std::string avatar;
|
std::string avatar;
|
||||||
|
|
|
@ -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("img", {{"class", "user_page-profile"}, {"alt", "User profile picture"}, {"src", account.avatar}}, {}),
|
||||||
}),
|
}),
|
||||||
Element("span", {
|
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("br"), Element("b", {"Joined: "}), short_time(account.created_at),
|
Element("br"), Element("b", {"Joined: "}), short_time(account.created_at),
|
||||||
Element("br"),
|
Element("br"),
|
||||||
|
|
Loading…
Reference in New Issue