From 368b1eb4523e64a196dc23c96452d41dbc009ad4 Mon Sep 17 00:00:00 2001 From: default Date: Sat, 29 Jul 2023 15:29:11 +0200 Subject: [PATCH] Fixed outbox to be an OrderedCollection of Create+Note, not Note. --- activitypub.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/activitypub.c b/activitypub.c index 05eb32f..293e6b2 100644 --- a/activitypub.c +++ b/activitypub.c @@ -768,6 +768,7 @@ xs_dict *msg_base(snac *snac, const char *type, const char *id, if (strcmp(id, "@wrapper") == 0) { /* like @object, but always generate the same id */ if (object != NULL) { + date = xs_dict_get(object, "published"); did = xs_fmt("%s/%s", xs_dict_get(object, "id"), type); id = did; } @@ -945,7 +946,7 @@ xs_dict *msg_actor(snac *snac) xs_dict *msg_create(snac *snac, const xs_dict *object) /* creates a 'Create' message */ { - xs_dict *msg = msg_base(snac, "Create", "@wrapper", snac->actor, "@now", object); + xs_dict *msg = msg_base(snac, "Create", "@wrapper", snac->actor, NULL, object); xs_val *v; if ((v = xs_dict_get(object, "attributedTo"))) @@ -1992,8 +1993,8 @@ int activitypub_get_handler(const xs_dict *req, const char *q_path, 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); + xs *c_msg = msg_create(&snac, i); + list = xs_list_append(list, c_msg); } } }