diff options
| -rw-r--r-- | activitypub.c | 6 | ||||
| -rw-r--r-- | data.c | 2 | ||||
| -rw-r--r-- | mastoapi.c | 16 |
3 files changed, 11 insertions, 13 deletions
diff --git a/activitypub.c b/activitypub.c index a7e133a..120b4a1 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -3204,8 +3204,7 @@ int activitypub_get_handler(const xs_dict *req, const char *q_path, | |||
| 3204 | int total = 0; | 3204 | int total = 0; |
| 3205 | 3205 | ||
| 3206 | if (show_contact_metrics) { | 3206 | if (show_contact_metrics) { |
| 3207 | xs *l = follower_list(&snac); | 3207 | total = follower_list_len(&snac); |
| 3208 | total = xs_list_len(l); | ||
| 3209 | } | 3208 | } |
| 3210 | 3209 | ||
| 3211 | xs *id = xs_fmt("%s/%s", snac.actor, p_path); | 3210 | xs *id = xs_fmt("%s/%s", snac.actor, p_path); |
| @@ -3216,8 +3215,7 @@ int activitypub_get_handler(const xs_dict *req, const char *q_path, | |||
| 3216 | int total = 0; | 3215 | int total = 0; |
| 3217 | 3216 | ||
| 3218 | if (show_contact_metrics) { | 3217 | if (show_contact_metrics) { |
| 3219 | xs *l = following_list(&snac); | 3218 | total = following_list_len(&snac); |
| 3220 | total = xs_list_len(l); | ||
| 3221 | } | 3219 | } |
| 3222 | 3220 | ||
| 3223 | xs *id = xs_fmt("%s/%s", snac.actor, p_path); | 3221 | xs *id = xs_fmt("%s/%s", snac.actor, p_path); |
| @@ -1216,7 +1216,7 @@ int follower_check(snac *snac, const char *actor) | |||
| 1216 | 1216 | ||
| 1217 | 1217 | ||
| 1218 | int follower_list_len(snac *snac) | 1218 | int follower_list_len(snac *snac) |
| 1219 | /* returns the number followers */ | 1219 | /* returns the number of followers */ |
| 1220 | { | 1220 | { |
| 1221 | xs *list = object_user_cache_list(snac, "followers", XS_ALL, 0); | 1221 | xs *list = object_user_cache_list(snac, "followers", XS_ALL, 0); |
| 1222 | return xs_list_len(list); | 1222 | return xs_list_len(list); |
| @@ -680,10 +680,10 @@ xs_dict *mastoapi_account(snac *logged, const xs_dict *actor) | |||
| 680 | 680 | ||
| 681 | /* does this user want to publish their contact metrics? */ | 681 | /* does this user want to publish their contact metrics? */ |
| 682 | if (xs_is_true(xs_dict_get(user.config, "show_contact_metrics"))) { | 682 | if (xs_is_true(xs_dict_get(user.config, "show_contact_metrics"))) { |
| 683 | xs *fwing = following_list(&user); | 683 | int fwing = following_list_len(&user); |
| 684 | xs *fwers = follower_list(&user); | 684 | int fwers = follower_list_len(&user); |
| 685 | xs *ni = xs_number_new(xs_list_len(fwing)); | 685 | xs *ni = xs_number_new(fwing); |
| 686 | xs *ne = xs_number_new(xs_list_len(fwers)); | 686 | xs *ne = xs_number_new(fwers); |
| 687 | 687 | ||
| 688 | acct = xs_dict_append(acct, "followers_count", ne); | 688 | acct = xs_dict_append(acct, "followers_count", ne); |
| 689 | acct = xs_dict_append(acct, "following_count", ni); | 689 | acct = xs_dict_append(acct, "following_count", ni); |
| @@ -1309,10 +1309,10 @@ void credentials_get(char **body, char **ctype, int *status, snac snac) | |||
| 1309 | 1309 | ||
| 1310 | /* does this user want to publish their contact metrics? */ | 1310 | /* does this user want to publish their contact metrics? */ |
| 1311 | if (xs_is_true(xs_dict_get(snac.config, "show_contact_metrics"))) { | 1311 | if (xs_is_true(xs_dict_get(snac.config, "show_contact_metrics"))) { |
| 1312 | xs *fwing = following_list(&snac); | 1312 | int fwing = following_list_len(&snac); |
| 1313 | xs *fwers = follower_list(&snac); | 1313 | int fwers = follower_list_len(&snac); |
| 1314 | xs *ni = xs_number_new(xs_list_len(fwing)); | 1314 | xs *ni = xs_number_new(fwing); |
| 1315 | xs *ne = xs_number_new(xs_list_len(fwers)); | 1315 | xs *ne = xs_number_new(fwers); |
| 1316 | 1316 | ||
| 1317 | acct = xs_dict_append(acct, "followers_count", ne); | 1317 | acct = xs_dict_append(acct, "followers_count", ne); |
| 1318 | acct = xs_dict_append(acct, "following_count", ni); | 1318 | acct = xs_dict_append(acct, "following_count", ni); |