commit 91207fb

default  ·  2024-02-28 14:16:28 +0000 UTC
parent 99f486c
mastoapi: fixed a bug in validated links.
2 files changed,  +9, -4
M snac.h
+8, -3
 1@@ -624,12 +624,15 @@ xs_dict *mastoapi_account(const xs_dict *actor)
 2 
 3     /* dict of validated links */
 4     xs_dict *val_links = NULL;
 5+    xs_dict *metadata  = xs_stock_dict;
 6     snac user = {0};
 7 
 8     if (xs_startswith(id, srv_baseurl)) {
 9         /* if it's a local user, open it and pick its validated links */
10-        if (user_open(&user, prefu))
11+        if (user_open(&user, prefu)) {
12             val_links = user.links;
13+            metadata  = xs_dict_get_def(user.config, "metadata", xs_stock_dict);
14+        }
15     }
16 
17     if (xs_is_null(val_links))
18@@ -644,8 +647,10 @@ xs_dict *mastoapi_account(const xs_dict *actor)
19             !xs_is_null(value) && strcmp(type, "PropertyValue") == 0) {
20             xs *val_date = NULL;
21 
22-            if (xs_startswith(value, "https:/" "/")) {
23-                xs_number *verified_time = xs_dict_get(val_links, value);
24+            char *url = xs_dict_get(metadata, name);
25+
26+            if (xs_startswith(url, "https:/" "/")) {
27+                xs_number *verified_time = xs_dict_get(val_links, url);
28                 if (xs_type(verified_time) == XSTYPE_NUMBER) {
29                     time_t t = xs_number_get(verified_time);
30 
M snac.h
+1, -1
1@@ -1,7 +1,7 @@
2 /* snac - A simple, minimalistic ActivityPub instance */
3 /* copyright (c) 2022 - 2024 grunfink et al. / MIT license */
4 
5-#define VERSION "2.48"
6+#define VERSION "2.49-dev"
7 
8 #define USER_AGENT "snac/" VERSION
9