mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 13:25:04 +00:00
Show validation checks and rel=me in links in the public page.
This commit is contained in:
parent
f066ac6bda
commit
d106f86a67
1 changed files with 22 additions and 4 deletions
20
html.c
20
html.c
|
@ -767,16 +767,34 @@ static xs_html *html_user_body(snac *user, int local)
|
||||||
xs_str *k;
|
xs_str *k;
|
||||||
xs_str *v;
|
xs_str *v;
|
||||||
|
|
||||||
|
xs_dict *val_metadata = xs_dict_get(user->config, "validated_metadata");
|
||||||
|
if (xs_is_null(val_metadata))
|
||||||
|
val_metadata = xs_stock_dict;
|
||||||
|
|
||||||
xs_html *snac_metadata = xs_html_tag("div",
|
xs_html *snac_metadata = xs_html_tag("div",
|
||||||
xs_html_attr("class", "snac-metadata"));
|
xs_html_attr("class", "snac-metadata"));
|
||||||
|
|
||||||
while (xs_dict_iter(&metadata, &k, &v)) {
|
while (xs_dict_iter(&metadata, &k, &v)) {
|
||||||
xs_html *value;
|
xs_html *value;
|
||||||
|
|
||||||
if (xs_startswith(v, "https:/" "/"))
|
if (xs_startswith(v, "https:/" "/")) {
|
||||||
|
/* is this link validated? */
|
||||||
|
char *val_date = xs_dict_get(val_metadata, v);
|
||||||
|
|
||||||
|
if (!xs_is_null(val_date) && *val_date) {
|
||||||
|
value = xs_html_container(
|
||||||
|
xs_html_raw("✔ "),
|
||||||
|
xs_html_tag("a",
|
||||||
|
xs_html_attr("href", v),
|
||||||
|
xs_html_attr("rel", "me"),
|
||||||
|
xs_html_text(v)));
|
||||||
|
}
|
||||||
|
else {
|
||||||
value = xs_html_tag("a",
|
value = xs_html_tag("a",
|
||||||
xs_html_attr("href", v),
|
xs_html_attr("href", v),
|
||||||
xs_html_text(v));
|
xs_html_text(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
value = xs_html_text(v);
|
value = xs_html_text(v);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue