summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authorGravatar default2023-10-16 19:14:44 +0200
committerGravatar default2023-10-16 19:14:44 +0200
commit22cc5f42a5a74dc5b5f2e18e56fd7be17fa784b5 (patch)
treeb2ad6ae74b42c460a3b501cc0ad1f5fa93a8e0ef /activitypub.c
parentUpdated RELEASE_NOTES. (diff)
downloadsnac2-22cc5f42a5a74dc5b5f2e18e56fd7be17fa784b5.tar.gz
snac2-22cc5f42a5a74dc5b5f2e18e56fd7be17fa784b5.tar.xz
snac2-22cc5f42a5a74dc5b5f2e18e56fd7be17fa784b5.zip
Drop replies to hidden posts.
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/activitypub.c b/activitypub.c
index 35645af..d6ad191 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -1577,18 +1577,23 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
1577 char *in_reply_to = xs_dict_get(object, "inReplyTo"); 1577 char *in_reply_to = xs_dict_get(object, "inReplyTo");
1578 xs *wrk = NULL; 1578 xs *wrk = NULL;
1579 1579
1580 timeline_request(snac, &in_reply_to, &wrk, 0); 1580 if (!xs_is_null(in_reply_to) && is_hidden(snac, in_reply_to)) {
1581 1581 snac_debug(snac, 0, xs_fmt("dropped reply %s to hidden post %s", id, in_reply_to));
1582 if (timeline_add(snac, id, object)) {
1583 snac_log(snac, xs_fmt("new 'Note' %s %s", actor, id));
1584 do_notify = 1;
1585 } 1582 }
1583 else {
1584 timeline_request(snac, &in_reply_to, &wrk, 0);
1586 1585
1587 /* if it has a "name" field, it may be a vote for a question */ 1586 if (timeline_add(snac, id, object)) {
1588 const char *name = xs_dict_get(object, "name"); 1587 snac_log(snac, xs_fmt("new 'Note' %s %s", actor, id));
1588 do_notify = 1;
1589 }
1590
1591 /* if it has a "name" field, it may be a vote for a question */
1592 const char *name = xs_dict_get(object, "name");
1589 1593
1590 if (!xs_is_null(name) && *name && !xs_is_null(in_reply_to) && *in_reply_to) 1594 if (!xs_is_null(name) && *name && !xs_is_null(in_reply_to) && *in_reply_to)
1591 update_question(snac, in_reply_to); 1595 update_question(snac, in_reply_to);
1596 }
1592 } 1597 }
1593 else 1598 else
1594 if (strcmp(utype, "Question") == 0) { /** **/ 1599 if (strcmp(utype, "Question") == 0) { /** **/