diff --git a/activitypub.c b/activitypub.c index 7599b58..e5713fa 100644 --- a/activitypub.c +++ b/activitypub.c @@ -445,12 +445,19 @@ d_char *msg_accept(snac *snac, char *object, char *to) } -d_char *msg_update(snac *snac, char *object) +xs_dict *msg_update(snac *snac, xs_dict *object) /* creates an Update message */ { d_char *msg = msg_base(snac, "Update", "@object", snac->actor, "@now", object); - msg = xs_dict_append(msg, "to", public_address); + char *type = xs_dict_get(object, "type"); + + if (strcmp(type, "Note") == 0) { + msg = xs_dict_append(msg, "to", xs_dict_get(object, "to")); + msg = xs_dict_append(msg, "cc", xs_dict_get(object, "cc")); + } + else + msg = xs_dict_append(msg, "to", public_address); return msg; } diff --git a/snac.h b/snac.h index 284b30e..5815656 100644 --- a/snac.h +++ b/snac.h @@ -183,7 +183,7 @@ xs_dict *msg_note(snac *snac, xs_str *content, xs_val *rcpts, d_char *msg_undo(snac *snac, char *object); d_char *msg_delete(snac *snac, char *id); d_char *msg_actor(snac *snac); -d_char *msg_update(snac *snac, char *object); +xs_dict *msg_update(snac *snac, xs_dict *object); int activitypub_request(snac *snac, char *url, d_char **data); int actor_request(snac *snac, char *actor, d_char **data);