diff options
author | default <nobody@localhost> | 2023-10-16 19:14:44 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-10-16 19:14:44 +0200 |
commit | 22cc5f42a5a74dc5b5f2e18e56fd7be17fa784b5 (patch) | |
tree | b2ad6ae74b42c460a3b501cc0ad1f5fa93a8e0ef | |
parent | b95d4d7518e5e71601f3d36405e76153036c8c26 (diff) |
Drop replies to hidden posts.
-rw-r--r-- | activitypub.c | 23 |
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) char *in_reply_to = xs_dict_get(object, "inReplyTo"); xs *wrk = NULL; - timeline_request(snac, &in_reply_to, &wrk, 0); - - if (timeline_add(snac, id, object)) { - snac_log(snac, xs_fmt("new 'Note' %s %s", actor, id)); - do_notify = 1; + if (!xs_is_null(in_reply_to) && is_hidden(snac, in_reply_to)) { + snac_debug(snac, 0, xs_fmt("dropped reply %s to hidden post %s", id, in_reply_to)); } + else { + timeline_request(snac, &in_reply_to, &wrk, 0); - /* if it has a "name" field, it may be a vote for a question */ - const char *name = xs_dict_get(object, "name"); + if (timeline_add(snac, id, object)) { + snac_log(snac, xs_fmt("new 'Note' %s %s", actor, id)); + do_notify = 1; + } + + /* if it has a "name" field, it may be a vote for a question */ + const char *name = xs_dict_get(object, "name"); - if (!xs_is_null(name) && *name && !xs_is_null(in_reply_to) && *in_reply_to) - update_question(snac, in_reply_to); + if (!xs_is_null(name) && *name && !xs_is_null(in_reply_to) && *in_reply_to) + update_question(snac, in_reply_to); + } } else if (strcmp(utype, "Question") == 0) { /** **/ |