summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-12-02 19:30:59 +0100
committerdefault <nobody@localhost>2022-12-02 19:30:59 +0100
commit33c8a73c17667b117f1bb720a5a32c485fd7d130 (patch)
treee5d09009501e971af7481e88f21edb161557581d
parentc00e3afcdc8cf1503439a174621090b133ad329f (diff)
Fixed RSS and outbox to use the new data storage.
-rw-r--r--activitypub.c15
-rw-r--r--html.c6
2 files changed, 14 insertions, 7 deletions
diff --git a/activitypub.c b/activitypub.c
index 8e173c5..8a5dd3c 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -1101,13 +1101,16 @@ int activitypub_get_handler(d_char *req, char *q_path,
p = elems;
while (xs_list_iter(&p, &v)) {
- xs *i = timeline_get(&snac, v);
- char *type = xs_dict_get(i, "type");
- char *id = xs_dict_get(i, "id");
+ xs *i = NULL;
- if (type && id && strcmp(type, "Note") == 0 && xs_startswith(id, snac.actor)) {
- i = xs_dict_del(i, "_snac");
- list = xs_list_append(list, i);
+ if (valid_status(object_get_by_md5(v, &i, NULL))) {
+ char *type = xs_dict_get(i, "type");
+ char *id = xs_dict_get(i, "id");
+
+ if (type && id && strcmp(type, "Note") == 0 && xs_startswith(id, snac.actor)) {
+ i = xs_dict_del(i, "_snac");
+ list = xs_list_append(list, i);
+ }
}
}
diff --git a/html.c b/html.c
index 4c1ca79..f7766e6 100644
--- a/html.c
+++ b/html.c
@@ -1131,7 +1131,11 @@ int html_get_handler(d_char *req, char *q_path, char **body, int *b_size, char *
p = elems;
while (xs_list_iter(&p, &v)) {
- xs *msg = timeline_get(&snac, v);
+ xs *msg = NULL;
+
+ if (!valid_status(object_get_by_md5(v, &msg, NULL)))
+ continue;
+
char *id = xs_dict_get(msg, "id");
if (!xs_startswith(id, snac.actor))