aboutsummaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authorgrunfink <grunfink@comam.es>2025-07-27 16:02:01 +0200
committergrunfink <grunfink@comam.es>2025-07-27 16:02:01 +0200
commit971fc024f25080238a3625c646ce3601318d9f0a (patch)
tree85e4190a8a7cb0e5e9b0d15a329b641c152a7f08 /activitypub.c
parent4923628ac6f23c4cf4257e8f11e9668295721a8d (diff)
Also add children to msg_delete().
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/activitypub.c b/activitypub.c
index 968450b..634e243 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -1519,21 +1519,28 @@ xs_dict *msg_delete(snac *snac, const char *id)
msg = msg_base(snac, "Delete", "@object", snac->actor, "@now", tomb);
xs *to = xs_list_new();
- xs *admirers = object_likes(id);
+ xs *involved = object_likes(id);
xs *boosts = object_announces(id);
- admirers = xs_list_cat(admirers, boosts);
+ xs *children = object_children(id);
const char *md5;
+ involved = xs_list_cat(involved, boosts);
+ involved = xs_list_cat(involved, children);
+
/* add everybody */
to = xs_list_append(to, public_address);
- /* add actors that liked or boosted this */
- xs_list_foreach(admirers, md5) {
+ /* add actors that liked, boosted or replied to this */
+ xs_list_foreach(involved, md5) {
xs *actor = NULL;
if (valid_status(object_get_by_md5(md5, &actor))) {
const char *id = xs_dict_get(actor, "id");
+ const char *atto = get_atto(actor);
+ if (xs_is_string(atto))
+ to = xs_list_append(to, atto);
+ else
if (xs_is_string(id))
to = xs_list_append(to, id);
}
@@ -1541,9 +1548,6 @@ xs_dict *msg_delete(snac *snac, const char *id)
msg = xs_dict_append(msg, "to", to);
-xs_json_dump(msg, 4, stdout);
-printf("\n");
-
return msg;
}