mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 13:25:04 +00:00
mastoapi: fix create list response & duplicate actor adding
This commit is contained in:
parent
d668fddd2f
commit
3fb0a0acf0
2 changed files with 6 additions and 4 deletions
2
data.c
2
data.c
|
@ -1925,7 +1925,7 @@ xs_val *list_content(snac *user, const char *list, const char *actor_md5, int op
|
||||||
|
|
||||||
case 1: /** append actor to list **/
|
case 1: /** append actor to list **/
|
||||||
if (actor_md5 != NULL) {
|
if (actor_md5 != NULL) {
|
||||||
if (!index_in(fn, actor_md5))
|
if (!index_in_md5(fn, actor_md5))
|
||||||
index_add_md5(fn, actor_md5);
|
index_add_md5(fn, actor_md5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1974,7 +1974,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
|
||||||
d = xs_dict_append(d, "replies_policy", "list");
|
d = xs_dict_append(d, "replies_policy", "list");
|
||||||
d = xs_dict_append(d, "exclusive", xs_stock(XSTYPE_FALSE));
|
d = xs_dict_append(d, "exclusive", xs_stock(XSTYPE_FALSE));
|
||||||
|
|
||||||
out = xs_list_append(out, d);
|
out = xs_dup(d);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2971,8 +2971,10 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
|
||||||
list_content(&snac, id, v, 1);
|
list_content(&snac, id, v, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
*ctype = "application/json";
|
xs *out = xs_dict_new();
|
||||||
status = HTTP_STATUS_OK;
|
*body = xs_json_dumps(out, 4);
|
||||||
|
*ctype = "application/json";
|
||||||
|
status = HTTP_STATUS_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue