commit 33c8a73
default
·
2022-12-02 18:30:59 +0000 UTC
parent c00e3af
Fixed RSS and outbox to use the new data storage.
2 files changed,
+14,
-7
M
html.c
+9,
-6
1@@ -1101,13 +1101,16 @@ int activitypub_get_handler(d_char *req, char *q_path,
2
3 p = elems;
4 while (xs_list_iter(&p, &v)) {
5- xs *i = timeline_get(&snac, v);
6- char *type = xs_dict_get(i, "type");
7- char *id = xs_dict_get(i, "id");
8+ xs *i = NULL;
9
10- if (type && id && strcmp(type, "Note") == 0 && xs_startswith(id, snac.actor)) {
11- i = xs_dict_del(i, "_snac");
12- list = xs_list_append(list, i);
13+ if (valid_status(object_get_by_md5(v, &i, NULL))) {
14+ char *type = xs_dict_get(i, "type");
15+ char *id = xs_dict_get(i, "id");
16+
17+ if (type && id && strcmp(type, "Note") == 0 && xs_startswith(id, snac.actor)) {
18+ i = xs_dict_del(i, "_snac");
19+ list = xs_list_append(list, i);
20+ }
21 }
22 }
23
M
html.c
+5,
-1
1@@ -1131,7 +1131,11 @@ int html_get_handler(d_char *req, char *q_path, char **body, int *b_size, char *
2
3 p = elems;
4 while (xs_list_iter(&p, &v)) {
5- xs *msg = timeline_get(&snac, v);
6+ xs *msg = NULL;
7+
8+ if (!valid_status(object_get_by_md5(v, &msg, NULL)))
9+ continue;
10+
11 char *id = xs_dict_get(msg, "id");
12
13 if (!xs_startswith(id, snac.actor))