summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-03-06 11:26:43 +0100
committerdefault <nobody@localhost>2023-03-06 11:26:43 +0100
commit60f77b6cad7f64a4b6ef44010c8d103093ce32c2 (patch)
tree10504593969dd8ccba2df8aa8a0ed016885965d8 /activitypub.c
parent751211684f6c987be8b5648b6f0dc5a363547df6 (diff)
msg_update() sends copies the 'to' and 'cc' fields in notes.
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c11
1 files changed, 9 insertions, 2 deletions
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;
}