mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-12-26 01:03:37 +00:00
Fixed outbox to be an OrderedCollection of Create+Note, not Note.
This commit is contained in:
parent
7c393ef436
commit
368b1eb452
1 changed files with 4 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue