summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-02-28 15:16:28 +0100
committerdefault <nobody@localhost>2024-02-28 15:16:28 +0100
commit91207fbe39c97e46efee463686d60343ec9a4da9 (patch)
tree686b552848ec78bc77cba5a0a821130568de9fac
parent99f486cec0eed26b4ac9788c6c8e8df4c8e3b333 (diff)
mastoapi: fixed a bug in validated links.
-rw-r--r--mastoapi.c11
-rw-r--r--snac.h2
2 files changed, 9 insertions, 4 deletions
diff --git a/mastoapi.c b/mastoapi.c
index 0a0c3d6..fd89341 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -624,12 +624,15 @@ xs_dict *mastoapi_account(const xs_dict *actor)
/* dict of validated links */
xs_dict *val_links = NULL;
+ xs_dict *metadata = xs_stock_dict;
snac user = {0};
if (xs_startswith(id, srv_baseurl)) {
/* if it's a local user, open it and pick its validated links */
- if (user_open(&user, prefu))
+ if (user_open(&user, prefu)) {
val_links = user.links;
+ metadata = xs_dict_get_def(user.config, "metadata", xs_stock_dict);
+ }
}
if (xs_is_null(val_links))
@@ -644,8 +647,10 @@ xs_dict *mastoapi_account(const xs_dict *actor)
!xs_is_null(value) && strcmp(type, "PropertyValue") == 0) {
xs *val_date = NULL;
- if (xs_startswith(value, "https:/" "/")) {
- xs_number *verified_time = xs_dict_get(val_links, value);
+ char *url = xs_dict_get(metadata, name);
+
+ if (xs_startswith(url, "https:/" "/")) {
+ xs_number *verified_time = xs_dict_get(val_links, url);
if (xs_type(verified_time) == XSTYPE_NUMBER) {
time_t t = xs_number_get(verified_time);
diff --git a/snac.h b/snac.h
index adf414b..85a8d2b 100644
--- a/snac.h
+++ b/snac.h
@@ -1,7 +1,7 @@
/* snac - A simple, minimalistic ActivityPub instance */
/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
-#define VERSION "2.48"
+#define VERSION "2.49-dev"
#define USER_AGENT "snac/" VERSION