diff options
| author | 2024-02-15 17:34:46 +0100 | |
|---|---|---|
| committer | 2024-02-15 17:34:46 +0100 | |
| commit | 263e239653b79d230a7546b9db89ff71dc0f2a53 (patch) | |
| tree | 7d3718fe8a7927f4ea34028e2280ae384a05142b /mastoapi.c | |
| parent | mastoapi: fill the verified_at fields in mastoapi_account() for local users. (diff) | |
| download | snac2-263e239653b79d230a7546b9db89ff71dc0f2a53.tar.gz snac2-263e239653b79d230a7546b9db89ff71dc0f2a53.tar.xz snac2-263e239653b79d230a7546b9db89ff71dc0f2a53.zip | |
Moved verified links to its own json file.
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 13 |
1 files changed, 6 insertions, 7 deletions
| @@ -624,15 +624,12 @@ xs_dict *mastoapi_account(const xs_dict *actor) | |||
| 624 | 624 | ||
| 625 | /* dict of validated links */ | 625 | /* dict of validated links */ |
| 626 | xs_dict *val_links = NULL; | 626 | xs_dict *val_links = NULL; |
| 627 | snac user = {0}; | ||
| 627 | 628 | ||
| 628 | if (xs_startswith(id, srv_baseurl)) { | 629 | if (xs_startswith(id, srv_baseurl)) { |
| 629 | /* if it's a local user, open it and pick its validated links */ | 630 | /* if it's a local user, open it and pick its validated links */ |
| 630 | snac user; | 631 | if (user_open(&user, prefu)) |
| 631 | 632 | val_links = user.links; | |
| 632 | if (user_open(&user, prefu)) { | ||
| 633 | val_links = xs_dict_get(user.config, "validated_links"); | ||
| 634 | user_free(&user); | ||
| 635 | } | ||
| 636 | } | 633 | } |
| 637 | 634 | ||
| 638 | if (xs_is_null(val_links)) | 635 | if (xs_is_null(val_links)) |
| @@ -662,6 +659,8 @@ xs_dict *mastoapi_account(const xs_dict *actor) | |||
| 662 | } | 659 | } |
| 663 | } | 660 | } |
| 664 | 661 | ||
| 662 | user_free(&user); | ||
| 663 | |||
| 665 | acct = xs_dict_append(acct, "fields", fields); | 664 | acct = xs_dict_append(acct, "fields", fields); |
| 666 | 665 | ||
| 667 | return acct; | 666 | return acct; |
| @@ -1157,7 +1156,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1157 | xs_str *k; | 1156 | xs_str *k; |
| 1158 | xs_str *v; | 1157 | xs_str *v; |
| 1159 | 1158 | ||
| 1160 | xs_dict *val_links = xs_dict_get(snac1.config, "validated_links"); | 1159 | xs_dict *val_links = snac1.links; |
| 1161 | if (xs_is_null(val_links)) | 1160 | if (xs_is_null(val_links)) |
| 1162 | val_links = xs_stock_dict; | 1161 | val_links = xs_stock_dict; |
| 1163 | 1162 | ||