commit 368b1eb

default  ·  2023-07-29 13:29:11 +0000 UTC
parent 7c393ef
Fixed outbox to be an OrderedCollection of Create+Note, not Note.
1 files changed,  +4, -3
+4, -3
 1@@ -768,6 +768,7 @@ xs_dict *msg_base(snac *snac, const char *type, const char *id,
 2         if (strcmp(id, "@wrapper") == 0) {
 3             /* like @object, but always generate the same id */
 4             if (object != NULL) {
 5+                date = xs_dict_get(object, "published");
 6                 did = xs_fmt("%s/%s", xs_dict_get(object, "id"), type);
 7                 id = did;
 8             }
 9@@ -945,7 +946,7 @@ xs_dict *msg_actor(snac *snac)
10 xs_dict *msg_create(snac *snac, const xs_dict *object)
11 /* creates a 'Create' message */
12 {
13-    xs_dict *msg = msg_base(snac, "Create", "@wrapper", snac->actor, "@now", object);
14+    xs_dict *msg = msg_base(snac, "Create", "@wrapper", snac->actor, NULL, object);
15     xs_val *v;
16 
17     if ((v = xs_dict_get(object, "attributedTo")))
18@@ -1992,8 +1993,8 @@ int activitypub_get_handler(const xs_dict *req, const char *q_path,
19                 char *id   = xs_dict_get(i, "id");
20 
21                 if (type && id && strcmp(type, "Note") == 0 && xs_startswith(id, snac.actor)) {
22-                    i = xs_dict_del(i, "_snac");
23-                    list = xs_list_append(list, i);
24+                    xs *c_msg = msg_create(&snac, i);
25+                    list = xs_list_append(list, c_msg);
26                 }
27             }
28         }