Slon/Api/V1/Accounts: Fix nested for loops in @slon_api_v1_accounts_get
This commit is contained in:
parent
ba296cceb8
commit
5010de73a0
1 changed files with 5 additions and 4 deletions
|
@ -152,6 +152,7 @@ U0 @slon_api_v1_accounts_get(SlonHttpSession* session)
|
||||||
no_warn scratch_buffer;
|
no_warn scratch_buffer;
|
||||||
|
|
||||||
I64 i;
|
I64 i;
|
||||||
|
I64 j;
|
||||||
|
|
||||||
JsonObject* acct = NULL;
|
JsonObject* acct = NULL;
|
||||||
if (!StrICmp("relationships", session->path(3))) {
|
if (!StrICmp("relationships", session->path(3))) {
|
||||||
|
@ -169,8 +170,8 @@ U0 @slon_api_v1_accounts_get(SlonHttpSession* session)
|
||||||
JsonObject* my_account = @slon_api_account_by_id(session->auth->@("account_id"));
|
JsonObject* my_account = @slon_api_account_by_id(session->auth->@("account_id"));
|
||||||
JsonArray* my_followers = db->o("followers")->a(my_account->@("username"));
|
JsonArray* my_followers = db->o("followers")->a(my_account->@("username"));
|
||||||
if (my_followers) {
|
if (my_followers) {
|
||||||
for (i = 0; i < my_followers->length; i++) {
|
for (j = 0; j < my_followers->length; j++) {
|
||||||
if (my_followers->@(i) && !StrICmp(my_followers->@(i), target_account->@("remote_actor"))) {
|
if (my_followers->@(j) && !StrICmp(my_followers->@(j), target_account->@("remote_actor"))) {
|
||||||
followed_by = TRUE;
|
followed_by = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -178,8 +179,8 @@ U0 @slon_api_v1_accounts_get(SlonHttpSession* session)
|
||||||
}
|
}
|
||||||
JsonArray* my_following = db->o("following")->a(my_account->@("username"));
|
JsonArray* my_following = db->o("following")->a(my_account->@("username"));
|
||||||
if (my_following) {
|
if (my_following) {
|
||||||
for (i = 0; i < my_following->length; i++) {
|
for (j = 0; j < my_following->length; j++) {
|
||||||
if (my_following->@(i) && !StrICmp(my_following->@(i), target_account->@("remote_actor"))) {
|
if (my_following->@(j) && !StrICmp(my_following->@(j), target_account->@("remote_actor"))) {
|
||||||
following = TRUE;
|
following = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue