summaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-02-15 17:34:46 +0100
committerdefault <nobody@localhost>2024-02-15 17:34:46 +0100
commit263e239653b79d230a7546b9db89ff71dc0f2a53 (patch)
tree7d3718fe8a7927f4ea34028e2280ae384a05142b /mastoapi.c
parent2afcb4b6ecafeb852abb2d0bb48d170b469a5a36 (diff)
Moved verified links to its own json file.
Diffstat (limited to 'mastoapi.c')
-rw-r--r--mastoapi.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/mastoapi.c b/mastoapi.c
index 4b7122c..8dcd6b4 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -624,15 +624,12 @@ xs_dict *mastoapi_account(const xs_dict *actor)
/* dict of validated links */
xs_dict *val_links = NULL;
+ snac user = {0};
if (xs_startswith(id, srv_baseurl)) {
/* if it's a local user, open it and pick its validated links */
- snac user;
-
- if (user_open(&user, prefu)) {
- val_links = xs_dict_get(user.config, "validated_links");
- user_free(&user);
- }
+ if (user_open(&user, prefu))
+ val_links = user.links;
}
if (xs_is_null(val_links))
@@ -662,6 +659,8 @@ xs_dict *mastoapi_account(const xs_dict *actor)
}
}
+ user_free(&user);
+
acct = xs_dict_append(acct, "fields", fields);
return acct;
@@ -1157,7 +1156,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
xs_str *k;
xs_str *v;
- xs_dict *val_links = xs_dict_get(snac1.config, "validated_links");
+ xs_dict *val_links = snac1.links;
if (xs_is_null(val_links))
val_links = xs_stock_dict;