summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-02-20 06:10:42 +0100
committerdefault <nobody@localhost>2024-02-20 06:10:42 +0100
commita3b9ef5b98530a81f648b397fed91d78349dc4cd (patch)
tree1c5cee9bdbe8127e3079eba761f4d084fa9322b5 /html.c
parentd583a35d9e3761f31a7189006aaae97815b283fe (diff)
The link verification time is stored as a time_t.
This way, it will be easier in an eventual future to test if a link verification is too old to be trusted.
Diffstat (limited to 'html.c')
-rw-r--r--html.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/html.c b/html.c
index d8dcb3a..5407e22 100644
--- a/html.c
+++ b/html.c
@@ -779,11 +779,21 @@ static xs_html *html_user_body(snac *user, int local)
if (xs_startswith(v, "https:/" "/")) {
/* is this link validated? */
- char *val_date = xs_dict_get(val_links, v);
+ xs *verified_link = NULL;
+ xs_number *val_time = xs_dict_get(val_links, v);
- if (!xs_is_null(val_date) && *val_date) {
+ if (xs_type(val_time) == XSTYPE_NUMBER) {
+ time_t t = xs_number_get(val_time);
+
+ if (t > 0) {
+ xs *s1 = xs_str_utctime(t, ISO_DATE_SPEC);
+ verified_link = xs_fmt("%s (%s)", L("verified link"), s1);
+ }
+ }
+
+ if (!xs_is_null(verified_link)) {
value = xs_html_tag("span",
- xs_html_attr("title", L("verified link")),
+ xs_html_attr("title", verified_link),
xs_html_raw("&#10004; "),
xs_html_tag("a",
xs_html_attr("href", v),