summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-02-14 22:56:56 +0100
committerdefault <nobody@localhost>2024-02-14 22:56:56 +0100
commitd106f86a676ad39fcf76b15ac6b982fca48c9f42 (patch)
tree41bf25c2a3692464b0c331b89704d9582d22adda /html.c
parentf066ac6bda6762399ceaaea94bed8bf3cf293026 (diff)
Show validation checks and rel=me in links in the public page.
Diffstat (limited to 'html.c')
-rw-r--r--html.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/html.c b/html.c
index 1cd27e1..9f38f1a 100644
--- a/html.c
+++ b/html.c
@@ -767,16 +767,34 @@ static xs_html *html_user_body(snac *user, int local)
xs_str *k;
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_attr("class", "snac-metadata"));
while (xs_dict_iter(&metadata, &k, &v)) {
xs_html *value;
- if (xs_startswith(v, "https:/" "/"))
- value = xs_html_tag("a",
- xs_html_attr("href", v),
- xs_html_text(v));
+ 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("&#10004; "),
+ xs_html_tag("a",
+ xs_html_attr("href", v),
+ xs_html_attr("rel", "me"),
+ xs_html_text(v)));
+ }
+ else {
+ value = xs_html_tag("a",
+ xs_html_attr("href", v),
+ xs_html_text(v));
+ }
+ }
else
value = xs_html_text(v);