summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c7
1 files 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,
768 if (strcmp(id, "@wrapper") == 0) { 768 if (strcmp(id, "@wrapper") == 0) {
769 /* like @object, but always generate the same id */ 769 /* like @object, but always generate the same id */
770 if (object != NULL) { 770 if (object != NULL) {
771 date = xs_dict_get(object, "published");
771 did = xs_fmt("%s/%s", xs_dict_get(object, "id"), type); 772 did = xs_fmt("%s/%s", xs_dict_get(object, "id"), type);
772 id = did; 773 id = did;
773 } 774 }
@@ -945,7 +946,7 @@ xs_dict *msg_actor(snac *snac)
945xs_dict *msg_create(snac *snac, const xs_dict *object) 946xs_dict *msg_create(snac *snac, const xs_dict *object)
946/* creates a 'Create' message */ 947/* creates a 'Create' message */
947{ 948{
948 xs_dict *msg = msg_base(snac, "Create", "@wrapper", snac->actor, "@now", object); 949 xs_dict *msg = msg_base(snac, "Create", "@wrapper", snac->actor, NULL, object);
949 xs_val *v; 950 xs_val *v;
950 951
951 if ((v = xs_dict_get(object, "attributedTo"))) 952 if ((v = xs_dict_get(object, "attributedTo")))
@@ -1992,8 +1993,8 @@ int activitypub_get_handler(const xs_dict *req, const char *q_path,
1992 char *id = xs_dict_get(i, "id"); 1993 char *id = xs_dict_get(i, "id");
1993 1994
1994 if (type && id && strcmp(type, "Note") == 0 && xs_startswith(id, snac.actor)) { 1995 if (type && id && strcmp(type, "Note") == 0 && xs_startswith(id, snac.actor)) {
1995 i = xs_dict_del(i, "_snac"); 1996 xs *c_msg = msg_create(&snac, i);
1996 list = xs_list_append(list, i); 1997 list = xs_list_append(list, c_msg);
1997 } 1998 }
1998 } 1999 }
1999 } 2000 }