aboutsummaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorgrunfink <grunfink@comam.es>2025-06-07 07:53:00 +0200
committergrunfink <grunfink@comam.es>2025-06-07 07:53:00 +0200
commitd5dbdad930d44d9345bec03d0f2ce4076cb028a8 (patch)
tree15ec3540abf601860aeebb608d15af2ac49a3ac1 /html.c
parentc9c1323e40080acbd8bffe904e8ba8fc3ff8bbd7 (diff)
If a metadata value is an account handle, it's also verified using webfinger.
Diffstat (limited to 'html.c')
-rw-r--r--html.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/html.c b/html.c
index 892475c..f5d9aea 100644
--- a/html.c
+++ b/html.c
@@ -1077,10 +1077,17 @@ static xs_html *html_user_body(snac *user, int read_only)
while (xs_dict_next(metadata, &k, &v, &c)) {
xs_html *value;
- if (xs_startswith(v, "https:/") || xs_startswith(v, "http:/")) {
+ if (xs_startswith(v, "https:/") || xs_startswith(v, "http:/") || *v == '@') {
/* is this link validated? */
xs *verified_link = NULL;
const xs_number *val_time = xs_dict_get(val_links, v);
+ const char *url = NULL;
+
+ if (xs_is_string(val_time)) {
+ /* resolve again, as it may be an account handle */
+ url = val_time;
+ val_time = xs_dict_get(val_links, val_time);
+ }
if (xs_type(val_time) == XSTYPE_NUMBER) {
time_t t = xs_number_get(val_time);
@@ -1098,13 +1105,13 @@ static xs_html *html_user_body(snac *user, int read_only)
xs_html_tag("a",
xs_html_attr("rel", "me"),
xs_html_attr("target", "_blank"),
- xs_html_attr("href", v),
+ xs_html_attr("href", url ? url : v),
xs_html_text(v)));
}
else {
value = xs_html_tag("a",
xs_html_attr("rel", "me"),
- xs_html_attr("href", v),
+ xs_html_attr("href", url ? url : v),
xs_html_text(v));
}
}