diff options
| author | 2025-08-19 21:38:44 +0200 | |
|---|---|---|
| committer | 2025-08-19 21:38:44 +0200 | |
| commit | eecfeec3745333451de6a2b1754f43f171e23e5d (patch) | |
| tree | 0521647efd7aba9cca0911acb387872f5f303f2d /activitypub.c | |
| parent | Merge pull request 'master' (#9) from grunfink/snac2:master into master (diff) | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | penes-snac2-eecfeec3745333451de6a2b1754f43f171e23e5d.tar.gz penes-snac2-eecfeec3745333451de6a2b1754f43f171e23e5d.tar.xz penes-snac2-eecfeec3745333451de6a2b1754f43f171e23e5d.zip | |
Merge pull request 'updates holen' (#10) from grunfink/snac2:master into master
Reviewed-on: https://codeberg.org/zen/snac2/pulls/10
Diffstat (limited to 'activitypub.c')
| -rw-r--r-- | activitypub.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/activitypub.c b/activitypub.c index 100db67..634e243 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -1518,7 +1518,35 @@ xs_dict *msg_delete(snac *snac, const char *id) | |||
| 1518 | /* now create the Delete */ | 1518 | /* now create the Delete */ |
| 1519 | msg = msg_base(snac, "Delete", "@object", snac->actor, "@now", tomb); | 1519 | msg = msg_base(snac, "Delete", "@object", snac->actor, "@now", tomb); |
| 1520 | 1520 | ||
| 1521 | msg = xs_dict_append(msg, "to", public_address); | 1521 | xs *to = xs_list_new(); |
| 1522 | xs *involved = object_likes(id); | ||
| 1523 | xs *boosts = object_announces(id); | ||
| 1524 | xs *children = object_children(id); | ||
| 1525 | const char *md5; | ||
| 1526 | |||
| 1527 | involved = xs_list_cat(involved, boosts); | ||
| 1528 | involved = xs_list_cat(involved, children); | ||
| 1529 | |||
| 1530 | /* add everybody */ | ||
| 1531 | to = xs_list_append(to, public_address); | ||
| 1532 | |||
| 1533 | /* add actors that liked, boosted or replied to this */ | ||
| 1534 | xs_list_foreach(involved, md5) { | ||
| 1535 | xs *actor = NULL; | ||
| 1536 | |||
| 1537 | if (valid_status(object_get_by_md5(md5, &actor))) { | ||
| 1538 | const char *id = xs_dict_get(actor, "id"); | ||
| 1539 | const char *atto = get_atto(actor); | ||
| 1540 | |||
| 1541 | if (xs_is_string(atto)) | ||
| 1542 | to = xs_list_append(to, atto); | ||
| 1543 | else | ||
| 1544 | if (xs_is_string(id)) | ||
| 1545 | to = xs_list_append(to, id); | ||
| 1546 | } | ||
| 1547 | } | ||
| 1548 | |||
| 1549 | msg = xs_dict_append(msg, "to", to); | ||
| 1522 | 1550 | ||
| 1523 | return msg; | 1551 | return msg; |
| 1524 | } | 1552 | } |